[Gllug] handling core files on linux

Nix nix at esperi.org.uk
Sat Feb 26 18:40:02 UTC 2005


On Fri, 25 Feb 2005, Ben Fitzgerald announced authoritatively:
> Hi,
> 
> I'd like to ask how others deal with core files.
> 
> My understanding is that /proc/sys/kernel/core_pattern is the
> one place to set core filename patterns. When an application
> terminates abnormally, if the session that began the process
> has a core limit set to 'unlimited', the kernel will dump the
> core file to core_pattern.

Well, to one or more files named in accordance with that pattern, sure.

>                            I guess this is because the kernel
> handles the abnormal termination, so local variable are out
> the window by this stage.

Out the window? What do you imagine a core file *is*? The local
variables are still there --- although the only things which can
reasonably interpret them are the program (dead) and a debugger...

> dodgyexec aborts and a core file is written to
> /cores/user1/dodgyexec.1234
> 
> is there any way to alter, on a per user basis, where a core
> file gets dumped to?

Yes: in the pattern, %u is uid and %g is gid.

> granted by setting /cores to root:root 755 I can limit who can
> write cores to /cores/%u/ by creating or not creating directories
> for each user.

It looks to be the same under Linux 2.6.x: see fs/exec.c.

-- 
> ...Hires Root Beer...
What we need these days is a stable, fast, anti-aliased root beer
with dynamic shading. Not that you can let just anybody have root.
 --- John M. Ford
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list