Correct way to distribute plugins?



I’ve recently put together a phase correction plugin, it started off as just something for myself but I later decided to share it with the folks on a music production forum I frequent. The problem is that although the plugin works just fine for me, so far everyone else who has downloaded it and tried it says it crashes immediately.

I figured the problem was to do with some missing dependencies but doing another build with ‘Use Static Runtime’ selected hasn’t fixed the issue. I’ve also checked those users PC specs and tried the same DAW as them but I still don’t get a problem where they do.

The way I’m distributing this is to build it locally then upload the dll file for others to download. Is there some step I’m missing that would prevent this from working for others?

If it’s useful the plugin source can be found here and the built plugin dll can be downloaded here

Any ideas would be appreciated


Are you building a Release build?

Check out Dependency Walker



Doesn’t look like this is an issue about how the plugin is distributed. Rather there seems to be a bug in the code itself.

I built the plugin from source with Visual Studio 2017 and ran it under the debugger with Cockos Reaper as the host application. The plugin crashes due to a modulo calculation that is given zeros as inputs in this function :

inline int positiveModulo(int val, int mod)
return (val % mod + mod) % mod;

So I guess you maybe never ran the plugin under the debugger yourself…? Or maybe there’s some issue that sometimes gives zeros as inputs into that function and sometimes not…?


Thanks for the replies, I really appreciate it.

Dependency Walker is showing red for the following dlls SHCORE.dll SHLWAPI.dll IEFRAME.dll. I’m not really sure what any of these are for but I’ll look into them.

That’s really interesting. I always develop in the debugger and use PluginHost for testing and I haven’t seen that issue before. Also I’ve been using the plugin for sometime myself in Bitwig without issues and tested it in the trial version of Live 9 since that’s what one of my users was running, again without problems. There must be some set of circumstances that cause this to happen that I’m not able to reproduce. It’s really helpful to me that you’ve managed to isolate it to that function, I should be able to put some safeguards around it and hope for the best.


OK, so, in your initial post you wrote that the plugin crashes “immediately” for other people when they try to load it. Here when loading your binary in Reaper, the plugin actually managed to get its GUI open and then I got the Windows error dialog with the exception code c0000094 which seemed to point to a math division problem. Which pointed me to get the source code and build and run a debug version. And then I ended up seeing the above mentioned function as the problem in the debugger. So maybe that thing is unrelated to the original problem. Still probably useful for you to know that the function in question may be called with invalid inputs.


Are you building a RELEASE build for them?



’Immediately’ was just how my users described it to me so I’m not 100% sure of the exact circumstances. Actually having said that one of them did send me a screen shot which showed the GUI so perhaps they are running into the same issue. I’m still a bit clueless why I don’t see the same problem myself but knowing where the crash occurs at least lets me narrow the possibilities. I’m going to put some safeguards and logging on anything that could pass zero to that function and have my users try it again and send me the logs. You’ve been a great help, thank you.

Sorry I forgot to clarify, I am distributing the release versions. Those dlls all seem to be windows system dlls so I don’t think they’re really anything to do with me


Use a FileLogger to create a log and put some logging in your code… then have them send you a copy of the log file. If you use some smart logging you should be able to ID where the issue is.