JUCE
JUCE copied to clipboard
[Bug]: Right clicking in WebView causes crash
Detailed steps on how to reproduce the bug
Right clicking on an embedded juce::WebBrowserComponent inside Logic repeatedly is causing the plugin to crash with Logic presenting the "An Audio Unit plug-in reported a problem...." error. The first time right clicking the view causing the popup menu to appear has in my testing not caused any crashes, however seemingly unpredictably right clicking multiple times is causing the crash (right clicking elements that create larger context menus e.g. an image seem to more reliably crash). I am unable to replicate the same behaviour in Reaper.
I initially started seeing this issue setting up a plugin templated based around the Choc WebView. Seemingly when pulling my JUCE version back to 7.0.5 (same version used in the SRVB project) from 7.0.11 the issue is gone. Everything is okay up to the commit WebBrowserComponent: MacOS: Add accessibility integration / d8c282e29396473dbb54468532ab2036b1ce49ef . I noticed NSAccessibility quite a bit in the backtrace as well so am wondering if they are related.
I was able to re-create the error using this minimal example, I am happy to create a repo with a full project causing this issue if that would be helpful,
JuceWebViewEditor::JuceWebViewEditor (juce::AudioProcessor * proc)
: juce::AudioProcessorEditor (proc)
{
setSize (400, 400);
addAndMakeVisible (web_browser_component_);
web_browser_component_.goToURL ("https://google.com");
}
void JuceWebViewEditor::resized ()
{
web_browser_component_.setBounds (getLocalBounds ());
}
What is the expected behaviour?
Right clicking within a WebView multiple times should not cause a crash.
Operating systems
macOS
What versions of the operating systems?
M3 MacBook Pro running 14.1 (23B2073)
Architectures
ARM
Stacktrace
Process: AUHostingServiceXPC_arrow [10725]
Path: /System/Library/Frameworks/AudioToolbox.framework/XPCServices/AUHostingServiceXPC_arrow.xpc/Contents/MacOS/AUHostingServiceXPC_arrow
Identifier: com.apple.audio.AUHostingService.arm64e
Version: 1.0 (1)
Build Info: CoreAudioServices_AUHostingServiceXPC_arrow-1387002013000000~8
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Responsible: Logic Pro X [10719]
User ID: 501
Date/Time: 2024-04-05 21:26:16.8931 +0100
OS Version: macOS 14.1 (23B2073)
Report Version: 12
Anonymous UUID: F7B64612-7321-F228-3612-F2C9450B4212
Sleep/Wake UUID: 548D8A92-D58D-4615-9506-EE6E8B7D0D0D
Time Awake Since Boot: 6100 seconds
Time Since Wake: 205 seconds
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000183fd2388
Termination Reason: Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process: exc handler [10725]
Application Specific Backtrace 0:
0 CoreFoundation 0x0000000180592800 __exceptionPreprocess + 176
1 libobjc.A.dylib 0x0000000180089eb4 objc_exception_throw + 60
2 CoreFoundation 0x00000001806443bc -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x00000001804fca84 ___forwarding___ + 1572
4 CoreFoundation 0x00000001804fc3a0 _CF_forwarding_prep_0 + 96
5 webviewjuce 0x00000001117874c0 _ZN4juce20AccessibilityHandler23AccessibilityNativeImpl20AccessibilityElement22getAccessibilityWindowEP11objc_objectP13objc_selector + 40
6 webviewjuce 0x00000001117874c0 _ZN4juce20AccessibilityHandler23AccessibilityNativeImpl20AccessibilityElement22getAccessibilityWindowEP11objc_objectP13objc_selector + 40
7 AppKit 0x0000000183d74360 -[NSAccessibilityAttributeAccessorInfo getAttributeValue:forObject:] + 60
8 AppKit 0x000000018435fac0 ___NSAccessibilityEntryPointValueForAttribute_block_invoke.758 + 1504
9 AppKit 0x000000018435b590 NSAccessibilityPerformEntryPointObject + 44
10 AppKit 0x0000000183f48890 _NSAccessibilityEntryPointValueForAttribute + 224
11 AppKit 0x0000000183e7a3e4 _NSAccessibilityWindowAttributeValue + 36
12 ViewBridge 0x0000000188b41268 -[NSView(ViewBridgeSwizzle) swizzledAccessibilityAttributeValue:] + 384
13 WebKit 0x00000001a32b9724 -[WKWebView(WKInternalMac) _web_superAccessibilityAttributeValue:] + 44
14 AppKit 0x0000000183d756dc NSAccessibilityGetObjectForAttributeUsingLegacyAPI + 280
15 AppKit 0x0000000183d74da4 NSAccessibilityGetObjectValueForAttribute + 1568
16 AppKit 0x0000000183d74360 -[NSAccessibilityAttributeAccessorInfo getAttributeValue:forObject:] + 60
17 AppKit 0x000000018435fac0 ___NSAccessibilityEntryPointValueForAttribute_block_invoke.758 + 1504
18 AppKit 0x000000018435b590 NSAccessibilityPerformEntryPointObject + 44
19 AppKit 0x0000000183f48890 _NSAccessibilityEntryPointValueForAttribute + 224
20 AppKit 0x0000000184785ab8 -[NSView(NSViewAccessibility) accessibilityPopUpMenuCreated:returningAccessibilityParent:] + 172
21 AppKit 0x00000001842d238c +[NSContextMenuImpl presentPopup:fromView:withContext:animated:] + 308
22 AppKit 0x00000001844f7f94 _NSPopUpMenu + 1988
23 AppKit 0x00000001844fc54c -[NSCocoaMenuImpl _popUpContextMenu:withEvent:forView:withFont:] + 304
24 AppKit 0x000000018401b964 -[NSMenu _popUpContextMenu:withEvent:forView:withFont:] + 188
25 WebKit 0x00000001a33c6ab0 _ZN6WebKit22WebContextMenuProxyMac24showContextMenuWithItemsEON3WTF6VectorINS1_3RefINS_18WebContextMenuItemENS1_12RawPtrTraitsIS4_EEEELm0ENS1_15CrashOnOverflowELm16ENS1_10FastMallocEEE + 544
26 WebKit 0x00000001a34910ec _ZN6WebKit19WebContextMenuProxy19useContextMenuItemsEON3WTF6VectorINS1_3RefINS_18WebContextMenuItemENS1_12RawPtrTraitsIS4_EEEELm0ENS1_15CrashOnOverflowELm16ENS1_10FastMallocEEE + 148
27 WebKit 0x00000001a33cb5ac _ZN3WTF6Detail15CallableWrapperIZZN6WebKit22WebContextMenuProxyMac19useContextMenuItemsEONS_6VectorINS_3RefINS2_18WebContextMenuItemENS_12RawPtrTraitsIS6_EEEELm0ENS_15CrashOnOverflowELm16ENS_10FastMallocEEEEN4$_21clEP6NSMenuEUlONS_9RetainPtrISF_EEE_vJSJ_EE4callESJ_ + 124
28 WebKit 0x00000001a3319e98 _ZN3WTF17CompletionHandlerIFvONS_9RetainPtrI6NSMenuEEEEclES4_ + 64
29 WebKit 0x00000001a3319ba0 _ZN6WebKit10UIDelegate17ContextMenuClient20menuFromProposedMenuERNS_12WebPageProxyEP6NSMenuRKNS_22ContextMenuContextDataEPN3API6ObjectEON3WTF17CompletionHandlerIFvONSC_9RetainPtrIS4_EEEEE + 340
30 WebKit 0x00000001a33cb318 _ZN3WTF6Detail15CallableWrapperIZN6WebKit22WebContextMenuProxyMac19useContextMenuItemsEONS_6VectorINS_3RefINS2_18WebContextMenuItemENS_12RawPtrTraitsIS6_EEEELm0ENS_15CrashOnOverflowELm16ENS_10FastMallocEEEE4$_21vJP6NSMenuEE4callESG_ + 432
31 WebKit 0x00000001a33c6574 _ZN3WTF17CompletionHandlerIFvP6NSMenuEEclES2_ + 64
32 WebKit 0x00000001a33c8c98 _ZZN3WTF8BlockPtrIFvP10NSMenuItemmEE12fromCallableIZN6WebKit22WebContextMenuProxyMac23getContextMenuFromItemsERKNS_6VectorINS6_22WebContextMenuItemDataELm0ENS_15CrashOnOverflowELm16ENS_10FastMallocEEEONS_17CompletionHandlerIFvP6NSMenuEEEE4$_11EES4_T_ENUlPvS2_mE_8__invokeESN_S2_m + 1072
33 WebKit 0x00000001a33c4f2c _ZN3WTF17CompletionHandlerIFvP10NSMenuItemEEclES2_ + 64
34 WebKit 0x00000001a33c5bf4 _ZN6WebKit22WebContextMenuProxyMac23getContextMenuFromItemsERKN3WTF6VectorINS_22WebContextMenuItemDataELm0ENS1_15CrashOnOverflowELm16ENS1_10FastMallocEEEONS1_17CompletionHandlerIFvP6NSMenuEEE + 2164
35 WebKit 0x00000001a33c7988 _ZN6WebKit22WebContextMenuProxyMac19useContextMenuItemsEON3WTF6VectorINS1_3RefINS_18WebContextMenuItemENS1_12RawPtrTraitsIS4_EEEELm0ENS1_15CrashOnOverflowELm16ENS1_10FastMallocEEE + 564
36 WebKit 0x00000001a3491018 _ZN6WebKit19WebContextMenuProxy4showEv + 276
37 WebKit 0x00000001a34c1d34 _ZN6WebKit12WebPageProxy15showContextMenuEONS_22ContextMenuContextDataERKNS_8UserDataE + 848
38 WebKit 0x00000001a383b06c _ZN6WebKit12WebPageProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE + 15072
39 WebKit 0x00000001a38ffdb4 _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_7DecoderE + 264
40 WebKit 0x00000001a350b794 _ZN6WebKit15WebProcessProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE + 40
41 WebKit 0x00000001a38fb3f4 _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_7DecoderENS1_14default_deleteIS3_EEEE + 332
42 WebKit 0x00000001a38fb8dc _ZN3IPC10Connection24dispatchIncomingMessagesEv + 292
43 JavaScriptCore 0x000000019c251d38 _ZN3WTF7RunLoop11performWorkEv + 204
44 JavaScriptCore 0x000000019c252c08 _ZN3WTF7RunLoop11performWorkEPv + 36
45 CoreFoundation 0x000000018051dcfc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
46 CoreFoundation 0x000000018051dc90 __CFRunLoopDoSource0 + 176
47 CoreFoundation 0x000000018051da00 __CFRunLoopDoSources0 + 244
48 CoreFoundation 0x000000018051c5f0 __CFRunLoopRun + 828
49 CoreFoundation 0x000000018051bc5c CFRunLoopRunSpecific + 608
50 HIToolbox 0x000000018aa97448 RunCurrentEventLoopInMode + 292
51 HIToolbox 0x000000018aa97284 ReceiveNextEventCommon + 648
52 HIToolbox 0x000000018aa96fdc _BlockUntilNextEventMatchingListInModeWithFilter + 76
53 AppKit 0x0000000183cf6be0 _DPSNextEvent + 660
54 AppKit 0x00000001844cce8c -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
55 ViewBridge 0x0000000188b3cb50 __77-[NSViewServiceApplication vbNextEventMatchingMask:untilDate:inMode:dequeue:]_block_invoke + 136
56 ViewBridge 0x0000000188b3c8b0 -[NSViewServiceApplication _withToxicEventMonitorPerform:] + 152
57 ViewBridge 0x0000000188b3cab0 -[NSViewServiceApplication vbNextEventMatchingMask:untilDate:inMode:dequeue:] + 168
58 ViewBridge 0x0000000188b28e74 -[NSViewServiceApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 100
59 AppKit 0x0000000183cea08c -[NSApplication run] + 476
60 AppKit 0x0000000183cc1358 NSApplicationMain + 880
61 libxpc.dylib 0x0000000180171cd4 _xpc_objc_main + 800
62 libxpc.dylib 0x0000000180180904 _xpc_main + 324
63 libxpc.dylib 0x000000018017180c _xpc_copy_xpcservice_dictionary + 0
64 ViewBridge 0x0000000188b23cc8 xpc_connection_handler + 0
65 ViewBridge 0x0000000188b3f180 NSViewServiceMain + 360
66 AUHostingServiceXPC_arrow 0x0000000102afe3b8 AUHostingServiceXPC_arrow + 25528
67 dyld 0x00000001800c50e0 start + 2360
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 AppKit 0x183fd2388 -[NSApplication _crashOnException:] + 240
1 AppKit 0x183fd2160 -[NSApplication reportException:] + 440
2 AppKit 0x18411c4e4 NSApplicationUncaughtExceptionHandler + 152
3 CoreFoundation 0x180636f64 __handleUncaughtException + 800
4 libobjc.A.dylib 0x180093888 _objc_terminate() + 132
5 libc++abi.dylib 0x1803f7a9c std::__terminate(void (*)()) + 16
6 libc++abi.dylib 0x1803fac58 __cxa_rethrow + 148
7 libobjc.A.dylib 0x1800ad5f0 objc_exception_rethrow + 44
8 AppKit 0x18435b5bc NSAccessibilityPerformEntryPointObject + 88
9 AppKit 0x183f48890 _NSAccessibilityEntryPointValueForAttribute + 224
10 AppKit 0x184785ab8 -[NSView(NSViewAccessibility) accessibilityPopUpMenuCreated:returningAccessibilityParent:] + 172
11 AppKit 0x1842d238c +[NSContextMenuImpl presentPopup:fromView:withContext:animated:] + 308
12 AppKit 0x1844f7f94 _NSPopUpMenu + 1988
13 AppKit 0x1844fc54c -[NSCocoaMenuImpl _popUpContextMenu:withEvent:forView:withFont:] + 304
14 AppKit 0x18401b964 -[NSMenu _popUpContextMenu:withEvent:forView:withFont:] + 188
15 WebKit 0x1a33c6ab0 WebKit::WebContextMenuProxyMac::showContextMenuWithItems(WTF::Vector<WTF::Ref<WebKit::WebContextMenuItem, WTF::RawPtrTraits<WebKit::WebContextMenuItem>>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&) + 544
16 WebKit 0x1a34910ec WebKit::WebContextMenuProxy::useContextMenuItems(WTF::Vector<WTF::Ref<WebKit::WebContextMenuItem, WTF::RawPtrTraits<WebKit::WebContextMenuItem>>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&) + 148
17 WebKit 0x1a33cb5ac WTF::Detail::CallableWrapper<WebKit::WebContextMenuProxyMac::useContextMenuItems(WTF::Vector<WTF::Ref<WebKit::WebContextMenuItem, WTF::RawPtrTraits<WebKit::WebContextMenuItem>>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)::$_21::operator()(NSMenu*)::'lambda'(WTF::RetainPtr<NSMenu>&&), void, WTF::RetainPtr<NSMenu>&&>::call(WTF::RetainPtr<NSMenu>&&) + 124
18 WebKit 0x1a3319e98 WTF::CompletionHandler<void (WTF::RetainPtr<NSMenu>&&)>::operator()(WTF::RetainPtr<NSMenu>&&) + 64
19 WebKit 0x1a3319ba0 WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu(WebKit::WebPageProxy&, NSMenu*, WebKit::ContextMenuContextData const&, API::Object*, WTF::CompletionHandler<void (WTF::RetainPtr<NSMenu>&&)>&&) + 340
20 WebKit 0x1a33cb318 WTF::Detail::CallableWrapper<WebKit::WebContextMenuProxyMac::useContextMenuItems(WTF::Vector<WTF::Ref<WebKit::WebContextMenuItem, WTF::RawPtrTraits<WebKit::WebContextMenuItem>>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)::$_21, void, NSMenu*>::call(NSMenu*) + 432
21 WebKit 0x1a33c6574 WTF::CompletionHandler<void (NSMenu*)>::operator()(NSMenu*) + 64
22 WebKit 0x1a33c8c98 WTF::BlockPtr<void (NSMenuItem*, unsigned long)> WTF::BlockPtr<void (NSMenuItem*, unsigned long)>::fromCallable<WebKit::WebContextMenuProxyMac::getContextMenuFromItems(WTF::Vector<WebKit::WebContextMenuItemData, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&, WTF::CompletionHandler<void (NSMenu*)>&&)::$_11>(WebKit::WebContextMenuProxyMac::getContextMenuFromItems(WTF::Vector<WebKit::WebContextMenuItemData, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&, WTF::CompletionHandler<void (NSMenu*)>&&)::$_11)::'lambda'(void*, NSMenuItem*, unsigned long)::__invoke(void*, NSMenuItem*, unsigned long) + 1072
23 WebKit 0x1a33c4f2c WTF::CompletionHandler<void (NSMenuItem*)>::operator()(NSMenuItem*) + 64
24 WebKit 0x1a33c5bf4 WebKit::WebContextMenuProxyMac::getContextMenuFromItems(WTF::Vector<WebKit::WebContextMenuItemData, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&, WTF::CompletionHandler<void (NSMenu*)>&&) + 2164
25 WebKit 0x1a33c7988 WebKit::WebContextMenuProxyMac::useContextMenuItems(WTF::Vector<WTF::Ref<WebKit::WebContextMenuItem, WTF::RawPtrTraits<WebKit::WebContextMenuItem>>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&) + 564
26 WebKit 0x1a3491018 WebKit::WebContextMenuProxy::show() + 276
27 WebKit 0x1a34c1d34 WebKit::WebPageProxy::showContextMenu(WebKit::ContextMenuContextData&&, WebKit::UserData const&) + 848
28 WebKit 0x1a383b06c WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 15072
29 WebKit 0x1a38ffdb4 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 264
30 WebKit 0x1a350b794 WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 40
31 WebKit 0x1a38fb3f4 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder>>) + 332
32 WebKit 0x1a38fb8dc IPC::Connection::dispatchIncomingMessages() + 292
33 JavaScriptCore 0x19c251d38 WTF::RunLoop::performWork() + 204
34 JavaScriptCore 0x19c252c08 WTF::RunLoop::performWork(void*) + 36
35 CoreFoundation 0x18051dcfc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
36 CoreFoundation 0x18051dc90 __CFRunLoopDoSource0 + 176
37 CoreFoundation 0x18051da00 __CFRunLoopDoSources0 + 244
38 CoreFoundation 0x18051c5f0 __CFRunLoopRun + 828
39 CoreFoundation 0x18051bc5c CFRunLoopRunSpecific + 608
40 HIToolbox 0x18aa97448 RunCurrentEventLoopInMode + 292
41 HIToolbox 0x18aa97284 ReceiveNextEventCommon + 648
42 HIToolbox 0x18aa96fdc _BlockUntilNextEventMatchingListInModeWithFilter + 76
43 AppKit 0x183cf6be0 _DPSNextEvent + 660
44 AppKit 0x1844cce8c -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
45 ViewBridge 0x188b3cb50 __77-[NSViewServiceApplication vbNextEventMatchingMask:untilDate:inMode:dequeue:]_block_invoke + 136
46 ViewBridge 0x188b3c8b0 -[NSViewServiceApplication _withToxicEventMonitorPerform:] + 152
47 ViewBridge 0x188b3cab0 -[NSViewServiceApplication vbNextEventMatchingMask:untilDate:inMode:dequeue:] + 168
48 ViewBridge 0x188b28e74 -[NSViewServiceApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 100
49 AppKit 0x183cea08c -[NSApplication run] + 476
50 AppKit 0x183cc1358 NSApplicationMain + 880
51 libxpc.dylib 0x180171cd4 _xpc_objc_main + 800
52 libxpc.dylib 0x180180904 _xpc_main + 324
53 libxpc.dylib 0x18017180c xpc_main + 64
54 ViewBridge 0x188b23cc8 -[NSXPCSharedListener resume] + 32
55 ViewBridge 0x188b3f180 NSViewServiceMain + 360
56 AUHostingServiceXPC_arrow 0x102afe3b8 0x102af8000 + 25528
57 dyld 0x1800c50e0 start + 2360
Plug-in formats (if applicable)
AU
Plug-in host applications (DAWs) (if applicable)
Logic 10.8.1
Testing on the develop branch
The bug is present on the develop branch
Code of Conduct
- [X] I agree to follow the Code of Conduct