From owner-freebsd-hackers@freebsd.org Sun May 24 09:24:44 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 509742FFEAF for ; Sun, 24 May 2020 09:24:44 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from smtp.smtpout.orange.fr (smtp03.smtpout.orange.fr [80.12.242.125]) (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 49VFDV5GX4z4d8m for ; Sun, 24 May 2020 09:24:42 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from wwinf1c21 ([10.223.79.45]) by mwinf5d58 with ME id iZQg220050yfVCi03ZQgrn; Sun, 24 May 2020 11:24:40 +0200 X-ME-Helo: wwinf1c21 X-ME-Auth: cGpmbG95ZEB3YW5hZG9vLmZy X-ME-Date: Sun, 24 May 2020 11:24:40 +0200 X-ME-IP: 2.7.113.176 Date: Sun, 24 May 2020 11:24:40 +0200 (CEST) From: Paul FLOYD Reply-To: Paul FLOYD To: FreeBSD Hackers Message-ID: <816299859.1977.1590312280071.JavaMail.www@wwinf1c21> In-Reply-To: <20200522201251.GM64045@kib.kiev.ua> 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> <068F2B99-24C2-4F38-ACC1-02273C198434@wanadoo.fr> <679A6BE4-E344-49D0-B76D-DB65A41E26FA@wanadoo.fr> <20200522192804.GL64045@kib.kiev.ua> <20200522201251.GM64045@kib.kiev.ua> Subject: Re: SIGBUS si_code 12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [2.7.113.176] X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| X-Rspamd-Queue-Id: 49VFDV5GX4z4d8m 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.125) smtp.mailfrom=pjfloyd@wanadoo.fr X-Spamd-Result: default: False [3.95 / 15.00]; HAS_REPLYTO(0.00)[pjfloyd@wanadoo.fr]; HAS_XOIP(0.00)[]; FREEMAIL_FROM(0.00)[wanadoo.fr]; TO_DN_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:3215, ipnet:80.12.240.0/20, country:FR]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[wanadoo.fr]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.53)[0.531]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[wanadoo.fr]; DMARC_NA(0.00)[wanadoo.fr]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; NEURAL_SPAM_LONG(1.02)[1.018]; RCVD_IN_DNSWL_NONE(0.00)[80.12.242.125:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[80.12.242.125:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2] 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: Sun, 24 May 2020 09:24:44 -0000 =C2=A0 =C2=A0 =C2=A0 > > 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 instan= ce I see =C2=A0 aulf> procstat -b 2072 PID COMM OSREL PATH 2072 memcheck-amd64-free 0 /usr/home/paulf/scratch/valgrind/memcheck/memche= ck-amd64-freebsd A quick recap of Valgrind execution 'valgrind' itself is just a small stub executable that looks at the guest e= xecutable to determine if it is amd64 or x86. It will then do an execve of = the required tool e.g., memcheck-amd64-freebsd.=20 The tools themselves are entirely standalone and do not link with any libra= ries, not even libc. Is there a way to get the linker to add a .note section with osrel? If not, is there a way to set osrel after a process has started? A+ Paul