Solved

Core dump when calling a library

Posted on 2006-06-26
3
574 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 50 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

622 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