ADDR2LINE gives the line number where it crashed, not the next one. Try adding this code to the nearest main () to get backtrack of the last addresses and pass them to addr2line .. see what you get.
void sig_segv(int signo) { // Generate backtrace void *addresses[40]; char **strings; int c = backtrace(addresses, 40); strings = backtrace_symbols(addresses,c); printf("backtrace returned: %d\n", c); for (int i = 0; i < c; i++) { std::cout << strings[i] << std::endl; } exit(1); }
inside main ()
signal(SIGSEGV, sig_segv);
The only right reason / explanation for this is yes, it leads to a crash in a free function. But with the return value and, therefore, this means the end of line 82 and the beginning of line 83.
source share