Google Answers Logo
View Question
 
Q: My C++ program hangs in malloc_consolidate () ( No Answer,   1 Comment )
Question  
Subject: My C++ program hangs in malloc_consolidate ()
Category: Computers > Programming
Asked by: zoomlens-ga
List Price: $2.00
Posted: 12 Oct 2004 10:13 PDT
Expires: 11 Nov 2004 09:13 PST
Question ID: 413724
My C++ program hangs in malloc_consolidate (). Why? Following is the stack trace
It is running on SuSE linux, kernel 2.6.5-7.108-default. How can I fix it?
(gdb) where
#0  0x403f76a2 in malloc_consolidate () from /lib/i686/libc.so.6

Request for Question Clarification by maniac-ga on 12 Oct 2004 17:02 PDT
Hello Zoomlens,

There is [was?] a problem in malloc if you do a double free that can cause:
 - 100% CPU usage in malloc_consolidate()
 - segmentation violation
Your symptom may be the first case. For reference, see:
  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=127247
for an explanation of a similar problem in Red Hat Linux. A more
complete list of possible problems is at
https://bugzilla.redhat.com/bugzilla/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc=malloc_consolidate&Search=Search

If this is your application, try linking with dmalloc
  http://dmalloc.com/
which allows you to trap such types of problems (as well as many
others) and either stop the application or continue.

I can't be sure this will fix your specific problem - if it does,
please make a question clarification so I can post a more complete
answer. If not, you may need to post source code that reproduces the
problem for a more specific answer.

  --Maniac

Request for Question Clarification by maniac-ga on 19 Oct 2004 16:14 PDT
Hello Zoomlens,

Are you still looking for an answer?

I suggest either making a question clarification or closing the question. 

  --Maniac
Answer  
There is no answer at this time.

Comments  
Subject: Re: My C++ program hangs in malloc_consolidate ()
From: padmapani-ga on 12 Oct 2004 11:51 PDT
 
Only one line of where is not usually enough.Please try running
"strace" on your program.Now that being said the error you posted
tells me that it is your C++ program that would need a second look for
areas of memory corruption.Basically what happened was that one of the
internal malloc data structures got mangled.

Try compiling the program with "-lc" which links the standard C
library and makes sure that no other shared library overrides it.This
way we know where is the problem.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy