Re: proc stat file status info on dumping core

Rohith M
Occasional Contributor

proc stat file status info on dumping core

While dumping core, OS sets status of proc stat file to "200 dumping core". My queires are:
1. Who sets this status ?
2. When is this status set ?
3. What actions are done on setting this status?
4. When will it start to dump core ? Immediate or after certain actions?
5. Is any signal sent by the application/proc to the kernel whaen the status is set to "200 dumping core" ? If yes, what is it ? Where is it logged?

My issue : The status of proc stat file is set to "dumping core " but the actual core is dumped after 45 mins. Could you explain the behaviour of why there is a delay in starting the dumping of core?

Thanks and Regards,
Rohith M
Steven E. Protter
Exalted Contributor

Re: proc stat file status info on dumping core

1.) The process doing the dumping, though dumping can be prevented with profile settings.
2.) When the dump begins
3.) Echo to the appropriate location in /proc
4.) Controlled by application, affected by environment and OS settings.
5.) Depends on the application, check /var/log/messages

I can not explain the core issue unless the application is huge and has operations prior to core dump that it does to safeguard data.

Steven E Protter
Owner of ISN Corporation
Rohith M
Occasional Contributor

Re: proc stat file status info on dumping core

Hi, Had a few more doubts on your answers.

1. What are the profile settings which would prevent dumping of core?

2. How is start of core dump affected by application / environment / OS settings? Could you elaborate on this, i.e what environments , what settings ?

Regarding the issue, there is no application code reference to do any action before dumping core. Will not the OS dump core immediately and not wait for response from application ?

Rick Beldin
Esteemed Contributor

Re: proc stat file status info on dumping core

You can prevent a core from being generated by using ulimit. The file /etc/security/limits.h can set this on a system-wide basis. Most Linux systems have ulimit -c 0 which limits core file size to 0. I often want a core file and I work to disable this. In addition, setuid/setgid programs prevent core file creation for security reasons.

Since core files will dump in the current working directory, you could see delays if the filesystem on which you are running is slow.

You could setup condition handlers in your application to handle various conditions and prevent a core from being generated. This works for many signals, but some are not maskable. Alternatively, you could create a core on your own by calling abort() within your program.
Necessary questions: Why? What? How? When?