C++ **glibc detected** ./a.out: munmap_chunk:invalid pointer
after giving the desired output ,above mentioned error comes with backtrace and memory map.
I use fedora 12. |
I just copied your subject line into google and got about 3,070 hits. It seems others have had that particular crash before . . .
|
And we might be able to spot the problem slightly more easily if you gave us a (preferably small) sample of code which shows the problem :) and from the google hits, it seems likely that something is writing to memory it shouldn't be...
|
Quote:
It appears that the bug is detected while the program is releasing resources after it has already produced its desired output. That doesn't mean the bug occurred at that point. Most likely the bug occurred significantly before the point at which it was detected. Quote:
Unfortunately, the OP is not likely to find his bug by searching and reading other posts about other programmers whose different bugs produced the same error message. Quote:
If the code is too large for the OP to post the whole thing, it is unlikely that the OP would guess the right portion to post to let us deduce the bug. A very skilled programmer working on a much more difficult problem often can experimentally cut sections out of a program until a much smaller program shows the same symptom. That would be a good strategy if you actually thought a glibc or Linux bug was behind the symptom. That isn't a great strategy for a beginner looking for an easy bug, because it would be far more work than finding the bug ought to be. Quote:
The most common and simplest bug with this symptom is writing past the end of an array allocated with malloc (or with new in C++). But after that common one, there are countless less common ones that taken together are more likely. So we can't really guess the bug without seeing it. |
Quote:
|
All times are GMT -5. The time now is 03:17 PM. |