LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 03-26-2009, 09:21 AM   #1
glq2000
LQ Newbie
 
Registered: Mar 2009
Location: china
Distribution: FC
Posts: 2

Rep: Reputation: 0
Question why glibc detected *** /IDC/IDC/idc: double free or corruption (!prev): 0x60079080 **


when debuging a multi-thread program I encounter the error as follows:

*** glibc detected *** /IDC/IDC/idc: double free or corruption (!prev): 0x60079080 ***

and gdb locate it at free().

I run a sample test in which free() is called twice continiously, "*** glibc detected *** /IDC/IDC/idc: double free or corruption (!fasttop): " will be displayed.

when fclose() is called twice continiously,"double free or corruption (!top):" will be displayed.

but what on earth (!prev): is?

thank you very much in advance.

please excuse me for my not good English.
 
Old 03-26-2009, 11:22 AM   #2
gauravparihar
LQ Newbie
 
Registered: May 2008
Location: India
Distribution: redhat,kubuntu
Posts: 14

Rep: Reputation: 0
I don't know about !prev but what I do know is that this error just hints to you that one has messed up the dynamic allocation and deallocation of memory. It doesn't tell you anything else. I have encountered glibc double free corruption errors numerous times and everytime they are cryptic messages giving absolutely no clue as to where the error originates, which leaves us looking out every line of code to get to the source of error. So my advice is not delve much into what the glibc error says and check your code dealing with dynamic allocation and de-allocation of memory.

--LUCKY
 
Old 03-26-2009, 11:36 AM   #3
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: Debian lenny, Slackware 12
Posts: 805

Rep: Reputation: 161Reputation: 161
This kind of error can be difficult to fix. If you don't find the problem soon, then try electric fence or valgrind.
 
Old 03-26-2009, 09:21 PM   #4
glq2000
LQ Newbie
 
Registered: Mar 2009
Location: china
Distribution: FC
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you two for help! I'll check the code line by line carefully to make sure where I messed up with the memory and try to use valgrind.

If I find the reason why (prev!) happen in my code, I'll post it here.
 
  


Reply

Tags
corruption


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
*** glibc detected *** double free or corruption (!prev): 0x082c1120 *** eXor Slackware 6 04-11-2008 09:47 AM
glibc detected *** double free or corruption (!prev): krishna_162005 Linux - Server 2 06-29-2007 09:26 AM
*** glibc detected *** double free or corruption (!prev): krishna_162005 Linux - Software 0 06-27-2007 04:36 AM
*** glibc detected *** double free or corruption (!prev): krishna_162005 Linux - General 1 06-27-2007 03:43 AM
glibc detected *** double free or corruption (!prev): krishna_162005 Linux - Software 1 06-27-2007 03:42 AM


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

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