Quick answer: EXC_BREAKPOINT (SIGTRAP) means the process executed a trap instruction on purpose. Some code checked a condition, found it could not continue, and stopped the game deliberately. In practice that is the Swift runtime (a force unwrap of nil, an array index out of range, an integer overflow, fatalError), a system library such as libdispatch reporting misuse, or __builtin_trap() in C or C++ code. Symbolicate the report and read frame 0 of the crashed thread: it is the line that failed the check.

The name is misleading. Nobody left a breakpoint in your game. On ARM processors a trap instruction is how code says “stop here, this must never happen”, and the system reports it with the same exception type a debugger breakpoint uses. Unlike a bad memory access, there is no corrupted pointer to chase: the crash is a failed check, and the check is on the line the report points at. In a game built with Unity, Unreal or Godot, that line is usually inside a native plugin or your own Swift bridge code, because that is where the Swift runtime and the system’s threading rules come into play. This guide covers how to identify which kind of trap you have and how to fix each one.

The exact error

The top of the crash report (example values):

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000104e0b4c8
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [2041]

Triggered by Thread:  0

Reports in the older text format show the same thing as two lines:

Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5

The second exception code is the address of the trap instruction, which is also the top frame of the crashed thread. The same bug in an Intel build, such as the iOS Simulator on an Intel Mac, is reported as EXC_BAD_INSTRUCTION (SIGILL). The fixes are identical.

What the exception means

Three kinds of code raise this exception on iOS.

It helps to place it next to its neighbors. EXC_BAD_ACCESS is an accident: the code touched memory it should not. EXC_CRASH (SIGABRT) is a call to abort(), usually from an uncaught Objective-C or C++ exception. A watchdog kill (0x8badf00d) and a memory kill are the system ending your process from outside. EXC_BREAKPOINT is the only one where your own process stopped at an exact line by design.

Identify the source from the top frames

The report needs symbols first. If the crashed thread shows only addresses, follow the dSYM symbolication guide, then match the top of the thread against this table.

Top of the crashed threadSourceTypical bug
Your own Swift function at frame 0, often the same file and line twice, or a frame named Swift runtime failure: ...A check the Swift compiler placed in your codeForce unwrap of nil, index out of range, arithmetic overflow, a number that does not fit the target type
_assertionFailure or swift_unexpectedError in libswiftCore.dylib, your function below itThe Swift standard libraryfatalError, a failed precondition, try! on a call that threw
__DISPATCH_WAIT_FOR_QUEUE__, _dispatch_sync_f_slow in libdispatch.dylibDispatchsync onto the queue the code is already running on
_dispatch_assert_queue_failDispatch, including Swift concurrency’s isolation checksCode that must run on the main queue was called from a background thread
_dispatch_semaphore_dispose, dispatch_group_leaveDispatchA semaphore released while still in use, or more leave() calls than enter()
CFRelease in CoreFoundationCore FoundationReleasing a NULL reference
A frame in the engine’s binary or a C++ library, with no Swift involved__builtin_trap() or an assert macroAn engine or library fatal check; its message is in the device log

Also look at which binary owns frame 0. UnityFramework or your game’s executable means code compiled into the game, including plugin source files. A vendor’s .framework means that SDK trapped, and the frames below it show which of your calls led there.

Find the message

A trap usually comes with a sentence, and there are three places to look for it.

  1. The crash report. Framework messages appear under Application Specific Information:
    Application Specific Information:
    BUG IN CLIENT OF LIBDISPATCH: dispatch_sync called on queue already owned by current thread
    The system sometimes leaves this field out of reports for privacy reasons, so its absence proves nothing.
  2. The Xcode console. Reproduce the crash with the debugger attached and Swift prints the reason before stopping, for example Fatal error: Unexpectedly found nil while unwrapping an Optional value or Fatal error: Index out of range, prefixed with the file and line.
  3. The device log. Engines log their fatal error text before trapping. Open Window > Devices and Simulators in Xcode, select the device and open its console, then reproduce.

For crashes from players, open Window > Organizer > Crashes in Xcode. Reports there are grouped and symbolicated when the build’s dSYM is available. When there is no message, the symbolicated line is still enough: read that line and ask which of its operations has a check attached. A !, a subscript, an arithmetic operator and a numeric conversion are the candidates.

Fix Swift runtime traps

Force unwraps. The classic plugin crash is a chain of ! written for the happy path:

// Broken: traps if products have not loaded yet or the ID is misspelled.
let product = products.first(where: { $0.productIdentifier == productID })!
purchase(product)

// Fixed: handle the missing value where it first appears.
guard let product = products.first(where: { $0.productIdentifier == productID }) else {
    reportPurchaseFailure("Product \(productID) is not available")
    return
}
purchase(product)

The same applies to URL(string:)! with text from a server, Bundle.main.url(forResource:withExtension:)! for a file that was not copied into the build, and implicitly unwrapped properties (var delegate: AdDelegate!) used before they are set. In game plugins, the frequent one is finding a view controller to present from. In a Unity game, ask Unity for it with UnityGetGLViewController() instead of unwrapping the application’s window list.

Index out of range. Check the index against the collection you are indexing now, which may be smaller than it was when the UI was built:

// Broken: traps when the server returns fewer rows than last time.
let entry = leaderboard[row]

// Fixed
guard leaderboard.indices.contains(row) else { return }
let entry = leaderboard[row]

Overflow and numeric conversion. Swift traps on overflow for +, - and *, and when a value does not fit the type you convert it to. Game math produces both:

// Broken: traps if elapsed is NaN or infinite, or if score exceeds Int32.
let seconds = Int(elapsed)
let packed = Int32(score)

// Fixed: decide what an out-of-range value should become.
let seconds = elapsed.isFinite ? Int(elapsed) : 0
let packed = Int32(clamping: score)

Use Int32(exactly:) when you would prefer nil to a clamped value, and the wrapping operators (&+, &*) only where wrap-around is what you want, as in a hash.

fatalError and try!. Search plugin code for both. A default: fatalError() in a switch over a value that comes from a server will fire the day the server adds a case. Return an error to the caller instead, and replace try! with do and catch for anything that reads files or decodes data.

Forced casts. A failed as! is the same class of mistake and Apple documents it alongside force unwraps. In many reports it arrives as SIGABRT with a message beginning Could not cast value of type. Either way, use as? and handle the mismatch.

Fix libdispatch and main-thread traps

dispatch_sync onto your own queue. Calling DispatchQueue.main.sync while already on the main thread can never finish, so Dispatch traps instead of hanging:

// Broken: traps when showStore() is called from the main thread.
func showStore() {
    DispatchQueue.main.sync { self.presentStoreUI() }
}

// Fixed
func showStore() {
    if Thread.isMainThread {
        presentStoreUI()
    } else {
        DispatchQueue.main.async { self.presentStoreUI() }
    }
}

“Block was expected to execute on queue.” The message reads like this:

BUG IN CLIENT OF LIBDISPATCH: Assertion failed: Block was expected to execute on queue [com.apple.main-thread (0x1f2a3c4d0)]

Some code asserted that it was on the main queue and it was not. Explicit dispatchPrecondition(condition: .onQueue(.main)) calls do this, and so does Swift concurrency: code isolated to the main actor checks at run time that it really is on the main thread. Many SDK completion handlers for ads, purchases and sign-in are delivered on a background queue, and a closure that the compiler treated as main-actor code traps the moment the SDK calls it. Hop to the main queue inside the handler before touching UI or main-actor state:

// Broken: the completion handler may run on a background queue.
adBridge.loadRewardedAd { result in
    self.updateRewardButton(result)
}

// Fixed
adBridge.loadRewardedAd { result in
    DispatchQueue.main.async {
        self.updateRewardButton(result)
    }
}

If the plugin is compiled in the Swift 6 language mode and the trap happens before your first line runs, the closure itself is being checked. Mark the closure @Sendable so it is not inferred as main-actor code, then hop explicitly as above.

Semaphores and groups. Semaphore object deallocated while in use means a DispatchSemaphore was destroyed while its value was lower than when it was created; balance every wait() with a signal(), including on error paths. Unbalanced call to dispatch_group_leave() means a completion handler ran twice or an error path called leave() again. Put the leave() in a defer at the top of the handler and make sure the handler cannot be invoked twice.

Fix traps in C, C++ and engine code

When the crashed thread has no Swift and no libdispatch in it, a native library trapped on purpose. Clang compiles __builtin_trap() to a trap instruction on arm64, so any macro built on it lands here. Godot is the clearest example: its fatal checks print a line starting FATAL: with the condition, file and line, then execute a trap. An EXC_BREAKPOINT in a Godot game with engine frames on top is that mechanism, and the log line is the part to read.

A C# exception in a Unity game is normally not this crash. IL2CPP turns managed exceptions into C++ exceptions that Unity catches and logs, and the game keeps running. If a Unity game reports EXC_BREAKPOINT, look for Swift or Objective-C plugin frames first.

For your own native code, a trap you wrote is a check that failed in the field. Keep the check, and turn the condition into an error the game can survive when the input comes from outside:

// Broken: a corrupt save file takes the game down.
if (header.version > kMaxVersion) __builtin_trap();

// Fixed: reject the file and let the caller show a message.
if (header.version > kMaxVersion) {
    return LoadResult::UnsupportedVersion;
}

For CFRelease, test the reference before releasing it. Unlike Objective-C messages to nil, Core Foundation functions do not accept NULL.

How to confirm the fix

Reproduce the trap first, with the input that triggers it: the missing product, the empty leaderboard, the callback on a background thread. A trap is deterministic, so the same input must now reach your new error path. Then run the game from Xcode with Main Thread Checker enabled (Product > Scheme > Edit Scheme > Run > Diagnostics) and exercise every plugin flow; it flags UI work on background threads before it becomes a crash. After release, filter the Organizer’s crash list to the new version and check that the group whose top frame was your line has stopped collecting reports.

What Bugnet can and cannot tell you

Bugnet does not capture native crashes as stack traces, does not ingest .ips files and does not symbolicate, so an EXC_BREAKPOINT never arrives in the dashboard as a ready-made stack. Xcode’s Organizer and the dSYM do that job. A session that ends in a trap also never reports its end, so it is not counted as crashed in the crash-free session rate.

What the Unity SDK does capture on iOS is everything that reaches the Unity log as an exception, error or assert, with recent log lines. Those lines are often the trail that leads to the trap: the plugin error, the failed product request, the callback that arrived late. Reports written by players through the in-game form carry the OS version, CPU, GPU, RAM and game version, which tells you which build’s dSYM to open. For a trap you cannot fix this week, a public known-issue entry gives affected players the workaround.

Frequently asked questions

What does EXC_BREAKPOINT (SIGTRAP) mean in an iOS crash report?

The process executed a trap instruction deliberately. The Swift runtime, a system library such as libdispatch, or C and C++ code found a condition it would not continue past and stopped the app at that exact line. It has nothing to do with debugger breakpoints left in the build.

Why does a Swift force unwrap crash with EXC_BREAKPOINT instead of an exception?

Swift does not throw for programming errors such as unwrapping nil, indexing past the end of an array or integer overflow. The compiler inserts a check and a trap instruction, and on ARM processors a trap is reported as EXC_BREAKPOINT (SIGTRAP).

What does BUG IN CLIENT OF LIBDISPATCH mean?

Dispatch detected that your code misused it and trapped. The rest of the sentence names the misuse, such as dispatch_sync called on a queue already owned by the current thread, a block running on the wrong queue, or an unbalanced dispatch group leave. It appears under Application Specific Information in the crash report.

Why is the crash EXC_BAD_INSTRUCTION (SIGILL) in the simulator and EXC_BREAKPOINT on a device?

They are the same failure reported for different processors. ARM builds report a trap as EXC_BREAKPOINT (SIGTRAP), and Intel builds, such as the simulator on an Intel Mac, report it as EXC_BAD_INSTRUCTION (SIGILL). The fix is the same.

How do I find the line that caused an EXC_BREAKPOINT crash?

Symbolicate the report with the dSYM for that build and read frame 0 of the crashed thread. For a Swift runtime trap it is the line with the failed check, and for a library trap the first frame below the library's own frames is your call.

A trap is a failed check on the line the report names. Symbolicate, read frame 0, and replace the assumption on that line with handling for the case you thought could not happen.