Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2020 22:18:44 +0200 (CEST)
From:      Paul FLOYD <pjfloyd@wanadoo.fr>
To:        freebsd-hackers@freebsd.org
Subject:   SIGBUS si_code 12
Message-ID:  <2102917207.11671.1589487524169.JavaMail.www@wwinf1n11>

next in thread | raw e-mail | index | archive | help
Hi
=C2=A0
It seems as though SIGBUS=C2=A0can have an si_code of 12.=20

This isn't documented in the siginfo manpage (https://www.freebsd.org/cgi/m=
an.cgi?query=3Dsiginfo&apropos=3D0&sektion=3D3&manpath=3DFreeBSD+12.1-
RELEASE+and+Ports&arch=3Ddefault&format=3Dhtml). 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 =3D=3D SIGSEGV) {
ucode =3D SEGV_MAPERR;
} else if (prot_fault_translation =3D=3D 0) {
/*
* Autodetect. This check also covers
* the images without the ABI-tag ELF
* note.
*/
if (SV_CURPROC_ABI() =3D=3D SV_ABI_FREEBSD &&
p->p_osrel >=3D P_OSREL_SIGSEGV) {
signo =3D SIGSEGV;
ucode =3D SEGV_ACCERR;
} else {
signo =3D SIGBUS;
ucode =3D T_PAGEFLT;
}
} else if (prot_fault_translation =3D=3D 1) {
/*
* Always compat mode.
*/
signo =3D SIGBUS;
ucode =3D T_PAGEFLT;
}

A+
Paul



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2102917207.11671.1589487524169.JavaMail.www>