Page MenuHomeFreeBSD

Adds signal number format to kern.corefile
ClosedPublic

Authored by leimy2k_gmail.com on Jul 16 2019, 3:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 5, 9:28 PM
Unknown Object (File)
Jan 6 2024, 10:17 PM
Unknown Object (File)
Nov 21 2023, 7:30 PM
Unknown Object (File)
Nov 9 2023, 11:46 PM
Unknown Object (File)
Oct 8 2023, 10:39 PM
Unknown Object (File)
Sep 2 2023, 4:47 AM
Unknown Object (File)
Sep 2 2023, 4:45 AM
Unknown Object (File)
Sep 2 2023, 4:45 AM
Subscribers

Details

Summary

Add format capability to core file names to include signal
that generated the core. This can help various validation workflows
where all cores should not be considered equally (SIGQUIT is often
intentional and not an error unlike SIGSEGV or SIGBUS)

Submitted By: David Leimbach (leimy2k@gmail.com)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I realize procstat can list out the signal from a core file using ELF hints, but some workflows where I work use compressed corefiles, and the work to decompress them vs scanning the filename is obviously a lot more.

Did some basic testing with the following code.

#include <sys/types.h>
#include <signal.h>
#include <unistd.h>

int main () {
    kill(getpid(), 3);
    return 0;
}

And used:

sudo sysctl kern.corefile="%N_sig%S.core"

Ended up with

-rw-------   1 leimy  leimy  8966144 Jul 11 17:45 a.out_sig3.core
markj added inline comments.
sys/kern/kern_sig.c
3488 ↗(On Diff #59808)

This case should be sorted before 'U'.

This revision is now accepted and ready to land.Jul 16 2019, 3:15 PM
vangyzen added inline comments.
sys/kern/kern_sig.c
3488 ↗(On Diff #59808)

In the man page, too.

This revision now requires review to proceed.Jul 16 2019, 3:20 PM
leimy2k_gmail.com marked an inline comment as done.

Make man page sort order match code sort order.

Fixed up the sort order per review feedback.

This revision is now accepted and ready to land.Jul 16 2019, 3:25 PM
This revision was automatically updated to reflect the committed changes.