GameSaveSyncedDirectory.openDirectory() crashes in CloudDocs initUIApplicationWillResignActiveNotification

We use the GameSave framework to sync player save data to iCloud. Since iOS 27, our game crashes a few seconds after a cold launch, the first time it calls GameSaveSyncedDirectory.openDirectory(). We call the API only from the main actor, but the crash is on a cooperative thread inside GameSave:

EXC_BAD_ACCESS (SIGSEGV) KERN_INVALID_ADDRESS at 0x400000000000bad0
libobjc.A.dylib  objc_release
CloudDocs        initUIApplicationWillResignActiveNotification
CloudDocs        -[BRQuery _setQueryState:]
CloudDocs        -[BRQuery _runQuery]
CloudDocs        -[BRQuery executeWithOptions:]
Foundation       -[NSMetadataQuery startQuery]
GameSave         BundleUpdatesWaiter.initMetadataQuery()
GameSave         BundleUpdatesWaiter.init(bundleURL:)
GameSave         closure #1 in GameSyncedDirectoryHolder.allowReaders(for:)

Other threads are inside the same BRQuery path at the same moment. The crash reproduces without GameSave: starting twoNSMetadataQuery objects at once on background threads in a fresh process crashes 94 times in 100 in the iOS 27.0 Simulator, and never on iOS 26.5, so this seems like a regression. Starting one query on a single thread never crashes.

I've submitted a support request (FB25352978) so hopefully this will be looked at fairly soon - if anyone else runs into this it would be good to know!

This looks like Just A Bug™. Although it’s an interesting bug (-:

Written by ToadLobe in 853970021

I've submitted a support request (FB25352978)

Thanks. That’s the best path for this.

I got one of your crash reports from the bug and went digging. I have some info to share as to what’s going wrong, but it’d be easier for me to talk about that if I had a crash report to reference. Can you post one here? Ideally, a JSON (.ips) crash report. See Posting a Crash Report for advice on how to post stuff like this.

If not, that’s fine. Reply here to let me know and I’ll tailor my reply based on the info you’ve already shared.

I want to stress, however, that AFAICT this really is a bug on our end, so my analysis is unlikely to actually help you. Although I hope you’ll find it interesting!

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

Hi Quinn, thanks for the quick reply.

race-2026-10-28-180244.0002.txt(63 KB)

This is one from the simulator.

This is the first iOS bug I've reported so I'm not sure what the fix proccess/timeline looks like for something like this?

In the meantime, this is the workaround I'm using:

private func warmUpMetadataQueries() {
	let query = NSMetadataQuery()
	query.searchScopes = [NSMetadataQueryUbiquitousDataScope]
	query.predicate = NSPredicate(value: true)
	query.start()
	query.stop()
}

Calling it once on app startup seems to prevent the crash, but I'm not sure if there are any caveats to this approach - maybe you could adivse.

Best,
Pablo