Yeah, that’s tricky. Consider this:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000003e8000
Your app is crashing because it’s accessing unmapped memory. This usually means that you’re accessing an invalid pointer. The standard next step here is to look at the backtrace of the crashing thread:
Thread 0 Crashed:
0 dyld … strlen + 4
1 dyld … objc::StringHashTable::tryGetIndex(char const*) const + 35
2 dyld … objc::ObjectHashTable::forEachObject(char const*, void (unsigned long long, unsigned short, bool&) b…
3 dyld … dyld4::PrebuiltObjC::ObjCOptimizerImage::visitProtocol(objc::ProtocolHashTable const*, dyld3::Map, d…
4 dyld … dyld3::MachOAnalyzer::forEachObjCProtocol(unsigned long long, unsigned long long, dyld3::MachOAnalyz…
5 dyld … dyld4::PrebuiltObjC::make(Diagnostics&, dyld4::RuntimeState&) + 1659
6 dyld … dyld4::PrebuiltLoaderSet::makeLaunchSet(Diagnostics&, dyld4::RuntimeState&, dyld4::MissingPaths cons…
7 dyld … dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 2875
8 dyld … start + 487
And this is where things get weird )-: All of these stack frames are in the dynamic linker (dyld
) which is trying to link your app to its dynamic libraries. Something is going horribly wrong with that process, which is causing the dynamic linker to crash before any of your code is run.
So, the problem isn’t with the way your code runs, but the way that it’s built O-:
This is on a fairly old version of iOS (15.4.1). Are you able to test on something newer?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"