coredumps [Was: Re: [bf1942] Map Crashing still on 1.45 ob2]
Fritz Elfert
felfert at to.com
Tue Sep 9 16:49:11 EDT 2003
A program never dumps core itself. It's the kernel which does it on behalf
of the program.
For Linux (kernel-2.4):
Have look in the kernel src at fs/process.c, function do_coredump()
and fs/binfmt_elf.c, function core_dump(). In do_coredump() you can
see, that if the file could not be created, is not writable, not
a regular file or has more than 1 link, it's bailing out. The name
is formatted by using the pattern, given in /proc/sys/kernel/core_pattern
(default: "core"). There are two procfs entries named
/proc/sys/kernel/core_pattern (a string, defining the basename)
and /proc/sys/kernel/core_uses_pid (numeric, deprecated, if !0 the PID
is appended to the name). I could imagine, if somebody writes something
stupid into /proc/sys/kernel/core_pattern (e.g. a . (dot)), the file could
not be created and the dump fails. Never tested it though ...
Some other Unix systems (don't know, if *BSD is among them):
core-dumps are not permitted, if the faulty process runs in root context.
(For security reasons). But it's not very wise to run BF as root anyway
:-) (At least not without a chroot jail)
Ciao
-Fritz
On Tue, 9 Sep 2003, ScratchMonkey wrote:
> --On Tuesday, September 09, 2003 9:27 AM -0700 James Gurney
> <james at globalmegacorp.org> wrote:
>
> > Incidentally, I've been seeing crashing on map change which simply
> > doesn't create a core file.
>
> Assuming ulimit is set to allow core files, does anyone know what would
> prevent a program from dumping one? I'm just looking for a more general
> understanding of the mechanism. A link to some kind of backgrounder would
> be fine.
>
--
Fritz Elfert <felfert at to.com> Thinking Objects Software GmbH
Lilienthalstr. 2 Phone: +49 711 88770 400
70825 Stuttgart FAX: +49 711 88770 449
--------------------------------------------------------------------------
More information about the Bf1942
mailing list