probably accessing a uninitialized pointer
you could, for instance, obtain such an error with
|
Source code
|
1
2
3
|
int * a = NULL;
// ...
*a = 0;
|
or
|
Source code
|
1
2
3
4
5
|
int * a = new int;
// ...
delete a;
// ...
*a = 0;
|
or
|
Source code
|
1
2
3
|
int * a = new int [10];
// ...
a[12] = 0;
|
or ... many other erronous code
compile with debug
verify a core file is generated
if not, parameter your Linux (I don't remember exactly where)
- /etc/sysctl.conf
kernel.core_pattern
kernel.core_uses_pid
- ~/.bashrc
ulimit -c unlimited
rerun
after crash run: kdbg|gdb yourApp generatedCoreFile
you will obtain a call stack, be abble to move in this call stack and to examine variables at crash time
This post has been edited 5 times, last edit by "Nicolas SOUCHON" (May 12th 2008, 11:49am)