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).
Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)EXC_BAD_ACCESS (code=2 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
- ITMS-91053 ITMS-91053: Missing API declaration — Your app's code references required reason APIs (privacy manifest)
- Cannot convert value of type Swift: Cannot convert value of type 'X' to expected argument type 'Y'
- integrity could not be verified Unable to Install "App": This app cannot be installed because its integrity could not be verified
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026