|
![]() |
|
Thread Tools | Display Modes |
![]() |
#1 |
Human being with feelings
Join Date: Jan 2021
Posts: 10
|
![]()
I'm not sure whether this is a bug on JUCE's side, or in REAPER, but at the moment I'm leaning towards it being REAPER's problem.
To reproduce the issue, on macOS, load a JUCE LV2 plug-in on a new channel. Then, with the plug-in's editor open, right-click on the insert and select "Delete FX". REAPER will then crash. On debugging this, it looks like the crash happens when cleaning up the autorelease pool after handling the mouse click event that causes the FX to be deleted. The stack trace usually goes through a few `NSView` members just before the crash, so I assume that the problem involves the FX editor. When I stick a breakpoint on `dlclose`, I notice that the DLL is unloaded before the autorelease pool is cleaned up. My theory at the moment is that the autorelease pool tries to call a `release` or `dealloc` implementation from the shared library, which fails because the library is no longer loaded. Again, I'm not sure whether this is something that can be solved on JUCE's side, but I suspect not. At the moment, I can see that `autorelease` is being called on the JUCE NSView inside a stack trace like the following: Code:
[AppKit] -[NSView _setSuperview:] 0x00007ff8164ba38a [AppKit] -[NSView removeFromSuperview] 0x00007ff8164dec68 [REAPER] lv2_plugin::QuitConfig() 0x0000000104731cf5 [REAPER] FxDsp::~FxDsp() 0x00000001044c3e08 [REAPER] FxChain::removeDspFromChain(int, bool) 0x00000001044e4b94 [REAPER] MediaTrack::DoMixerFxMenu(HWND__*, POINT, int, int) 0x0000000104392ac6 [REAPER] DoFXParmClick(HWND__*, long, MediaTrack*, bool, bool, WDL_VWnd*) 0x00000001046dd591 [REAPER] MediaTrack::OnTrackPanelRightClick(HWND__*, int, int, int) 0x00000001043913f5 [REAPER] MCPDisplayProc(HWND__*, unsigned int, unsigned long, long) 0x00000001046ec6cf [REAPER] DefWindowProc(HWND__*, unsigned int, unsigned long, long) 0x000000010465cbd3 [REAPER] MCPDisplayProc(HWND__*, unsigned int, unsigned long, long) 0x00000001046ec949 [REAPER] SWELL_SendMouseMessage(REAPERSwell_hwnd*, int, NSEvent*) 0x0000000104631f2c [AppKit] -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] 0x00007ff8165ff654 [AppKit] -[NSWindow(NSEventRouting) sendEvent:] 0x00007ff8165fea6f [AppKit] -[NSApplication(NSEvent) sendEvent:] 0x00007ff8165fcdde [REAPER] -[REAPERapp sendEvent:] 0x0000000104476f9b [AppKit] -[NSApplication _handleEvent:] 0x00007ff8168bb885 [AppKit] -[NSApplication run] 0x00007ff81648c41c [AppKit] NSApplicationMain 0x00007ff816460427 [dyld] start 0x00007ff812f42310 It would be great if someone could try this out and confirm the problem. Please let me know if you need any further details, or need a plugin for testing. |
![]() |
![]() |
![]() |
#2 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,202
|
![]()
Ah, yeah it looks like we should create an autorelease pool when destroying the UI (we do this for VST/AU but not for lv2)... Of course, technically bundles on macOS can _never_ safely be unloaded, so maybe the issue is that we unload them at all.
Let me see if I can duplicate... |
![]() |
![]() |
![]() |
#3 |
Human being with feelings
Join Date: Jan 2014
Posts: 5,336
|
![]()
May be related, the DecentSampler plugin (made with JUCE) will crash Reaper if you delete it while it is loading a preset.
|
![]() |
![]() |
![]() |
#4 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,202
|
![]()
(spends some time trying to build a lv2 with JUCE)
... ok let me try a fix for the next +dev and let someone else test tomorrow's +dev build will have two fixes, either of which should fix probably Last edited by Justin; 01-04-2023 at 02:57 PM. |
![]() |
![]() |
![]() |
#5 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,202
|
![]()
Hello again!
Can you try the latest +dev build (see the pre-release forum) and see if this fixes your issue? Thanks! |
![]() |
![]() |
![]() |
#6 |
Human being with feelings
Join Date: Jan 2014
Posts: 5,336
|
![]()
This is not my thread, but just letting you know that didn't fix my case with DS. Here is a pastern (from a previous version of Reaper, mind you, but same crash).
https://pastebin.com/83Yawf49 |
![]() |
![]() |
![]() |
#7 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,202
|
![]()
We only updated the lv2 code, which would not affect AUs
|
![]() |
![]() |
![]() |
#8 |
Human being with feelings
Join Date: Jan 2021
Posts: 10
|
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|