Yes the project UserDefaults27 was created especially to reproduce the issue we have in our app
Hmmm. In that case I’m not able to reproduce the problem. Here’s what I did specifically:
- On macOS 26.5, I launched Xcode 27.0b1.
- I opened your project.
- In Signing & Capabilities I selected my Team ID and change the bundle ID.
- I ran your app on an iPhone 17 running iOS 27.0b1.
It ran just fine, printing:
day: 0
day: 0
day: 0
day: 0
day: 0
day: 0
day: 0
day: 0
day: 0
day: 0
I took a look at your bug (FB23310748) and it seems that the Foundation team is having similar problems reproducing the issue.
I then downloaded the sysdiagnose logs from the bug and looked for crash reports from the UserDefaults27 app. I found a bunch, but none of them match your description of the issue. Specifically, they all crashed like this:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
with a crashing thread backtrace like this:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib … __abort_with_payload + 8
1 libsystem_kernel.dylib … abort_with_payload_wrapper_internal + 104
2 libsystem_kernel.dylib … abort_with_reason + 32
3 libobjc.A.dylib … _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 116
4 libobjc.A.dylib … _objc_fatal(char const*, ...) + 32
5 libobjc.A.dylib … objc_defaultForwardHandler(objc_object*, objc_selector*) + 104
6 libxpc.dylib … _xpc_serializer_pack + 408
7 libxpc.dylib … _xpc_pipe_pack_message + 188
8 libxpc.dylib … _xpc_pipe_routine + 140
9 libxpc.dylib … _xpc_interface_routine + 168
10 libxpc.dylib … _xpc_init_pid_domain + 892
11 libxpc.dylib … _xpc_early_init + 68
12 libxpc.dylib … _xpc_init_service + 292
13 libxpc.dylib … _libxpc_initializer + 1412
14 libSystem.B.dylib … libSystem_initializer + 256
15 dyld … invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::Ru…
16 dyld … invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::Ru…
17 dyld … invocation function for block in mach_o::Image::forEachInitializer(void (unsigned i…
18 dyld … mach_o::Header::SegmentInfo mach_o::Header::parse_segment_command<true>(mach_o::Hea…
19 dyld … invocation function for block in mach_o::Header::forEachSection(void (mach_o::Heade…
20 dyld … mach_o::Header::forEachSection(void (mach_o::Header::SectionInfo const&, bool&) blo…
21 dyld … mach_o::Image::forEachInitializer(void (unsigned int) block_pointer) const + 244
22 dyld … dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const::$_0::operator…
23 dyld … dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const (.cold.3) + 80
24 dyld … dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 652
25 dyld … dyld4::JustInTimeLoader::runInitializers(dyld4::RuntimeState&) const + 36
26 dyld … dyld4::APIs::runAllInitializersForMain() + 100
27 dyld … dyld4::prepare(dyld4::APIs&, mach_o::UnsafeHeader const*) + 4424
28 dyld … dyld4::start(dyld4::KernelArgs*, void*, void*, unsigned long long)::$_1::operator()…
29 dyld … start + 6536
That’s an interesting crash, but it’s not the EXC_BAD_ACCESS you’re seeing.
Please reproduce the problem using the UserDefaults27 test app, grab an .ips crash report, and post it here. See Posting a Crash Report for advice on how to do that.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"