This crash is happening because the update queue utilized for STScreenTimeConfigurationObserver in WebKit is concurrent instead of serial.
See the highlighted line introduced in WebKit.
a) The quick path is for WebKit to utilize the main queue or a private serial one instead of a global concurrent.
b) Additionally the ScreenTime framework should either not allow concurrent queues to be utilized in STScreenTimeConfiugurationObserver.init(updateQueue:) or support concurrent queues.
TL;DR [STScreenTimeConfigurationObserver setConfiguration:] is getting called multiple times at once and the KVO code is not thread safe.
The Automatic KVO implementation for STScreenTimeConfigurationObserver is not thread safe. While STScreenTimeConfiguration is.
This issue can be reproduced by concurrently setting the private method [STScreenTimeConfigurationObserver setConfiguration: configuration] to a new configuration.
In the implementation of STScreenTimeConfigurationObserver, the configuration is nil on setup. And the first callback from the underlying NSEXCConnection calls [STScreenTimeConfigurationObserver setConfiguration:]. Further updates call the private method [STScreenTimeConfigurationObserver _updateWithConfiguration:] which update the instance of STScreenTimeConfiguration directly where its kvo updates are thread safe.
How to reproduce:
// AppDelegate.swift
let observer = MyObserver()
observer.startObservation
Swift 6.2 (approachable concurrency is turned off)
Apologies about the escaped characters in the upload, a LLM can fix it pretty quick.