I am currently investigating an issue with our software regarding missing coredumps
Setup: We running a (c++) application (myapp) which is initially started as a subprocess by a python program which is executed as root. The python program however demotes the privileges of the c++ application and runs it as a separate user (myuser) Basically this is done like in Run child processes as different user from a long running Python process
Problem: We monitor this process and recently had a crash where we could figure out that the program abort (SIGABRT) but no corefile was written.
Trying to solve the problem: I looked at Core dump file is not generated and tried to figure out some common problems
$ ulimit -c
unlimited
$ /proc/sys/kernel/core_pattern
/tmp/core%e%t
(or something alike)
Looks good so far - then I checked the problem with setuid mentioned in the other stackoverflow thread
$ cat /proc/sys/fs/suid_dumpable
0
which seems to indicate that this might stop corefiles from being generated. There is also a solution (namely calling prctl). In order to reliably test the problem and see if a solution with calling prctl(PR_SET_DUMPABLE, 1, ...) would work, I first tried to reproduce the problem by manually sending a SIGABRT to the application.
Now the strange thing: After sending the SIGABRT a corefile was generated. So to summarize - corefile generation seems to work in principle - when SIGABRT is sent. - corefile generation does not work always This would mean that the setuid calls from the python script would not in general hinder the corefile generation.
Does anyone have an idea how to go from this point?