This afternoon I was testing my Swift/Spritekit game on my iPad when it crashed. I've recovered the crash log fine, but at a bit of a loss as to the problem, as I'm not sure what assertion actually failed. Here is the top of the log...
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001b1d7dd7c
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [524]
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libswiftCore.dylib 0x1b1d7dd7c _assertionFailure(_:_:file:line:flags:) + 312
1 libswiftCore.dylib 0x1b1d7dd7c _assertionFailure(_:_:file:line:flags:) + 311
2 MyGame 0x102d28f50 CampaignState.healNonChosenActors() + 948
3 MyGame 0x102c08f50 specialized MissionReportScene.init(actors:mission:) + 6968
...
If I understand correctly, EXC_BREAKPOINT (SIGTRAP)
and Trace/BPT trap: 5
points at a Swift assertion failing, but the code in question isn't doing any force-unwrapping, potentially overflowing arithmetic or anything else fishy, literally just a filter
of a non-optional array followed by a foreach
.
Is there a way to figure out exactly what the runtime thought went wrong?