Random plugin crashes with MSVC
Copy link to clipboard
Copied
We've been building Adobe export plugins for many years and this went fairly well.
This week I was confronted that our plugin didn't want to run anymore, didn't happen always as it seemed to be related to being built on a computer with a more recent version of Microsoft Visual Studio installed and only in release builds.
What we observe is an runtime error with a locking a std::mutex crashing Adobe.
After some trial and error we found that when we 'disable' the runtime dlls from Microsoft from the Application Support directory of After Effects the issue goes away - as Adobe would be using the system installed runtime dlls in that case.
I'm not sure why Adobe decided to ship runtime dllls next to their binaries and not rely on a minimum installed version of these which I've always been advised as the proper way to do things.
Anyhow it seems that this blocks us from moving foward to a newer version of Visual Studio as that would be blocking creating plugins for Adobe.
Machines with MSVC 2022.8 still work but with 2022.12 are blocking.
Is there anything we can do make sure our plugins can be built with a later version?
Copy link to clipboard
Copied
either ship your plugins with the correct distribuatable dlls, or compile your plugin's /mt.
Copy link to clipboard
Copied
we do ship them with the correct distributable dlls and install them to the system location as is appropriate with the vcredist installer. But this doesn't work when Adobe puts these side-by-side. It's annoying as this has been working great for many years only started to be a problem since a recent msvc upgrade.
Copy link to clipboard
Copied
Gonna try to build without the runtime but not sure what the impact is on our CI pipeline as the Adobe plugins are only a small part of our entire build chain where files are shared. A static runtime for everything will not be an option for sure.
Copy link to clipboard
Copied
there's an order to the locations where the loaded dll will be looked for:
https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order
you can place the correct dlls in the same folder as your plugin, and make sure that this location is searched in first.
Copy link to clipboard
Copied
Would have been splendid for Adobe to adhere to that search order but they probably have good reasons not too.
Static build is not an option on our toolchain setup but I managed to locate them thru some manifest trickery. Also read that this is due to std::mutex changes from Microsofts standard library made in 17.9 release.

