LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
Search this Thread
Old 02-06-2011, 12:35 AM   #1
default5
LQ Newbie
 
Registered: Feb 2008
Distribution: Fedora
Posts: 18

Rep: Reputation: 0
glibc detected corruption errors


This is weird. So, I started getting an error message from a qt application I wanted to add a new feature to. The error is: *** glibc detected *** ./myprogram: double free or corruption (!prev): 0x08df0148 ***
A quick hit on google revealed what I thought would normally be the cause, a bad free(). Now, I had upgraded my harddrive to an ssd recently and the code was just copied over from the old hdd, so I thought maybe there was something wrong with my build environment. After a bit of searching, I couldn't find anything. I think I used the same parameters to recompile it and my environmental variables seem to be good.I finally just plugged in the old drive and ran the unmodified, untouched program off of that one. Same error. Now I didn't remember getting that error the last time, so I rebooted into the old drive and ran it. No errors. And then I ran my newly-compiled, fresh-off-the-ssd version and it worked perfectly. Very weird.

If anyone knows what might be causing this, any help would be appreciated. Also, both are running Fedora 13 with 686 PAE kernels and the program in question is a C++ qt app which appears to be generating these errors from a call to QSqlQuery::exec().

Thanks.
 
Old 02-06-2011, 10:53 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
That error means your program called free twice on the same pointer, which might not always happen since Qt applications take different courses depending on how you interact with them. There are three things that will help:
  1. Try to track all of your new or malloc pointers in the source code to see if they might be freed twice in some cases
  2. Compile with debug symbols and run your program with gdb until you get this error, then run a stack backtrace
  3. Run your program with valgrind to look for allocation-related problems at runtime (you might do this in conjunction with gdb)
Kevin Barry

Last edited by ta0kira; 02-06-2011 at 10:55 PM.
 
  


Reply

Tags
c++, fedora, glibc, qt


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
*** glibc detected ***: malloc() memory corruption Dinarchik Programming 5 02-16-2010 05:38 PM
*** glibc detected *** double free or corruption vvenugop Linux - General 0 02-19-2008 09:11 AM
*** glibc detected *** malloc(): memory corruption arvind.ayyangar Programming 2 11-20-2006 11:59 PM
*** glibc detected *** double free or corruption (C++) urzumph Programming 25 01-07-2006 04:03 PM
glibc detected ; memory corruption pingu Linux - Software 3 10-12-2005 01:29 AM


All times are GMT -5. The time now is 02:44 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 Google+: linuxquestions
Open Source Consulting | Domain Registration