Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
The app accessed memory it shouldn’t — a dangling pointer, released object, unsafe pointer misuse, a data race, or infinite recursion (stack overflow).
Seen on:
iOS
Meaning
In Swift it often comes from unowned references to deallocated objects, Unsafe pointers, Objective-C interop, or concurrent mutation. code=2 with a deep stack usually means infinite recursion. Zombies and Address/Thread Sanitizer pinpoint it.
Common causes
- Accessing a deallocated object (unowned/unsafe reference, delegate not weak/strong properly)
- Infinite recursion overflowing the stack
- Data race on shared state
- Misused UnsafePointer / C interop
⚡ Quick fix
- Enable Zombie Objects and Address Sanitizer in the scheme
- Look at the stack for recursion
- Enable Thread Sanitizer for races
Detailed fix by platform
Xcode
# Product → Scheme → Edit Scheme → Run → Diagnostics → Address Sanitizer, Thread Sanitizer, Zombie Objects
How to diagnose
- Stack — Repeating frames (recursion)?
- Object — Which object was released?
- Threads — Concurrent access?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 0xC0000005 The application was unable to start correctly (0xc0000005) / Exception code 0xc0000005 access violation
- attempted to access privacy-sensitive data without a usage description This app has crashed because it attempted to access privacy-sensitive data without a usage description
- Cannot allocate memory fork: Cannot allocate memory / ENOMEM
Most viewed in iOS
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026