Link to home
Start Free TrialLog in
Avatar of minjiezen
minjiezen

asked on

Core dump when calling a library

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.

Avatar of ahoffmann
ahoffmann
Flag of Germany image

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.
ASKER CERTIFIED SOLUTION
Avatar of Duncan Roe
Duncan Roe
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of minjiezen
minjiezen

ASKER

Hello guys, thank you very much for your info!