-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Static class name causes an error when loading into the same process from different dylibs #29
Comments
Hmm, how would you go about solving this if the classes were defined in pure Objective-C? Is the assumption then just that the dynamic linker says "they have the same name, so they're probably the same", and only creates one class? That seems like a place ripe for unsoundness. |
(I'm considering how to resolve this more generally in |
I suspect a fix for you would be to create a shared dylib that re-exports |
No idea about pure ObjC honestly, I'm just using the bare minimum necessary for MacOS compatibility. This is what I'm doing with a custom class in my own code:
|
Fair enough. I'm pretty sure there's not much that |
Thanks for the comments. The issue you created is a good ergonomics improvement but wouldn't solve this issue. The issue here is that two dylibs, let's call them A and B, are trying to create a class with the exact same name and the latter of those fails. Any static name doesn't solve the issue. Again, I have no idea how pure ObjC would solve this. Also, your suggested solution wouldn't work either as that depends on the whole Rust audio plugin ecosystem (which frankly is tiny at this point so "fortunately" that makes the issue less severe) adapting the dylib, which isn't realistic. Also, I'm not using raw-window-metal directly but through slint. |
We can choose to just use the class if the names are the same. But I don't want to do that unless I'm certain they're actually the same (which we are not if potentially two versions of |
Name of the issue is what I'm imagining is going on anyway.
I'm creating an audio effect plugin for use in DAWs (Digital Audio Workstations). The plugin is being distributed in two formats, CLAP and VST3, which for the purposes of this bug just means that they're separate dylibs. Now, I can add multiple instances of the plugin just fine if they're the same format, but adding two plugins with different formats causes the following error:
If I understand the situation right, one of the dylibs is trying to create a class instance with a name that the other dylib has already used. Presumably the same error would happen if there was another plugin using this crate.
The way I'm solving this in my own code is that I'm adding a random prefix to any ObjC class names I'm declaring to avoid this exact error.
The text was updated successfully, but these errors were encountered: