after my program finishes i get this message and dont why, can anyone explain

*** glibc detected *** ./tryp: double free or corruption (top): 0x089b8008 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0xb7729591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0xb772ade8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xb772decd]
/lib/tls/i686/cmov/libc.so.6(fclose+0x14a)[0xb7719aaa]
./tryp[0x804875c]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xb76d4bd6]
./tryp[0x8048521]
======= Memory map: ========
08048000-08049000 r-xp 00000000 07:00 1725249 /home/k/cprog/tryp
08049000-0804a000 r--p 00000000 07:00 1725249 /home/k/cprog/tryp
0804a000-0804b000 rw-p 00001000 07:00 1725249 /home/k/cprog/tryp
089b8000-089d9000 rw-p 00000000 00:00 0 [heap]
b7500000-b7521000 rw-p 00000000 00:00 0
b7521000-b7600000 ---p 00000000 00:00 0
b768b000-b76a8000 r-xp 00000000 07:00 1177428 /lib/libgcc_s.so.1
b76a8000-b76a9000 r--p 0001c000 07:00 1177428 /lib/libgcc_s.so.1
b76a9000-b76aa000 rw-p 0001d000 07:00 1177428 /lib/libgcc_s.so.1
b76bd000-b76be000 rw-p 00000000 00:00 0
b76be000-b7811000 r-xp 00000000 07:00 1308267 /lib/tls/i686/cmov/libc-2.11.1.so
b7811000-b7812000 ---p 00153000 07:00 1308267 /lib/tls/i686/cmov/libc-2.11.1.so
b7812000-b7814000 r--p 00153000 07:00 1308267 /lib/tls/i686/cmov/libc-2.11.1.so
b7814000-b7815000 rw-p 00155000 07:00 1308267 /lib/tls/i686/cmov/libc-2.11.1.so
b7815000-b7818000 rw-p 00000000 00:00 0
b7829000-b782d000 rw-p 00000000 00:00 0
b782d000-b782e000 r-xp 00000000 00:00 0 [vdso]
b782e000-b7849000 r-xp 00000000 07:00 1177401 /lib/ld-2.11.1.so
b7849000-b784a000 r--p 0001a000 07:00 1177401 /lib/ld-2.11.1.so
b784a000-b784b000 rw-p 0001b000 07:00 1177401 /lib/ld-2.11.1.so
bff93000-bffa8000 rw-p 00000000 00:00 0 [stack]
Aborted

Could be you freed a pointer *and did not set it to NULL* and then tried to free it again..The message indicates the problem lies at address 0x089b8008

*** glibc detected *** ./tryp: double free or corruption (top): 0x089b8008 ***

Edited 6 Years Ago by gerard4143: n/a

Comments
thanks

all my pointer are set to NULL the program works it copies one file to another fine

FILE *original_pointer = NULL;
	FILE *copy_pointer = NULL;
	FILE *create_pointer = NULL;
	FILE *open_pointer = NULL;

thnaks i sorted it out now i closed the pointer and tried to open it again in a loop thanks for your help much apreciated

This question has already been answered. Start a new discussion instead.