SIGBUS si_code 12
Konstantin Belousov
kostikbel at gmail.com
Sun May 24 09:42:38 UTC 2020
On Sun, May 24, 2020 at 11:24:40AM +0200, Paul FLOYD wrote:
>
>
>
> > > And which files/functions do that?
> > ELF image activator.
>
> > Look in kern/imgact_elf.c. It is basically in check_note, used from
> > get_brandinfo. The real function names are mangled for co-existence
> > of 32 and 64 bit elf activators.
>
> That's quite interesting. If I run procstat -b on a running Valgrind instance I see
>
>
> aulf> procstat -b 2072
> PID COMM OSREL PATH
> 2072 memcheck-amd64-free 0 /usr/home/paulf/scratch/valgrind/memcheck/memcheck-amd64-freebsd
>
> A quick recap of Valgrind execution
>
> 'valgrind' itself is just a small stub executable that looks at the guest executable to determine if it is amd64 or x86. It will then do an execve of the required tool e.g., memcheck-amd64-freebsd.
> The tools themselves are entirely standalone and do not link with any libraries, not even libc.
>
> Is there a way to get the linker to add a .note section with osrel?
Look at lib/csu/common/crtbrand.c
>
> If not, is there a way to set osrel after a process has started?
sysctl kern.proc.KERN_PROC_OSREL.<pid>
More information about the freebsd-hackers
mailing list