Glibc Crash Excess

Therefore, when glibc fails, it has the alarm * glibc detected * . Then it prints a bunch of backtraces like

*** glibc detected *** ./odin: free(): invalid pointer: 0xbfba4444 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b161)[0xb75f9161]
/lib/tls/i686/cmov/libc.so.6(+0x6c9b8)[0xb75fa9b8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xb75fda9d]
/usr/lib/libstdc++.so.6(_ZdlPv+0x1f)[0xb77da2ef]

All is well and good, but in other cases when the situation crashes, I do backtrace (), and then use the addr2line system call and print the actual points in the function. But when it glibc crashes, it goes around bypassing any signal handlers that I called.

Is there any way to catch these glibc crashes?

+3
source share
2 answers

, mallopt. M_CHECK_ACTION , , , , , 2 , .

glibc: test1.c
: test2.c
: test3.c

+3

IIRC, glibc abort(), SIGABRT .

valgrind: , , , .

(, ;-)): , . , , ulimit -c unlimited bash. , core. ( core - , ; abrtd, /var/cache/abrt, ). gdb, gdb -c core a.out; gdb , .

+3

All Articles