Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2020 12:42:22 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Paul FLOYD <pjfloyd@wanadoo.fr>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: SIGBUS si_code 12
Message-ID:  <20200524094222.GQ64045@kib.kiev.ua>
In-Reply-To: <816299859.1977.1590312280071.JavaMail.www@wwinf1c21>
References:  <490544208.11847.1589489181927.JavaMail.www@wwinf1n11> <20200514224347.GB46537@kib.kiev.ua> <9840EA0E-CF11-4332-A5A0-A3CDBA0F0464@wanadoo.fr> <20200521154621.GB85681@raichu> <068F2B99-24C2-4F38-ACC1-02273C198434@wanadoo.fr> <679A6BE4-E344-49D0-B76D-DB65A41E26FA@wanadoo.fr> <20200522192804.GL64045@kib.kiev.ua> <D22F2087-4FB3-4EB5-841E-61C809DF94F0@wanadoo.fr> <20200522201251.GM64045@kib.kiev.ua> <816299859.1977.1590312280071.JavaMail.www@wwinf1c21>

next in thread | previous in thread | raw e-mail | index | archive | help
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>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200524094222.GQ64045>