Blank/White Screen after plugin was closed and opened again

For several months now I have been living with a big problem that is preventing me from developing the plugin normally ((. I have to keep the plugin open all the time, otherwise the GUI dies when I close it. I reinstalled macOS, but still see the same blank white screen.

I’m not sure what to do. This has been happening version after version; doesn’t anyone notice that AU/AUv3 is broken? Unfortunately, I haven’t tested the VST, but I think it will likely be similar.

To reproduce it, simply open a window with your plugin (no matter fx or instrument), close it, and then try to open it again. The result is a white screen and errors in the console. And yes, this is in a newly created empty Juce project and for any other demo projects as well.



JUCE v7.0.9
Bootstrapping; external subsystem UIKit_PKSubsystem refused setup
Unable to open mach-O at path: default.metallib  Error:2
fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
FAULT: assertion failed: '<NSViewServiceMarshal: 0x144826000 <AUAudioUnitViewService: 0x145896e20 <NSWindow: 0x145864430>>> unable to create semaphore (orderedDrawerAndWindowKeyLoopGroupingViews:)' in -[NSViewServiceMarshal orderedDrawerAndWindowKeyLoopGroupingViews:] on line 2525 of file /AppleInternal/Library/BuildRoots/11aa8fb2-5f4b-11ee-bc7f-926038f30c31/Library/Caches/com.apple.xbs/Sources/ViewBridge/NSViewServiceMarshal.m
FAULT: deferNSXPCInvocationOntoMainThread_block_invoke caught NSInternalInconsistencyException 'assertion failed: '<NSViewServiceMarshal: 0x144826000 <AUAudioUnitViewService: 0x145896e20 <NSWindow: 0x145864430>>> unable to create semaphore (orderedDrawerAndWindowKeyLoopGroupingViews:)' in -[NSViewServiceMarshal orderedDrawerAndWindowKeyLoopGroupingViews:] on line 2525 of file /AppleInternal/Library/BuildRoots/11aa8fb2-5f4b-11ee-bc7f-926038f30c31/Library/Caches/com.apple.xbs/Sources/ViewBridge/NSViewServiceMarshal.m' with backtrace (
    "0   CoreFoundation                      __exceptionPreprocess + 176",
    "1   libobjc.A.dylib                     objc_exception_throw + 60",
    "2   CoreFoundation                      _CFBundleGetValueForInfoKey + 0",
    "3   ViewBridge                          -[NSViewServiceMarshal orderedDrawerAndWindowKeyLoopGroupingViews:] + 476",
    "4   AppKit                              -[NSWindow _findKeyLoopGroupingViewFollowingKeyLoopGroupingView:direction:] + 116",
    "5   AppKit                              _replacementKeyViewAlongKeyViewPath + 484",
    "6   AppKit                              -[NSView nextValidKeyView] + 208",
    "7   AppKit                              -[NSView _setHidden:setNeedsDisplay:] + 264",
    "8   CoreAudioKit                        -[AUAudioUnitViewService viewDidDisappear] + 88",
    "9   AppKit                              -[NSViewController _sendViewDidDisappear] + 32",
    "10  ViewBridge                          -[NSServiceViewController _didDisassociateFromHostWindow] + 120",
    "11  ViewBridge                          -[NSViewServiceMarshal didBecomeAssociatedWithHostWindow:withKeyness:isFirstResponder:inActiveApp:] + 472",
    "12  CoreFoundation                      __invoking___ + 148",
    "13  CoreFoundation                      -[NSInvocation invoke] + 428",
    "14  CoreFoundation                      -[NSInvocation invokeWithTarget:] + 64",
    "15  ViewBridge                          __68-[NSVB_ViewServiceImplicitAnimationDecodingProxy forwardInvocation:]_block_invoke_2 + 48",
    "16  ViewBridge                          -[NSViewServiceMarshal withHostWindowFrameAnimationInProgress:perform:] + 80",
    "17  ViewBridge                          __68-[NSVB_ViewServiceImplicitAnimationDecodingProxy forwardInvocation:]_block_invoke + 120",
    "18  AppKit                              +[NSAnimationContext runAnimationGroup:] + 56",
    "19  AppKit                              +[NSAnimationContext runAnimationGroup:completionHandler:] + 100",
    "20  ViewBridge                          runAnimationGroup + 192",
    "21  ViewBridge                          +[NSVB_AnimationFencingSupport _animateWithAttributes:animations:] + 140",
    "22  ViewBridge                          -[NSVB_ViewServiceImplicitAnimationDecodingProxy forwardInvocation:] + 156",
    "23  CoreFoundation                      ___forwarding___ + 968",
    "24  CoreFoundation                      _CF_forwarding_prep_0 + 96",
    "25  CoreFoundation                      __invoking___ + 148",
    "26  CoreFoundation                      -[NSInvocation invoke] + 428",
    "27  CoreFoundation                      -[NSInvocation invokeWithTarget:] + 64",
    "28  ViewBridge                          -[NSVB_QueueingProxy _dispatchSuspendedMessages] + 376",
    "29  ViewBridge                          -[NSViewServiceMarshal withResumingSuspendedMessagesInProgress:] + 48",
    "30  ViewBridge                          -[NSVB_QueueingProxy resume] + 268",
    "31  ViewBridge                          -[NSVB_ViewServiceFencingController fencingControlProxy:didEndFencingWithSendRight:] + 504",
    "32  ViewBridge                          -[NSVB_ViewServiceFencingControlProxy __endFencingMessagesForSendRight:] + 240",
    "33  CoreFoundation                      __invoking___ + 148",
    "34  CoreFoundation                      -[NSInvocation invoke] + 428",
    "35  CoreFoundation                      -[NSInvocation invokeWithTarget:] + 64",
    "36  CoreFoundation                      ___forwarding___ + 968",
    "37  CoreFoundation                      _CF_forwarding_prep_0 + 96",
    "38  CoreFoundation                      __invoking___ + 148",
    "39  CoreFoundation                      -[NSInvocation invoke] + 428",
    "40  ViewBridge                          __deferNSXPCInvocationOntoMainThread_block_invoke + 120",
    "41  ViewBridge                          __wrapBlockWithVoucher_block_invoke + 56",
    "42  ViewBridge                          deferredBlockOpportunity_block_invoke_2 + 360",
    "43  CoreFoundation                      __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28",
    "44  CoreFoundation                      __CFRunLoopDoBlocks + 356",
    "45  CoreFoundation                      __CFRunLoopRun + 2440",
    "46  CoreFoundation                      CFRunLoopRunSpecific + 608",
    "47  HIToolbox                           RunCurrentEventLoopInMode + 292",
    "48  HIToolbox                           ReceiveNextEventCommon + 648",
    "49  HIToolbox                           _BlockUntilNextEventMatchingListInModeWithFilter + 76",
    "50  AppKit                              _DPSNextEvent + 660",
    "51  AppKit                              -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716",
    "52  ViewBridge                          __77-[NSViewServiceApplication vbNextEventMatchingMask:untilDate:inMode:dequeue:]_block_invoke + 136",
    "53  ViewBridge                          -[NSViewServiceApplication _withToxicEventMonitorPerform:] + 152",
    "54  ViewBridge                          -[NSViewServiceApplication vbNextEventMatchingMask:untilDate:inMode:dequeue:] + 168",
    "55  ViewBridge                          -[NSViewServiceApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 100",
    "56  AppKit                              -[NSApplication run] + 476",
    "57  AppKit                              NSApplicationMain + 880",
    "58  libxpc.dylib                        _xpc_objc_main + 800",
    "59  libxpc.dylib                        _xpc_main + 324",
    "60  libxpc.dylib                        _xpc_copy_xpcservice_dictionary + 0",
    "61  Foundation                          +[NSXPCListener serviceListener] + 0",
    "62  PlugInKit                           pkIsServiceAccount + 34540",
    "63  PlugInKit                           pkIsServiceAccount + 33348",
    "64  PlugInKit                           pkIsServiceAccount + 35440",
    "65  ExtensionFoundation                 EXExtensionMain + 304",
    "66  Foundation                          NSExtensionMain + 204",
    "67  dyld                                start + 2360"
)

I wasn’t able to reproduce this with 7.0.9 master or develop with Logic or Ableton on Ventura 13.5 and XCode 15.1.

What versions (of everything) are you seeing this issue on? Does it happen with AUv2 as well as v3?

@oli1 Thanks for reply. I just tested AUv2 and it’s working fine. So the issue is only with AUv3

Also I tested VST3 (effect app) and it’s also worked.
VST3 instrument for some reason not working for me, not sure why and how to debug it, but that’s not a problem yet.
image

Are you using master or develop branch, does the issue still occur on either?

What mac do you have? is it Intel or M?

I tried both develop and master. In debug and release.

With JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS=1 and JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS=0

But same issue.

Apple M1, Sonoma 14.1.1 (23B81), [JUCE version 7.0.9]

I just checked AUv2. No issue.

i’m getting customer reports on this issue as well and i’ve been able to reproduce it myself.

it occurs while running as auv3.

i’m on a m1 (as are the people reporting this), and this happens in ableton (11 + 12 beta).

currently i’m running juce@90c15c4a7

when this happens the editor disappears but the processor still happily runs in the background. closing and reopening the editor window does not bring it back.

today i’ve been unable to reproduce this on logic 10.8.1 or reaper 6.8.2.

i can still make this happen ~100% of the time in ableton by rapidly opening / closing the editor window. i have not tried live 12 yet but i plan to later this week.

also i see a slightly different error than @vtarasuk reported (the assertion is in the same line of code though):

FAULT: assertion failed: '<private>' in -[NSViewServiceMarshal orderedDrawerAndWindowKeyLoopGroupingViews:] on line 2,539 of file /AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/ViewBridge/NSViewServiceMarshal.m

Yes it’s only issue under auV3. With latest Juce ver. issue still there. Not sure if that’s something that can be fixed in Juce framework or it’s Apple problem, but auV3 is completely now inoperative.

So far I have to remove the plugin from the host and then add it again in order to at least somehow test the application.

juce folks - here’s a video of this crash happening with the AUv3SynthPlugin demo project. this is definitely juce-related - i cannot crash other auv3 plugins in ableton 11 by rapidly opening/closing the editor.

it appears this is specific to macos 14 - i just tried on macos 13 and could not reproduce it.

i also tried reverting back to the last version of my plugin using juce 6 (juce@157309045) and it still happens.

so the combination of juce auv3 + macos 14 + ableton 11 leads to this crash.

i filed a ticket with ableton but with their recent launch they say it’ll take 3-4 weeks to get any response. do the juce devs have a better way to get in touch?

(i’m also going to open a gh issue since this issue hasn’t gotten any response here).

1 Like

Thanks for reporting and investigating. I can also reproduce the issue with macOS 14 Arm + Live 11.

Unfortunately I haven’t been able to determine the root cause of the problem. Something goes wrong when the system is trying to locate a new “key view”, but I’m not sure exactly what or why.

After trying a few things, it looks like the following patch works around the issue, at least in the plugin I was using for testing.

Please could you try applying this patch and testing with your project? If it works for you, then maybe this is viable as a workaround until we hear more from Ableton. Thanks in advance!

auv3-blank.patch (7.4 KB)

1 Like

thanks @reuk - unfortunately this patch doesn’t seem to help, i get the same error.

That’s annoying, it seems to work consistently for me when testing with the AudioPluginDemo AUv3.

Did you test with a JUCE demo, or with your own plugin?

If you already had a previous version of the test plugin installed, are you certain that the version you tested had the patch applied (i.e. not an old version of the plugin cached by the system)? An easy way to check this is to change something obvious about the plugin, like the background colour of the editor. You can also try removing all existing copies of the plugin from your system (you can use auval -al to find the paths to AUv3 plugins), verifying that they don’t show up in Live, and then doing a fresh build of the plugin + standalone before testing again.

It would also be helpful to know the exact version of macOS 14 you’re using for testing. The proposed fix works for me on macOS 14.4. If you’re using an older version, that might contribute to the different behaviour you’re seeing.

I am having the same issue with the same combination, JUCE + AUv3 + Sonoma (works good with Ventura).

The patch helped on my side!

Patched help here too. Sonoma 14.4.

ok - the patch does fix AUv3SynthPlugin for me.

it does not fix the issue for my plugin though, and here’s where it gets weird.

  • if i do a release build (aka archive from xcode) then yes, this patch fixes it.
  • if i do a debug build, then the patch does not fix it.

(i’ve ensured that this is the only instance of my plugin present in the system on each step - i’ve removed everything from the build folders/etc, i re-ran auvaltool, and i ran a shell script which wipes out all the au caches + kills AudioComponentRegistrar)

i’m going to do some more digging on my end.

i’m on macos 14.4 (23E214) + Apple M1 Max

I wonder whether the issue might be timing-related in that case. Does your plugin have a particularly expensive UI? Does it include an OpenGL view or other heavyweight view?

nothing super heavy, but i do have some WebComponents?

This is turning into a bit of a time-sink, so I’m going to have to park this to concentrate on the upcoming JUCE 8 release for a bit.

For a quick test, I tried adding a WebBrowserComponent as a child of the PluginEditor in the AudioPluginExample plugin. I enabled App Sandbox (including the Outgoing Connections (Client) capability) and Hardened Runtime, in order to allow the browser to display pages from the internet.

With this modified version of the plugin, I found that closing and reopening the editor caused the browser to be blank when the editor was reopened. This might look the same as the original issue if the web browser occupies the entire area of the editor. Does the browser take up the entire editor window in your plugin?

The attached patch should resolve this new issue, allowing web browsers to resume correctly when the editor is reopened.

auv3-blank-v2.patch (7.1 KB)

Please try out this patch and let us know how it compares to the previous version.