SIGBUS si_code 12

Mark Johnston markj at freebsd.org
Thu May 21 15:46:27 UTC 2020


On Fri, May 15, 2020 at 08:35:53AM +0200, Paul Floyd wrote:
> 
> 
> > On 15 May 2020, at 00:43, Konstantin Belousov <kostikbel at gmail.com> wrote:
> > 
> >> 
> >> 
> >> So presumably this will go away in 12.2.
> > I do not understand what do you mean.  What should go away ?
> > 
> > Also, T_PAGEFLT value for si_code is a compat value that should be
> > explicitly enabled by user, for compatibility with some really old
> > binaries.
> 
> The undocumented behaviour of having a SIGBUS with an si_code that is normally for SIGSEGV.
> 
> From what I’ve seen BUS_OOMERR will be used instead.

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.

valgrind should probably embed the NT_FREEBSD_ABI_TAG note from the
target executable into the client process somehow.


More information about the freebsd-hackers mailing list