Crash on [WKWebView initWithFrame: configuration:]

Crash condition: when I update the Xcode version to 15.3 and run the iPhone to load the app on debug mode with the following diagnosing setting:

Hardware Model:      iPhone 14 pro
Role:                Foreground

Date/Time:           2024-03-08 11:30 -0800
Launch Time:       2024-03-08 11:30 -0800
OS Version:          iPhone OS 17.4(21E219)

Exception Type:   EXC_BREAKPOINT
Exception Codes:  (code=1, subcode=0x19b1eba48)
Exception Note:   EXC_BREAKPOINT
Triggered by Thread:  1
Thread 1 Queue : com.apple.main-thread (serial)
#0	0x000000019b1eba48 in xzm_malloc_zone_free_slow.cold.1 ()
#1	0x000000019b1e28d0 in xzm_malloc_zone_free_slow ()
#2	0x00000001a25ef1c8 in pas_try_deallocate_slow_no_cache ()
#3	0x00000001a10d32f8 in ***::String::String(__CFString const*) ()
#4	0x00000001a0494ab8 in WebKit::isFullWebBrowserOrRunningTest() ()
#5	0x00000001a09e1520 in WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration(WebKit::IsPersistent, WebKit::WebsiteDataStoreConfiguration::ShouldInitializePaths) ()
#6	0x00000001a09d3ae0 in WebKit::WebsiteDataStore::defaultDataStore() ()
#7	0x00000001a05bc5e8 in +[WKWebsiteDataStore defaultDataStore] ()
#8	0x00000001a05b6624 in -[WKWebViewConfiguration websiteDataStore] ()
#9	0x00000001a0576850 in -[WKWebView _initializeWithConfiguration:] ()
#10	0x00000001a0577e04 in -[WKWebView initWithFrame:configuration:] ()
#11	0x0000000104cbf724 in -[AAChartView initConfigurationWithFrame:] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitLib/AAChartCreator/AAChartView.m:133
#12	0x0000000104cbf4e8 in -[AAChartView initWithFrame:] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitLib/AAChartCreator/AAChartView.m:115
#13	0x0000000104c133a4 in -[BasicChartVC setupAAChartView] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitDemo/ChartsDemo/BasicChartVC.m:99
#14	0x0000000104c13208 in -[BasicChartVC drawChart] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitDemo/ChartsDemo/BasicChartVC.m:86
#15	0x0000000104c12f9c in -[BasicChartVC viewDidLoad] at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitDemo/ChartsDemo/BasicChartVC.m:66
#16	0x000000018d4e530c in -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] ()
#17	0x000000018d29bfb4 in -[UIViewController loadViewIfRequired] ()
#18	0x000000018d29a7a8 in -[UIViewController view] ()
#19	0x000000018d98a384 in -[UINavigationController _startCustomTransition:] ()
#20	0x000000018d39dca4 in -[UINavigationController _startDeferredTransitionIfNeeded:] ()
#21	0x000000018d39d3a0 in -[UINavigationController __viewWillLayoutSubviews] ()
#22	0x000000018d39d304 in -[UILayoutContainerView layoutSubviews] ()
#23	0x000000018d2b90f8 in -[UIView(CALayerDelegate) layoutSublayersOfLayer:] ()
#24	0x000000018c6e3e30 in CA::Layer::layout_if_needed(CA::Transaction*) ()
#25	0x000000018c6e39b4 in CA::Layer::layout_and_display_if_needed(CA::Transaction*) ()
#26	0x000000018c6e9bb4 in CA::Context::commit_transaction(CA::Transaction*, double, double*) ()
#27	0x000000018c6e31bc in CA::Transaction::commit() ()
#28	0x000000018d331280 in _UIApplicationFlushCATransaction ()
#29	0x000000018d330d78 in _UIUpdateSequenceRun ()
#30	0x000000018d330468 in schedulerStepScheduledMainSection ()
#31	0x000000018d330524 in runloopSourceCallback ()
#32	0x000000018b04162c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#33	0x000000018b0408a8 in __CFRunLoopDoSource0 ()
#34	0x000000018b03f058 in __CFRunLoopDoSources0 ()
#35	0x000000018b03dd88 in __CFRunLoopRun ()
#36	0x000000018b03d968 in CFRunLoopRunSpecific ()
#37	0x00000001cf33b4e0 in GSEventRunModal ()
#38	0x000000018d4b0edc in -[UIApplication _run] ()
#39	0x000000018d4b0518 in UIApplicationMain ()
#40	0x0000000104d42ba8 in main at /Users/quinn/Documents/objcio/AAChartKit-master/AAChartKitDemo/main.m:38
#41	0x00000001ae55ed84 in start ()

Replies

Your screen shot shows a number of diagnostics enabled. If you disable them one at a time, which one stops the crash from happening?

Share and Enjoy

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

  • If I disable Malloc Stack Logging, the crash will not happen.

  • Malloc Scribble crashes the app. Hope it helps :)

Add a Comment

Why should disable those checkbox?

Why should disable those checkbox?

Because it’s a useful diagnostic test.

There’s nothing fundamentally wrong with any of these diagnostics — they’re all good tools to keep in mind — but if you’re having a weird problem then it’s a good idea to isolate the circumstances that trigger that problem.

Share and Enjoy

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

I experience the same issue. It was fine on Xcode 15.0. And I need to disable Malloc Scribble in Xcode 15.3, otherwise I just can't run Debug build.