I am building some basic crash logging system based on this blog post ( yes , I know about PLCRashReporter and no , I canβt use it and I need to roll my own, albeit limited. Thanks).
My code registers both an exception handler (s NSSetUncaughtExceptionHandler()) and a signal handler for most signals:
SIGQUIT
SIGILL
SIGTRAP
SIGABRT
SIGEMT
SIGFPE
SIGBUS
SIGSEGV
SIGSYS
SIGPIPE
SIGALRM
SIGXCPU
SIGXFSZ
It seems to work just fine with Objective-C basic things like "unrecognized selector sent to instance ..." etc.
Then I tried this with the following Swift code :
var empty:String! = nil
let index = empty.startIndex
... EXC_BAD_INSTRUCTION ( ), :
:
... Xcode.
?
, SIGTRAP; , , , .
: , Swift ( , ..); . , XCode EXC_BAD_INSTRUCTION, : , ?
2: , , 20+, signal.h ( ); , .
3: Apple " " :
Trace Trap [EXC_BREAKPOINT//SIGTRAP]
, , . , __builtin_trap(). , .
(, libdispatch) . " " .
Swift , , :
, , . . , . , .
( )
: SIGTRAP?