LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-21-2013, 06:37 AM   #1
vampireixon
LQ Newbie
 
Registered: Oct 2013
Posts: 6

Rep: Reputation: Disabled
Question glibc detected *** double free or corruption


Hello.
I'm new in this Forum. I'm not usually ask to any one to help me. But I'm trying to solve this problem for a week, and I've could not solve it.
I don't need someone solve my mistake, I only need to know how to find it.
My project has so many files and so many libraries. So it's not possible to paste here. I've not have idea where is my bug.
I'm programing in C++ using eclipse indigo and compiling with g++.
In runtime I get that error. But the program closes and I cannot backtrace to find who cause that error.
I've tried to use try{} catch{} to try to catch the exception, but it doesn't works. Never catches an exception.
I think the error is inside the VLC library. But if I run that portion of code alone it works fine. So surely I have an overflow on my program causing that problem in VLC library.
Any one knows how to get working try{} catch{}?
Any one knows if it's possible to find the variable causing the problem with the info gave in the error message? (double free or corruption (out): 0x0000000006143d00)
Thanks in advance.
 
Old 10-21-2013, 06:56 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
you can try to use valgrind to catch memory related problems.
 
1 members found this post helpful.
Old 10-21-2013, 06:59 AM   #3
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Try running it through valgrind to get a start:

Code:
valgrind --tool=memcheck binary
 
1 members found this post helpful.
Old 10-21-2013, 11:33 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
I hope that you are using git for version-control, even on "your own personal" project, because this will give you the opportunity to definitively see ... "what changed recently?" And, to see exactly what each and every change consisted of.

Most probably, there's a point in time at which "you thought that the program worked," and another point in time at which "you noticed the bug." Take a look at the most-recent changes.

A few other tips, all of which go back to "coding discipline" ...
  • Always allocate storage blocks with calloc or some other means of initializing every block to known all-zeros.
  • When you deallocate something, immediately in the next statement set all associated pointers to NULL.
  • Write test-scripts to independently exercise all major pieces of the program in isolation to the others. Run these tests all the time to catch regressions.
  • Use debugging-tools that add "eyecatchers" around storage-blocks to detect "off-by-one" overwrites and other similar problems. Consider leaving them in in the production(!) code.
 
1 members found this post helpful.
Old 10-21-2013, 12:02 PM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,869
Blog Entries: 1

Rep: Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870
I like to use Electric Fence in cases like this:

Code:
LDFLAGS=-lefence make all
(or similiar)

under lucky constellations it will stop much earlier -- making debugging easier
 
1 members found this post helpful.
Old 10-21-2013, 01:45 PM   #6
vampireixon
LQ Newbie
 
Registered: Oct 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile Thank you.

Thanks a lot for your quick responses.
They has been very helpfull to me.
Now I'm debugging my program. I'm correcting many mistakes.
It is not 100% corrected but now I'm on the right way.
Thanks again.
 
  


Reply



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 vvenugop Linux - General 0 02-19-2008 09:11 AM
glibc detected *** double free or corruption (!prev): krishna_162005 Linux - Server 2 06-29-2007 08:26 AM
*** glibc detected *** double free or corruption (!prev): krishna_162005 Linux - Software 0 06-27-2007 03:36 AM
*** glibc detected *** double free or corruption (C++) urzumph Programming 25 01-07-2006 04:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration