[vox-tech] core files

Ken Bloom vox-tech@lists.lugod.org
Sun, 15 Feb 2004 19:01:02 -0800


On 2004.02.15 17:57, Peter Jay Salzman wrote:
> On Sun 15 Feb 04,  5:53 PM, mrp <mrp@sonic.net> said:
> > On Sun, Feb 15, 2004 at 05:38:47PM -0800, Peter Jay Salzman wrote:
> > > I've noticed some core files have a number appended to them, like:
> > > 
> > >    core.2342
> > > 
> > > The number is most likely a pid, but I'm curious how the core file got
> > > named this way.  Is there a libc function that sets the name of a
> > > possible future core file?
> > 
> > I think it's probably a function of the default signal handler for 
> > the SIGABORT signal.
> 
> i've used abort() tonight in one of my programs and it just gave a file
> named "core".
> 
> > I don't know why it would use "core" sometimes and 
> > "core.<pid>" other times.. maybe if there is already a core file it uses
> > the second form instead to avoid overwriting an existing core file.
> 
> can't be this.  i've had MANY core files written in my life.  ;-)  core
> files are just overwritten, not renamed (permission granting).
> 
> i've noticed that whenever opera dumps core, the corefile always has the
> number in its name.  that's kind of why i figured it might be a libc
> thing that you can control.

http://www.talkaboutprogramming.com/group/comp.programming.threads/messages/40834.html

This appears to be the default behavior for multithreaded programs

I also found a file /proc/sys/kernel/core_uses_pid that can make this the default for single-threaded programs by echo 1 > /proc/sys/kernel/core_uses_pid 


-- 
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.
My key was last signed 10/14/2003. If you use GPG *please* see me about 
signing the key. ***** My computer can't give you viruses by email. ***