Thursday, March 27, 2008

crashed core on Ubuntu (found way to obtain it)

Finally, in addition to tools in previous post, I have installed valgrind utility. This tool shows a lot of debug info, and also able to make assumptions about memory leaks. After installing valgrind with apt-get, also libc-dev installed, that, as appeared where not installed, or where accidentally removed. And after reboot, I was able to obtain normal looking core.

But after reload it crashed again.

so finally fixed it this way:


$ ulimit -S -c unlimited

Checked settings in kernel:

$ cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport
$ cat /proc/sys/kernel/core_uses_pid
0


tried to tweak:

$ sudo sysctl -w kernel.core_uses_pid=1
kernel.core_uses_pid = 1
$ sudo sysctl -w kernel.core_pattern=/tmp/
kernel.core_pattern = ./core
$ vi testcore.sh
#!/bin/bash
kill -s SIGSEGV $PID
:q

~$ chmod a+x testcore.sh
~$ ./testcore.sh
Segmentation fault (core dumped)
~$ ls
..
core.5568
..



Ok, we have our core.

Also we can turn off apport persistant:

$ sudo vi default/apport
enable=0

No comments: