<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 1, 2017, at 5:00 PM, Maxim Veksler via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">My method, though effective is probably barbaric. It's been years since I've touched code that can actually seg fault, and I'm rusty on how you approach debugging such cases, I'm wondering both Mac and Linux, even though my case is Linux only.</div></div></blockquote></div><br class=""><div class="">You run the program in a debugger, probably gdb if this is Linux. Just run "gdb /path/to/binary”. Then at the “(gdb)” prompt enter “run”. (You can type command-line arguments after “run" and they’ll be passed to your program.) If the process segfaults or otherwise crashes, gdb takes over and prints another prompt. Now you can start debugging. The usual first thing I do is enter “bt” which will dump the stack. That itself should produce enough output to submit a bug report. There are lots of docs and tutorials for gdb online if you want to learn more.</div><div class=""><br class=""></div><div class="">gdb is no longer used on Mac (we have lldb instead), so further discussion of it would be off-topic here :)</div><div class=""><br class=""></div><div class="">Another possibility, instead of gdb, is getting the OS to produce a crash report when the process terminates. On Mac this is enabled by default, but maybe you need to toggle some setting on Linux to get similar behavior.</div><div class=""><br class=""></div><div class="">—Jens</div></body></html>