각종 표준에는 이미 해체한 메모리를 다시 해체하려고 할 때 행동을 정의하지 않고 있으나, GLIBC는 깔끔하게 자살해주고 있다. 자살할 때 패턴을 눈에 익혀 놓으면 나중에 왜 죽었지?하는 일이 줄어들 것이다. #include <stdlib.h> int main(int argc, char* argv[]) { void* p(malloc(1024)); free(p); free(p); return 0; } 컴파일 및 실행 $ g++ -O2 -g dblfree.cpp -o dblfree $ ./dblfree *** glibc detected *** ./dblfree: double free or corruption (top): 0x000000001460a010 *** ======= Backtrace: ========= /lib64/libc.so.6[0x3704671684] /lib64/libc.so.6(cfree+0x8c)[0x3704674ccc] ./dblfree(__gxx_personality_v0+0x10e)[0x4005de] /lib64/libc.so.6(__libc_start_main+0xf4)[0x370461d8b4] ./dblfree(__gxx_personality_v0+0x39)[0x400509] ======= Memory map: ======== 00400000-00401000 r-xp 00000000 08:07 45776987 /home/purewell/tmp/dblfree 00600000-00601000 rw-p 00000000 08:07 45776987 /home/purewell/tmp/dblfree 1460a000-1462b000 rw-p 1460a000 00:00 0 3703600000-370361a000 r-xp 00000000 08:03 4845228 ...