Seg Fault in juce_vst3_helper - plugin with libusb

Hi :slight_smile:

I’m making a VST plugin wihch includes call to libusb in order to send data outside the DAW.
This seems to create some sort of issue with juce_vst3_helper at compile time which fails with a segmentation fault.

The AU plugin compiles fine. When I comment out the lines with the libusb_* functions, the seg fault disappears.

I’m on MacOs Sonoma with Xcode 15.1 (and Juce v7.0.9) which seemed to have been quite a nightmare (Link Time Optimisation in particular) but I’m not sure this is related, I think it’s caused by compiling with the external libusb.

Thank you!
Simon

Does it still happen with LTO disabled?

You mean when I add the -Wl,-ld_classic ?

Yes it does (but maybe I’m doing this wrong? See picture).

Actually I just saw this warning which I think might be the issue?

=> ld: warning: dylib (/opt/homebrew/Cellar/libusb/1.0.26/lib/libusb-1.0.dylib) was built for newer macOS version (14.0) than being linked (11.0)

EDIT: nope, not it, I got rid of the warning by changing the macOS Deployment Target to 14, but the segmentation fault is still there

Was there any resolution on this? I am getting the same exact seg fault. I was able to clean build files and make it go away for a while, but now that doesn’t work and my vst3 build is broken.

Actually yes - basically the VST3_helper runs part of the plugin (I think at least the constructor of the Audio Processor class), and in my case there was a segmentation fault in the constructor.

My guess is this is caused by your code - try commenting out some bits of in the Plugin processor to identify which bits of code generates the segmentation fault :slight_smile:

Thanks, that makes sense - I was working on the constructor of my plugin. It seems like vst3 “helper” is triggering a runtime error at build time, which I find decidedly unhelpful. I can’t debug it at build time. Luckily I have other plugin formats that don’t have a “helper”, and I use that term very loosely :), and I can debug the problem there. No idea why juce added this helper - it was not there in v6.