Debugging a SIGSEGV Backtrace Part 2

Today I found an effortless way to debug a sisseg backtrace using gdb:

The problem was this backtrace:
[17450 XX 23:31:34 (+18)][10237] <TWS_ERROR> {sigsafe} src/common.c@1303: [bt]: (5) /usr/lib64/twsch/[0x7f64a2467669]

The procedure:

1 – First of all we need to open a instance of the process with gdb, and run only to the begin of the main function to let the process dynamic load the libraries:

$ gdb ./your_buggy_app

(gdb) b main

2 – use the function name and the offset in this way

(gdb) info line *ott_thread+0x1fd

the result:

Line 426 of “src//ch.c” starts at address 0x7fffee99a65d <ott_thread+497> and ends at 0x7fffee99a68b <ch_thread+543>.

More clear? Throw it some water