setting distinct core file names

Lowell Gilbert freebsd-lists at be-well.ilk.org
Tue Nov 27 18:37:41 UTC 2018


Willem Jan Withagen <wjw at digiware.nl> writes:

> Looking at core(5) and sysctl it looks like these are system wide
> settings....
>
> Is there a possibility that a program can set its own corefile name
> (and path?)
>
> During parallel testing I'm running into these scripts that generate
> cores, but they end up all in the same location. But it would be nice
> if I could one way or another determine which file came from what
> script.
>
> But for that I would need to be able to set something like
> 	%N."script".core
> as the core name. I could then put that in then ENV of the script and
> the program would pick it up and set its own corefile name.
>
> Possible??

If you can run the scripts in arbitrary paths, you can encode any extra
information you need in a directory name. [I'd recommend just changing
the process name, but I'm guessing that the cores themselves are being
generated by something running in a subshell.]


More information about the freebsd-hackers mailing list