From owner-freebsd-hackers@freebsd.org Fri May 22 07:27:29 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 CC040328F9A for ; Fri, 22 May 2020 07:27:29 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr [80.12.242.128]) (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 49Syk84rjbz3fYB for ; Fri, 22 May 2020 07:27:28 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from garrigue.home ([2.7.113.176]) by mwinf5d41 with ME id hjTS220073oQd2y03jTSR4; Fri, 22 May 2020 09:27:26 +0200 X-ME-Helo: garrigue.home X-ME-Auth: cGpmbG95ZEB3YW5hZG9vLmZy X-ME-Date: Fri, 22 May 2020 09:27:26 +0200 X-ME-IP: 2.7.113.176 From: Paul Floyd Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: SIGBUS si_code 12 Date: Fri, 22 May 2020 09:27:25 +0200 References: <2102917207.11671.1589487524169.JavaMail.www@wwinf1n11> <490544208.11847.1589489181927.JavaMail.www@wwinf1n11> <20200514224347.GB46537@kib.kiev.ua> <9840EA0E-CF11-4332-A5A0-A3CDBA0F0464@wanadoo.fr> <20200521154621.GB85681@raichu> To: FreeBSD Hackers In-Reply-To: <20200521154621.GB85681@raichu> Message-Id: <068F2B99-24C2-4F38-ACC1-02273C198434@wanadoo.fr> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49Syk84rjbz3fYB 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.128) smtp.mailfrom=pjfloyd@wanadoo.fr X-Spamd-Result: default: False [3.92 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[wanadoo.fr]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[wanadoo.fr]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RECEIVED_SPAMHAUS_PBL(0.00)[2.7.113.176:received]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.005]; NEURAL_SPAM_LONG(1.03)[1.026]; RCVD_IN_DNSWL_NONE(0.00)[80.12.242.128:from]; NEURAL_SPAM_SHORT(0.49)[0.491]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:3215, ipnet:80.12.240.0/20, country:FR]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[wanadoo.fr]; RWL_MAILSPIKE_POSSIBLE(0.00)[80.12.242.128:from] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 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: Fri, 22 May 2020 07:27:29 -0000 > On 21 May 2020, at 17:46, Mark Johnston wrote: >>=20 >=20 > Assuming that the context is valgrind, the issue is probably that the > client program is being run with without a NT_FREEBSD_ABI_TAG note, so > the kernel does not have p_osrel defined for the client process and = thus > reverts to the legacy behaviour of delivering SIGBUS with = UCODE_PAGEFLT. > This behaviour is not documented since it is only present for > compatibility with old binaries. >=20 > valgrind should probably embed the NT_FREEBSD_ABI_TAG note from the > target executable into the client process somehow. Hi Mark You assume correctly, this is in the context of running under Valgrind. = It=E2=80=99s one of the regression test suite applications, = memcheck/tests/addressable I hadn=E2=80=99t noticed that the executable was generating SIGSEGV when = running standalone. The test runs a loop 5 fimes, each time round the = loop it forks and the child calls a function that will generate one kind = of SIGBUS or SIGSEGV. The parent just checks that the child died with = one of these signals. I just ran the executable under gdb and I do see = that the error that was posing a problem does generate a SIGSEGV with = si_cde 2. Back in Valgrind, nothing is currently being done with = NT_FREEBSD_ABI_TAG, The only thing that I can see that is of this nature = is the read elf code that is looking for the buildid. I=E2=80=99ll have = a go at seeing if I can read the value of NT_FREEBSD_ABI_TAG, but I=E2=80=99= m not sure what to do with it at the moment. A+ Paul