I am not getting a coredump with the whole process

I am trying to get a coredump, so I am using:

ulimit -c unlimited

      

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

kill -SEGV %1

      

But I just get:

[1]+  Exit 1                  ./Test

      

And no releases are created. I have done the same with other programs and it works, so why doesn't it work with everyone? Can anyone help me?

Thanks. (GNU / Linux, Debian 2.6.26)

+2


a source to share


3 answers


If your program intercepts the SEGV signal and does something else, it will not call the OS kernel reset routine. Make sure he doesn't.

On Linux, processes that change their user ID using setuid, seteuid or some other parameter are excluded from the reset base for security reasons (Think: / bin / passwd flushes the kernel when reading / etc / shadow into memory)



You can re-enable kernel dumping in Linux programs that change their user ID by calling prctl () after the UID has changed

+2


a source


Also you can check that the running program does not change the working directory (chdir ()), because then it will create the main file in a different directory than the one from which you start it.

And you can try too:



kill -ABRT pid 

      

0


a source


Try (as root):

sysctl kernel.core_pattern=core

      

and then repeat the experiment. On some systems, this variable is set /dev/null

to default.

However, if you see exit status 1, the program might actually be catching the signal.

0


a source







All Articles