Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-29-2006, 08:40 PM   #1
Registered: Oct 2006
Posts: 131

Rep: Reputation: 15
glibc detected double free or corruption (URGENT)


i am getting *** glibc detected *** double free or corruption (!prev): 0x080bd7c0 *** this error can anyone help me to resolve this error. this type of error will occur due to malloc or calloc functions but still not have good idea to resolve this glibc double free error.

1. what is this error.
2. how to solve this error.
3. how to set MALLOC_CHECK_ variable

Thanks & Regards
Old 10-29-2006, 09:06 PM   #2
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 115Reputation: 115
a. it isn't urgent for me
b. can't help you much without the code
c. looks like you need a copy of K&R The C programming language

As the error message states, you are calling free() on a pointer more than once. Without code, all I can say is try and inspect everywhere you call malloc() and free() for the potential of multiple free() calls.
Old 10-29-2006, 09:46 PM   #3
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Always initialize pointers to NULL and always set free pointers to NULL

Tuxdev is right.

But the first, best thing you can do is:

1. Look at your code.
a) Find everyplace you declare a pointer, and initialize it to NULL at the exact point you declare it.
b) Find everyplace you free the pointer, and set it to NULL the moment after you free it.
<= This won't only help you find this particular problem...
it's also a great habit to get into

2. See if there's any place where you might inadvertantly call "free" on a variable that's already free.

Good luck .. PSM
Old 10-30-2006, 11:06 AM   #4
Registered: May 2006
Location: England
Distribution: Slackware 10.2, Slamd64
Posts: 249

Rep: Reputation: 31
Sounds like you need to visit (after you've read K&R, of course! ).
Old 10-30-2006, 03:23 PM   #5
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
you could even to something really crazy like use a debugger to walk through the code and find where it is crashing..


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
FC3 glibc detected *** double free or corruption: josedragone Fedora 5 09-17-2009 10:16 PM
*** glibc detected *** double free or corruption (!prev): 0x082c1120 *** eXor Slackware 6 04-11-2008 08:47 AM
*** glibc detected *** double free or corruption (!prev): 0x08294448 *** Deepti Joshi Linux - Software 1 05-31-2006 10:55 PM
*** glibc detected *** double free or corruption (C++) urzumph Programming 25 01-07-2006 04:03 PM
Open Office user install error: *** glibc detected *** double free or corruption: 0xb r_jensen11 Linux - General 6 01-16-2005 06:08 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration