Tremus / CPLUG

C wrapper for VST3, AUv2, CLAP audio plugin formats
Other
97 stars 8 forks source link

Crash opening/clicking GUI in JUCE's Audio Plugin Host (VST3 + MacOS) #7

Closed ArborealAudio closed 14 hours ago

ArborealAudio commented 1 month ago

When opening/closing causes crash:

Thread 0 Crashed:: JUCE Message Thread Dispatch queue: com.apple.main-thread
0   cplug_example                          0x10856d250 cplug_atomic_load_i32 + 12
1   cplug_example                          0x10856e0e0 tickGUI + 48
2   cplug_example                          0x10856ee1c timer_cb + 48
3   CoreFoundation                         0x1a9480338 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
4   CoreFoundation                         0x1a947ffe0 __CFRunLoopDoTimer + 940
5   CoreFoundation                         0x1a947fb38 __CFRunLoopDoTimers + 356
6   CoreFoundation                         0x1a94652b8 __CFRunLoopRun + 1852
7   CoreFoundation                         0x1a9464428 CFRunLoopRunSpecific + 612
8   HIToolbox                              0x1b2cbadf0 RunCurrentEventLoopInMode + 292
9   HIToolbox                              0x1b2cbac2c ReceiveNextEventCommon + 648
10  HIToolbox                              0x1b2cba984 _BlockUntilNextEventMatchingListInModeWithFilter + 76
11  AppKit                                 0x1ac68c134 _DPSNextEvent + 636
12  AppKit                                 0x1ac68b2d0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
13  AppKit                                 0x1ac67f734 -[NSApplication run] + 464
14  AudioPluginHost                        0x101003be4 juce::MessageManager::runDispatchLoop() + 76
15  AudioPluginHost                        0x101003b0c juce::JUCEApplicationBase::main() + 216
16  AudioPluginHost                        0x1010039dc juce::JUCEApplicationBase::main(int, char const**) + 68
17  AudioPluginHost                        0x100861c50 main + 56
18  dyld                                   0x1a902ff28 start + 2236

When a click causes crash:

Thread 0 Crashed:: JUCE Message Thread Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                        0x1a8fed834 objc_msgSend + 52
1   cplug_example                          0x10e45ae38 timer_cb + 76
2   CoreFoundation                         0x1a9480338 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
3   CoreFoundation                         0x1a947ffe0 __CFRunLoopDoTimer + 940
4   CoreFoundation                         0x1a947fb38 __CFRunLoopDoTimers + 356
5   CoreFoundation                         0x1a94652b8 __CFRunLoopRun + 1852
6   CoreFoundation                         0x1a9464428 CFRunLoopRunSpecific + 612
7   HIToolbox                              0x1b2cbadf0 RunCurrentEventLoopInMode + 292
8   HIToolbox                              0x1b2cbac2c ReceiveNextEventCommon + 648
9   HIToolbox                              0x1b2cba984 _BlockUntilNextEventMatchingListInModeWithFilter + 76
10  AppKit                                 0x1ac68c134 _DPSNextEvent + 636
11  AppKit                                 0x1ac68b2d0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
12  AppKit                                 0x1ac67f734 -[NSApplication run] + 464
13  AudioPluginHost                        0x100907be4 juce::MessageManager::runDispatchLoop() + 76
14  AudioPluginHost                        0x100907b0c juce::JUCEApplicationBase::main() + 216
15  AudioPluginHost                        0x1009079dc juce::JUCEApplicationBase::main(int, char const**) + 68
16  AudioPluginHost                        0x100165c50 main + 56
17  dyld                                   0x1a902ff28 start + 2236
Tremus commented 3 days ago

Thanks a lot for the stack trace, I'll investigate the problem further. Hopefully this is just a bug within my shoddy objc code

Tremus commented 14 hours ago

I've recreated the problem and this seems to have fixed it 003d857de20972bfd3e0b002e37698f34aee9591