JUCE
JUCE copied to clipboard
[Bug]: AU Pressing escape key with a webview causes crash
trafficstars
Detailed steps on how to reproduce the bug
Create an AU plugin project with projucer Put a webview in it, load any website Launch the AU in Ableton Live 12 Press escape key
Crash
I can repro with this project: https://github.com/colinsullivan/juce-webview-simple
Attached are some screenshots of the stack traces I am seeing when I attach a debugger to Ableton. Something in that key handling code path, specifically for macOS / AU and webview. If the webview is not added to the app, the crash does not occur.
What is the expected behaviour?
AU doesn't crash the DAW when user presses a key
Operating systems
macOS
What versions of the operating systems?
Ventura 13.6.3 Sonoma 14.4.1 Sequioa 15.1.1
Architectures
Arm64/aarch64
Stacktrace
MainThread (1) Queue : com.apple.main-thread (serial)
#0 0x00000001a805df94 in objc_exception_throw ()
#1 0x00000001a86299b4 in _CFThrowFormattedException ()
#2 0x00000001a8467f80 in -[__NSArrayM objectAtIndex:] ()
#3 0x00000001ab95eb34 in -[NSView performKeyEquivalent:] ()
#4 0x00000001abec8fec in -[NSWindow _commonPerformKeyEquivalent:conditionally:] ()
#5 0x00000001abf39454 in -[NSWindow(NSEventRouting) _cancelKey:] ()
#6 0x00000001ab8e4e00 in -[NSResponder tryToPerform:with:] ()
#7 0x00000001abecb524 in -[NSWindow tryToPerform:with:] ()
#8 0x00000001030d2970 in ___lldb_unnamed_symbol249322 ()
#9 0x00000002f5175874 in void juce::ObjCMsgSendSuper<NSView, void, objc_selector*>(objc_object*, objc_selector*, objc_selector*) at /Applications/JUCE/modules/juce_core/native/juce_ObjCHelpers_mac.h:186
#10 0x00000002f5175688 in void juce::ObjCClass<NSView>::sendSuperclassMessage<void, objc_selector*>(objc_object*, objc_selector*, objc_selector*) at /Applications/JUCE/modules/juce_core/native/juce_ObjCHelpers_mac.h:359
#11 0x00000002f5175564 in juce::JuceNSViewClass::JuceNSViewClass()::'lambda'(objc_object*, objc_selector*, objc_selector*)::operator()(objc_object*, objc_selector*, objc_selector*) const at /Applications/JUCE/modules/juce_gui_basics/native/juce_NSViewComponentPeer_mac.mm:2436
#12 0x00000002f51755b8 in juce::JuceNSViewClass::JuceNSViewClass()::'lambda'(objc_object*, objc_selector*, objc_selector*)::__invoke(objc_object*, objc_selector*, objc_selector*) at /Applications/JUCE/modules/juce_gui_basics/native/juce_NSViewComponentPeer_mac.mm:2406
#13 0x00000001c94ce35c in -[WKWebView(WKInternalMac) _web_superDoCommandBySelector:] ()
#14 0x00000001c95b3148 in WebKit::WebViewImpl::executeSavedCommandBySelector(objc_selector*) ()
#15 0x00000001c95a7918 in WebKit::WebPageProxy::executeSavedCommandBySelector(WTF::String const&, WTF::CompletionHandler<void (bool)>&&) ()
#16 0x00000001c99d8828 in bool IPC::handleMessageSynchronous<Messages::WebPageProxy::ExecuteSavedCommandBySelector, WebKit::WebPageProxy, WebKit::WebPageProxy, void (WTF::String const&, WTF::CompletionHandler<void (bool)>&&)>(IPC::Connection&, IPC::Decoder&, WTF::UniqueRef<IPC::Encoder>&, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(WTF::String const&, WTF::CompletionHandler<void (bool)>&&)) ()
#17 0x00000001c99d607c in WebKit::WebPageProxy::didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, WTF::UniqueRef<IPC::Encoder>&) ()
#18 0x00000001c9a87398 in IPC::MessageReceiverMap::dispatchSyncMessage(IPC::Connection&, IPC::Decoder&, WTF::UniqueRef<IPC::Encoder>&) ()
#19 0x00000001c96d00b4 in WebKit::WebProcessProxy::didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, WTF::UniqueRef<IPC::Encoder>&) ()
#20 0x00000001c9a82af4 in IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder>>) ()
#21 0x00000001c9a7edf4 in IPC::Connection::SyncMessageState::ConnectionAndIncomingMessage::dispatch() ()
#22 0x00000001c9a846c4 in WTF::Detail::CallableWrapper<IPC::Connection::SyncMessageState::processIncomingMessage(IPC::Connection&, std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder>>&)::$_5, void>::call() ()
#23 0x00000001c28e50c4 in WTF::RunLoop::performWork() ()
#24 0x00000001c28e5f90 in WTF::RunLoop::performWork(void*) ()
#25 0x00000001a84c65ac in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#26 0x00000001a84c6540 in __CFRunLoopDoSource0 ()
#27 0x00000001a84c62b0 in __CFRunLoopDoSources0 ()
#28 0x00000001a84c4eb8 in __CFRunLoopRun ()
#29 0x00000001a84c4428 in CFRunLoopRunSpecific ()
#30 0x00000001b1d18df0 in RunCurrentEventLoopInMode ()
#31 0x00000001b1d18c2c in ReceiveNextEventCommon ()
#32 0x00000001b1d18984 in _BlockUntilNextEventMatchingListInModeWithFilter ()
#33 0x00000001ab6ec908 in _DPSNextEvent ()
#34 0x00000001ab6ebaa4 in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] ()
#35 0x00000001ab6dff08 in -[NSApplication run] ()
#36 0x00000001019828c0 in ___lldb_unnamed_symbol127871 ()
#37 0x00000001a808ff28 in start ()
Plug-in formats (if applicable)
AU
Plug-in host applications (DAWs) (if applicable)
Ableton Live 12
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