From owner-freebsd-current@FreeBSD.ORG Fri Aug 3 08:59:50 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA7231065670 for ; Fri, 3 Aug 2012 08:59:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 2AF9D8FC08 for ; Fri, 3 Aug 2012 08:59:49 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q738xolY074704; Fri, 3 Aug 2012 11:59:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q738xbVA089198; Fri, 3 Aug 2012 11:59:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q738xbE9089197; Fri, 3 Aug 2012 11:59:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 3 Aug 2012 11:59:37 +0300 From: Konstantin Belousov To: Alexander Kabaev Message-ID: <20120803085937.GJ2676@deviant.kiev.zoral.com.ua> References: <20120802213954.GA34928@troutmask.apl.washington.edu> <20120802215536.027914c9@kan.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="I9F9dHb6y8qwQWx+" Content-Disposition: inline In-Reply-To: <20120802215536.027914c9@kan.dyndns.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua 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 08:59:50 -0000 --I9F9dHb6y8qwQWx+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 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. Why do you need the '{}' there ? --I9F9dHb6y8qwQWx+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAbkvkACgkQC3+MBN1Mb4gPFQCgo6iYJoBRTLpyR5SLhADUOz3e ItkAnA61BcRblEy1vQ6DIs7ARb+9jlxP =GpIa -----END PGP SIGNATURE----- --I9F9dHb6y8qwQWx+--