From owner-freebsd-current@FreeBSD.ORG Fri Aug 3 11:20:34 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06B61106564A for ; Fri, 3 Aug 2012 11:20:34 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id A6CDE8FC08 for ; Fri, 3 Aug 2012 11:20:33 +0000 (UTC) Received: by vbmv11 with SMTP id v11so655102vbm.13 for ; Fri, 03 Aug 2012 04:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=1QmWz/3SIejdlhydgQXbNGc8KN52p72jaNGd5R9omGc=; b=oTk9vWfPHnQI/SLdbjh9ucMMKjN+D9WUsf/i2Zmc2dfn99PIitI9/dxO3QFrTyKuAS FRZJZvuR4RD8vEig0pZt3YQwTQgaA82ueSyef7Sjk+73Nsz49MskK7B9n0einZMTiDS/ CtqBuhrmQD0Hb2OUXpBkVm73kwOJSi7JoJn2EAtJCQzL909zKJ8dbqDGd/YXns63SDV5 APi7STNp+KNCtvX0uL3qek4TXtZICjibmWo1TGbb7oyRP3AhSm5Ecv9zCIVUYUq3yNIo zPAAPJL8555G7E0rMfpCmts9BauCc6Xa61i19LO88aIE7lFEsqKI6T9VaBDv7/yhOedX +WsA== Received: by 10.52.35.233 with SMTP id l9mr907767vdj.7.1343992832163; Fri, 03 Aug 2012 04:20:32 -0700 (PDT) Received: from kan.dyndns.org (c-24-63-226-98.hsd1.ma.comcast.net. [24.63.226.98]) by mx.google.com with ESMTPS id w11sm8399510vdt.16.2012.08.03.04.20.26 (version=SSLv3 cipher=OTHER); Fri, 03 Aug 2012 04:20:26 -0700 (PDT) Date: Fri, 3 Aug 2012 07:20:12 -0400 From: Alexander Kabaev To: Konstantin Belousov Message-ID: <20120803072012.521631d8@kan.dyndns.org> In-Reply-To: <20120803085937.GJ2676@deviant.kiev.zoral.com.ua> References: <20120802213954.GA34928@troutmask.apl.washington.edu> <20120802215536.027914c9@kan.dyndns.org> <20120803085937.GJ2676@deviant.kiev.zoral.com.ua> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/3CjV3YievG+qzotu5dy+uDe"; protocol="application/pgp-signature" Cc: freebsd-current@freebsd.org, Steve Kargl Subject: Re: rtld dropping core on recent -current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Aug 2012 11:20:34 -0000 --Sig_/3CjV3YievG+qzotu5dy+uDe Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 3 Aug 2012 11:59:37 +0300 Konstantin Belousov wrote: > On Thu, Aug 02, 2012 at 09:55:36PM -0400, Alexander Kabaev wrote: > > It is weird that program tries to dlopen what appears to be the > > binary (itself?), but that did uncover the issue. Please try > > attached patch, I only very lightly tested it here. > >=20 > > Also available here: > > http://people.freebsd.org/~kan/rtld-digest-notes.diff > >=20 > > --=20 > > Alexander Kabaev >=20 > diff --git a/libexec/rtld-elf/map_object.c > b/libexec/rtld-elf/map_object.c index 509a64f..350d437 100644 > --- a/libexec/rtld-elf/map_object.c > +++ b/libexec/rtld-elf/map_object.c > @@ -153,7 +153,6 @@ map_object(int fd, const char *path, const struct > stat *sb) break; > note_start =3D (Elf_Addr)(char *)hdr + phdr->p_offset; > note_end =3D note_start + phdr->p_filesz; > - digest_notes(obj, note_start, note_end); > break; > } > =20 > @@ -292,6 +291,11 @@ map_object(int fd, const char *path, const > struct stat *sb) obj->relro_page =3D obj->relocbase + > trunc_page(relro_page); obj->relro_size =3D round_page(relro_size); > =20 > + if (note_start < note_end) > + { > + digest_notes(obj, note_start, note_end); > + } > + > munmap(hdr, PAGE_SIZE); > return (obj); > =20 > This is the right fix. >=20 > Why do you need the '{}' there ? I do not. I just automatically followed style used at work. I'll FreeBSD-fy this before commit. --=20 Alexander Kabaev --Sig_/3CjV3YievG+qzotu5dy+uDe Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iD8DBQFQG7P5Q6z1jMm+XZYRAn5VAJ9seFpyzjatdHihuZmQETg1QFACoACcCptK jwIta74NVSrBEBCKqRW7d+4= =lxWU -----END PGP SIGNATURE----- --Sig_/3CjV3YievG+qzotu5dy+uDe--