SIGBUS si_code 12

Paul FLOYD pjfloyd at wanadoo.fr
Thu May 14 20:18:51 UTC 2020


Hi
 
It seems as though SIGBUS can have an si_code of 12. 

This isn't documented in the siginfo manpage (https://www.freebsd.org/cgi/man.cgi?query=siginfo&apropos=0&sektion=3&manpath=FreeBSD+12.1-
RELEASE+and+Ports&arch=default&format=html). which only covers these 3 values for si_code.


SIGBUS BUS_ADRALN invalid address alignment
BUS_ADRERR nonexistent physical address
BUS_OBJERR object-specific hardware error

Is this a defect in the siginfo documentation?


Here's an extract from trap.c that shows this.


if (signo == SIGSEGV) {
ucode = SEGV_MAPERR;
} else if (prot_fault_translation == 0) {
/*
* Autodetect. This check also covers
* the images without the ABI-tag ELF
* note.
*/
if (SV_CURPROC_ABI() == SV_ABI_FREEBSD &&
p->p_osrel >= P_OSREL_SIGSEGV) {
signo = SIGSEGV;
ucode = SEGV_ACCERR;
} else {
signo = SIGBUS;
ucode = T_PAGEFLT;
}
} else if (prot_fault_translation == 1) {
/*
* Always compat mode.
*/
signo = SIGBUS;
ucode = T_PAGEFLT;
}

A+
Paul


More information about the freebsd-hackers mailing list