tags:

views:

83

answers:

3

Hello,

I try to get a coredump, so i use :

ulimit -c unlimited

I run my program in background, and I kill it :

kill -SEGV %1

But i just get :

[1]+  Exit 1                  ./Test

And no coredumps are created. I did the same with other programs and it works, so why that didn't work with all ? Anybody can help me ?

Thanks. (GNU/Linux, Debian 2.6.26)

+1  A: 

If your program traps the SEGV signal and does something else, it won't invoke the OS core dump routine. Check that it doesn't do that.

Under Linux, processes which change their user ID using setuid, seteuid or some other parameters get excluded from dumping core for security reasons (Think: /bin/passwd dumps core while reading /etc/shadow into memory)

You can re-enable dumping core on Linux programs which change their user ID by calling prctl() after the change of UID

MarkR
A: 

Also you might want to check that the program you're running is not changing its working directory ( chdir() ), because then it will create the core file in a different directory than the one you're running it from.

And you can try this too:

kill -ABRT pid 
Unknown
A: 

Try (as root):

sysctl kernel.core_pattern=core

and then repeat your experiment. On some systems that variable is set to /dev/null by default.

However, if you see exit status 1, perhaps the program indeed intercepts the signal.

Roman Cheplyaka