iOS 26 WKWebView STScreenTimeConfigurationObserver KVO Crash

Fatal Exception: NSInternalInconsistencyException Cannot remove an observer <WKWebView 0x135137800> for the key path "configuration.enforcesChildRestrictions" from <STScreenTimeConfigurationObserver 0x13c6d7460>, most likely because the value for the key "configuration" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the STScreenTimeConfigurationObserver [class.]

I noticed that on iOS 26, WKWebView registers STScreenTimeConfigurationObserver, Is this an iOS 26 system issue? What should I do?

has same issue. what do

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem, and post the Feedback number here once you do. If you post the Feedback number here I'll check the status next time I do a sweep of forums posts where I've suggested bug reports.

Bug Reporting: How and Why? has tips on creating your bug report.

I have same problem, and crash count is groving because users update iOS

One more, all crash is happening in iOS 26.1.0 and iPadOS 26.1.0

Same with me as well, both present in iOS 26.1 and 26.2. One of our top ones at 1,473 crash events total.

Our happens on an XPCConnection update.

Same issue for me

Same issue here. Seems to be present in 26.1 and 26.2

same error ,only iOS26+

Same iOS26.1 iOS26.2

What is happening

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.

How to fix (suggestions)

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.

Why is this happening

TL;DR [STScreenTimeConfigurationObserver setConfiguration:] is getting called multiple times at once and the KVO code is not thread safe.

The Details

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.

@susu123, thank you for filing FB21537703. Looking at the status of that bug I see the engineering team has asked if you are able to reproduce this problem in the most recent update. To prevent this bug from being closed, please test in the most recent update and add those details to your bug report.

Please continue testing your software in new system software updates and beta releases as they become available. And please update the status of your bug whenever you do a new test. Please see https://developer.apple.com/download/ for the most recent beta releases.

For the rest of you on this thread, please consider filing feedback reports as well. Though indeed they will be duplicate reports to FB21537703, duplicate reports matter and help engineering understand how many people's apps are affected by a problem.

Bug Reporting: How and Why? has tips on creating your bug report.

Filed under FB21862078

@DTS Engineer

It looks like this issue will be fixed from the WebKit side here: https://github.com/WebKit/WebKit/commit/70e39a01ecebf7473ac1a3f4670b47f1222c65ce

The issues still present in the iOS STScreenTimeConfigurationObserver though. Could it be documented or have a fatal error thrown on initialization of the queue is concurrent if that is possible. Future proof further instances?

@flerbs thanks for mentioning that. I checked and I can see you added mention of the WebKit link you mentioned to your bug report. I don't see any other activity in that as of yet. Please continue updating your bug report as you test in future system software updates.

iOS 26 WKWebView STScreenTimeConfigurationObserver KVO Crash
 
 
Q