Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Core dump when calling a library

Posted on 2006-06-26
3
Medium Priority
?
578 Views
Last Modified: 2012-06-27
Hello,

I keep getting a core dump when running a C++ application on Linux. Here is part of the result upon checking the core file:

gdb someapp core.1234
GNU gdb 6.0-2mdk (Mandrake Linux)
.....
Core was generated by `/home/someone/someapp'.
Program terminated with signal 11, Segmentation fault.
......
(gdb) bt
#0  0x40bfeee1 in posix_memalign () from /lib/tls/libc.so.6
#1  0x40bfc777 in mallopt () from /lib/tls/libc.so.6
#2  0x40bfb9be in calloc () from /lib/tls/libc.so.6
#3  0x4050ad05 in QImage::setNumColors(int) () from /usr/lib/qt3/lib/libqt-mt.so.3
#4  0x00000400 in ?? ()
#5  0x00000001 in ?? ()

What do frames #4 & #5 really mean? The memory is corrupted? Because when I ran:
(gdb) x 0x00000400
I got:
0x400:  Cannot access memory at address 0x400

What might have caused the core dump? Can anyone shed some light on this? Thanks.

0
Comment
Question by:minjiezen
3 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16990138
there is a function (probably QImage::setNumColors(int)) which write to an address which is invalid, either 'cause it gets a wrong pointer to it, or 'cause the data written was to large.
0
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 200 total points
ID: 16990680
You have trashed the arena (i.e. you have written off the end or start of an area of memory obtained with calloc / malloc. Or you may ahve called free() on a poiter that was not obtained from the first 2 functions. Or written to memory after it was freed.
The problem is quite likely not with the library - programs can often carry on for a while after the arena has been corrupted.
Problems like this can be a little awkward to find - there are free tools like Electric Fence http://freshmeat.net/redir/efence/2277/url_homepage/efence.php or I myself use the memory debug package from tcl - but that requires one to recompile everything. There are non-free tools too, like IBM/Rational (it's very good).
0
 

Author Comment

by:minjiezen
ID: 16995201
Hello guys, thank you very much for your info!
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question