If you're using glibc, you can set the MALLOC_CHECK_
environment variable to 2
, this will cause glibc to use an error tolerant version of malloc
, which will cause your program to abort at the point where the double free is done.
You can set this from gdb by using the set environment MALLOC_CHECK_ 2
command before running your program; the program should abort, with the free()
call visible in the backtrace.
see the man page for malloc()
for more information
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…