From owner-freebsd-hackers@freebsd.org Thu May 14 20:18:51 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 370262DDEE2 for ; Thu, 14 May 2020 20:18:51 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr [80.12.242.131]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NNCr3919z3N05 for ; Thu, 14 May 2020 20:18:47 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from wwinf1n11 ([10.223.72.54]) by mwinf5d17 with ME id ekJk220021AGQpE03kJkn1; Thu, 14 May 2020 22:18:44 +0200 X-ME-Helo: wwinf1n11 X-ME-Auth: cGpmbG95ZEB3YW5hZG9vLmZy X-ME-Date: Thu, 14 May 2020 22:18:44 +0200 X-ME-IP: 2.7.113.176 Date: Thu, 14 May 2020 22:18:44 +0200 (CEST) From: Paul FLOYD Reply-To: Paul FLOYD To: freebsd-hackers@freebsd.org Message-ID: <2102917207.11671.1589487524169.JavaMail.www@wwinf1n11> Subject: SIGBUS si_code 12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [2.7.113.176] X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| X-Rspamd-Queue-Id: 49NNCr3919z3N05 X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pjfloyd@wanadoo.fr has no SPF policy when checking 80.12.242.131) smtp.mailfrom=pjfloyd@wanadoo.fr X-Spamd-Result: default: False [3.39 / 15.00]; HAS_REPLYTO(0.00)[pjfloyd@wanadoo.fr]; HAS_XOIP(0.00)[]; FREEMAIL_FROM(0.00)[wanadoo.fr]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:3215, ipnet:80.12.240.0/20, country:FR]; IP_SCORE(0.00)[ip: (2.68), ipnet: 80.12.240.0/20(1.72), asn: 3215(2.40), country: FR(-0.00)]; FREEMAIL_ENVFROM(0.00)[wanadoo.fr]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[wanadoo.fr]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.99)[0.987,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE_FREEMAIL(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_SPAM_LONG(1.00)[1.000,0]; RCVD_IN_DNSWL_NONE(0.00)[131.242.12.80.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; DMARC_NA(0.00)[wanadoo.fr]; RWL_MAILSPIKE_POSSIBLE(0.00)[131.242.12.80.rep.mailspike.net : 127.0.0.17]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 20:18:51 -0000 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