New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Q: Issue with dynamic linked csound opcodes #1648
Comments
Is this crash strictly on Windows? We might need our Windows experts here (@stekyne ?). I only know about unix-like environments. |
i only could reproduce it there, on my linux it all works fine. on mac also no problem so far. |
It's not that easy to tell what's going on unfortunately. Is there any kind of crash dump, error code, stack trace you can give? I've not experimented with |
I've managed to reproduce this I think. I built for Windows with Line 820 in f0bea4d
You can see here that the symbol (INIT_STATIC_MODULES) needs to be defined within the csound64 target but it's only being set per file. Not quite sure this was ever working correctly unless I'm misunderstanding something. Line 963 in 7b7661e
I added the symbol to the target and the correct code path runs but now I'm getting the crash on unload. It's crashing while in Edit: My changes are here: https://github.com/csound/csound/pull/1649/files |
i think this could be exactly the situation i have, because i call explicitly init_static_modules in my csound init method (this i could change now to set the INIT_STATIC_MODULES for compiling). And this is exactly what i wonder about, that the signalflowgraph.dll is loaded anyway and then crashing on unload. |
it may caused somewhere here csound/Opcodes/signalflowgraph.cpp Line 1508 in 7b7661e
|
and i guess that here is loaded everything which is found independent of a variable: Line 565 in f0bea4d
btw: the crash is also gone if i simple move the plugins64 folder to the desktop. |
Csound will load anything it finds in the OPCODE6DIR64, so if the DLL is there it will be loaded. I don't think we have a means to say "don't load this file". Btw, @stekyne thanks for the fix. Could you apply these changes to the csound6 branch when you are ready? |
Merged to both branches now |
if this is still causing bother @rorywalsh has a solution to prevent Csound from loading dynamic opcodes from a different installation on Windows. Maybe he can post it here. |
This was happening with the Windows version of Csound that we ship with CsoundUnity. The only solution we found was to stop Csound from loading any plugins by called |
@rorywalsh thanks this seems to work! |
Victor poiinted out we have ways of loading a module, but no way of ignoring one. Should we implement |
I'm not sure it's needed John. One can always either point opcodedir someplace else, or simply move the opcode lib in question out of opcodedir. |
There is |
For the vcvrack plugin i have made a static build of the csoundlib64 including the dynamic opcode families (signalflow,doppler etc.)
(this static lib is linked then in the plugin.dll for loading in vcvrack, and ensures that the plugin is running without installing csound)
This i have done so:
added following switches in CMake
option(BUILD_STATIC_LIBRARY "Also build a static version of the csound library" ON)
option(INIT_STATIC_MODULES "Also build opcodes in a static version of the csound library" ON)
-> works: the obj files of the opcodes are in the static lib.
Then in the code i call:
init_static_modules(csound->GetCsound());
This works fine but on windows with an installed csound distribution (all 6.18) vcvrack crashed when deleting a csound module.
Due to debugger output it crashes somewhere in signalflowgraph.dll. It seems that even if i have linked those opcodes statically
the dynamic version is used if installed. But this seems to crash.
Any ideas what else must be done or how is it done correctly?
However i can simply put those modules out. Then they would only work when csound is installed,
but not out of the box.
The text was updated successfully, but these errors were encountered: