Debugging Segmentation Faults on a Mac?
For the more modern lldb
flavor
$ lldb --file /path/to/program
...
(lldb) r
Process 89510 launched
...
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x726f00)
* frame #0: 0x00007fff73856e52 libsystem_platform.dylib`_platform_strlen + 18
...
Have you compiled with -g
and run it inside gdb
? Once the app crashes, you can get a backtrace with bt
that should show you where the crash occurs