GLIBC detected * * */test:free (): Invalid POINTER:0X0854D1B4 * * *
======= BackTrace: =========
/lib/tls/i686/cmov/libc.so.6 (+0x6b591) [0x208591]
/lib/tls/i686/cmov/libc.so.6 (+0x6cde8) [0x209de8]
/lib/tls/i686/cmov/libc.so.6 (CFREE+0X6D) [0X20CECD]
./test[0x804946f]
/lib/tls/i686/cmov/libc.so.6 (__libc_start_main+0xe6) [0x1b3bd6]
./test[0x8048d71]
======= Memory Map: ========
0019d000-002f0000 R-xp 00000000 07:00 2730/lib/tls/i686/cmov/libc-2.11.1.so
002f0000-002f1000---p 00153000 07:00 2730/lib/tls/i686/cmov/libc-2.11.1.so
002f1000-002f3000 r--p 00153000 07:00 2730/lib/tls/i686/cmov/libc-2.11.1.so
002f3000-002f4000 rw-p 00155000 07:00 2730/lib/tls/i686/cmov/libc-2.11.1.so
002f4000-002f7000 Rw-p 00000000 00:00 0
00470000-0048b000 R-xp 00000000 07:00 17281/lib/ld-2.11.1.so
0048b000-0048c000 r--p 0001a000 07:00 17281/lib/ld-2.11.1.so
0048c000-0048d000 rw-p 0001b000 07:00 17281/lib/ld-2.11.1.so
0070f000-0072c000 R-xp 00000000 07:00 2638/lib/libgcc_s.so.1
0072c000-0072d000 r--p 0001c000 07:00 2638/lib/libgcc_s.so.1
0072d000-0072e000 rw-p 0001d000 07:00 2638/lib/libgcc_s.so.1
007da000-007db000 R-xp 00000000 00:00 0 [VDSO]
00b56000-00b75000 R-xp 00000000 07:02 3469/usr/lib/libjpeg.so.62.0.0
00b75000-00b76000 r--p 0001e000 07:02 3469/usr/lib/libjpeg.so.62.0.0
00b76000-00b77000 rw-p 0001f000 07:02 3469/usr/lib/libjpeg.so.62.0.0
08048000-0804a000 R-xp 00000000 07:01 1528/home/magic/digital--004-01bug/test
0804a000-0804b000 r--p 00002000 07:01 1528/home/magic/digital--004-01bug/test
0804b000-0804c000 rw-p 00003000 07:01 1528/home/magic/digital--004-01bug/test
08545000-08566000 Rw-p 00000000 00:00 0 [Heap]
b7400000-b7421000 Rw-p 00000000 00:00 0
b7421000-b7500000---P 00000000 00:00 0
b7583000-b75db000 Rw-p 00000000 00:00 0
b75db000-b78db000 rw-s e0000000 00:05 2167/dev/fb0
b78db000-b78dd000 Rw-p 00000000 00:00 0
b78eb000-b78ee000 Rw-p 00000000 00:00 0
bff1b000-bff30000 Rw-p 00000000 00:00 0 [Stack]
Has abandoned
----The following is my search from the Internet a little explanation:
These messages generally mean this heap storage (i.e. malloc) has been.
Unfortunately, you won ' t get much information from the stack dump as to who or what caused this problem. Heap corruption is usually caused by a rogue pointer or buffer overwrite and shows up later The damage has been done.
Valgrind is a good memory checker to these types of problems.
Methods of testing:
After malloc, the address of the pointer is then typed.
The address of the pointer before free
Compare these two addresses to be the same, if the difference is your pointer is changed.