SIGABRT on WebKit macOS 15.3.2

The application I'm currently working on uses WebKit. Based on the crash analytics, we have noticed that some of our users are experiencing an unusual behavior in the app's WebKit view with macOS 15.3.2. These errors are reported for this version of the OS. The error in the crash log is a SIGABRT error, but there is no relevant information available to address it. In some crash logs, we found this error: "NSInternalInconsistencyException: Returned WKWebView was not created with the given configuration" but there is not any particular way to address it. Is there a way to identify the cause of this error? Alternatively, has anyone encountered this issue and found a solution?

OS Version: macOS 15.3.2 (24D81)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Crashed Thread: 0
Application Specific Information:
Returned WKWebView was not created with the given configuration.
Thread 0 Crashed:
0 CoreFoundation 0x303111e74 __exceptionPreprocess
1 libobjc.A.dylib 0x3027b6cd4 objc_exception_throw
2 CoreFoundation 0x303111d6c +[NSException raise:format:]
3 WebKit 0x34e85cb20 WebKit::UIDelegate::UIClient::createNewPage
4 WebKit 0x34e8a4a80 WebKit::SOAuthorizationCoordinator::tryAuthorize
5 WebKit 0x34e9f04f8 WebKit::WebPageProxy::createNewPage
6 WebKit 0x34ef994c8 WebKit::WebPageProxy::didReceiveSyncMessage
7 WebKit 0x34f0830cc IPC::MessageReceiverMap::dispatchSyncMessage
8 WebKit 0x34ea753b0 WebKit::WebProcessProxy::didReceiveSyncMessage
9 WebKit 0x34f07cfb4 IPC::Connection::dispatchSyncMessage
10 WebKit 0x34f07d3b0 IPC::Connection::dispatchMessage
11 WebKit 0x34f078c50 IPC::Connection::SyncMessageState::ConnectionAndIncomingMessage::dispatch
12 WebKit 0x34f07f4f4 ***::Detail::CallableWrapper<T>::call
13 JavaScriptCore 0x33f3520c0 ***::RunLoop::performWork
14 JavaScriptCore 0x33f352fe8 ***::RunLoop::performWork
15 CoreFoundation 0x30309f8a0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
16 CoreFoundation 0x30309f834 __CFRunLoopDoSource0
17 CoreFoundation 0x30309f598 __CFRunLoopDoSources0
18 CoreFoundation 0x30309e134 __CFRunLoopRun
19 CoreFoundation 0x30309d730 CFRunLoopRunSpecific
20 HIToolbox 0x319aeb52c RunCurrentEventLoopInMode
21 HIToolbox 0x319af1344 ReceiveNextEventCommon
22 HIToolbox 0x319af1504 _BlockUntilNextEventMatchingListInModeWithFilter
23 AppKit 0x30a7cd844 _DPSNextEvent
24 AppKit 0x30b133c20 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
25 AppKit 0x30a7c0870 -[NSApplication run]
26 AppKit 0x30a797064 NSApplicationMain
27 <unknown> 0x182780274 <redacted>
Thread 0 name: t-main-ui Crashed:
0 CoreFoundation 0x303111e74 __exceptionPreprocess
1 libobjc.A.dylib 0x3027b6cd4 objc_exception_throw
2 CoreFoundation 0x303111d6c +[NSException raise:format:]
3 WebKit 0x34e85cb20 WebKit::UIDelegate::UIClient::createNewPage
4 WebKit 0x34e8a4a80 WebKit::SOAuthorizationCoordinator::tryAuthorize
5 WebKit 0x34e9f04f8 WebKit::WebPageProxy::createNewPage
6 WebKit 0x34ef994c8 WebKit::WebPageProxy::didReceiveSyncMessage
7 WebKit 0x34f0830cc IPC::MessageReceiverMap::dispatchSyncMessage
8 WebKit 0x34ea753b0 WebKit::WebProcessProxy::didReceiveSyncMessage
9 WebKit 0x34f07cfb4 IPC::Connection::dispatchSyncMessage
10 WebKit 0x34f07d3b0 IPC::Connection::dispatchMessage
11 WebKit 0x34f078c50 IPC::Connection::SyncMessageState::ConnectionAndIncomingMessage::dispatch
12 WebKit 0x34f07f4f4 ***::Detail::CallableWrapper<T>::call
Answered by DTS Engineer in 834603022

You can see the code that throws this error in the WebKit open source. Actually, it can come from a few places. The first one is here, and the remaining ones are shortly after that.

Here’s roughly what it means:

  1. The web view has called your webView(_:createWebViewWith:for:windowFeatures:) delegate method, passing it a configuration (WKWebViewConfiguration) to use.

  2. That’s return a new web view instance (WKWebView).

  3. That instance wasn’t created from the configuration supplied in step 1.

The docs for that delegate method say:

The web view returned must be created with the specified configuration.

and WebKit throws this exception if you don’t meet that requirement.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

You can see the code that throws this error in the WebKit open source. Actually, it can come from a few places. The first one is here, and the remaining ones are shortly after that.

Here’s roughly what it means:

  1. The web view has called your webView(_:createWebViewWith:for:windowFeatures:) delegate method, passing it a configuration (WKWebViewConfiguration) to use.

  2. That’s return a new web view instance (WKWebView).

  3. That instance wasn’t created from the configuration supplied in step 1.

The docs for that delegate method say:

The web view returned must be created with the specified configuration.

and WebKit throws this exception if you don’t meet that requirement.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hey, Eskimo!

Thank you for the reply.

There were also some crashes where the backtrace was the same as this one, but in the info, they addressed the abort(). I'm not sure if that also occurs due to configuration or not.

Moreover, as per your comment. I can check that where we should pass the configuration while opening the new window that has the same configuration as its parent webview has.

My question is, can we alter the configuration of the new webview on webView(_:createWebViewWith:for:windowFeatures:) delegate call?

override func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
let popupWebView = WKWebView(frame: self.view.bounds, configuration: configuration)
popupWebView.customUserAgent = webView.customUserAgent
popupWebView.navigationDelegate = self
popupWebView.uiDelegate = self
popupWebView.frame = self.bounds
popupWebView.autoresizingMask = [.width, .height]
if let subView = popupWebView {
self.view.addSubview(subView)
}
self.view.autoresizesSubviews = false
popupWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = true
popupWebView.configuration.preferences.javaScriptEnabled = true
popupWebView.configuration.preferences.plugInsEnabled = true
popupWebView.load(navigationAction.request)
return popupWebView
}
Written by uchauhan in 834630022
can we alter the configuration … ?

Hmmm, there’s three levels to that:

  • Can you actually do it? — Sure. WKWebViewConfiguration has a bunch of read/write properties and you can change them before create your web view.

  • Will it trap? — I don’t think so, but you’re in a better position to answer that than me. Just suck it and see.

  • Is it a valid use of the API? — I don’t have an answer to that. It’s a WebKit policy question and WebKit isn’t really my specialty.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

SIGABRT on WebKit macOS 15.3.2
 
 
Q