SIGBUS si_code 12
Paul Floyd
pjfloyd at wanadoo.fr
Fri May 22 15:32:42 UTC 2020
A bit more on this.
The code in question is in trap.c:
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;
} else {
/*
* Always SIGSEGV mode.
*/
signo = SIGSEGV;
ucode = SEGV_ACCERR;
}
I have machte.prot_fault_translation set to 0 (the default I believe) so this enters the first ‘else if’ branch.
The value of p_osrel looks like it comes from retold.c. I see two mechanisms - passed via auxv AT_OSRELDATE (with a backup of using a sysctl) and reading the NT_FREEBSD_ABI_TAG note - I’m not sure which is used in this case.
The auxv value seems to be sent and I can’t see why either should be failing.
A+
Paul
More information about the freebsd-hackers
mailing list