Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 May 2020 09:27:25 +0200
From:      Paul Floyd <pjfloyd@wanadoo.fr>
To:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: SIGBUS si_code 12
Message-ID:  <068F2B99-24C2-4F38-ACC1-02273C198434@wanadoo.fr>
In-Reply-To: <20200521154621.GB85681@raichu>
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>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 21 May 2020, at 17:46, Mark Johnston <markj@freebsd.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?068F2B99-24C2-4F38-ACC1-02273C198434>