From owner-freebsd-current@FreeBSD.ORG Fri Aug 3 01:55:54 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 97E31106566C; Fri, 3 Aug 2012 01:55:54 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 19C588FC08; Fri, 3 Aug 2012 01:55:53 +0000 (UTC) Received: by vcbgb22 with SMTP id gb22so210390vcb.13 for ; Thu, 02 Aug 2012 18:55:52 -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=FHFdAhmp1u7u3GBV7BKV4jPi/+AHUEp27RisJaooGbg=; b=sT2g8gOGaIPpP659dIyp8WDGRQMkaD4o1tD4XtbWTBC/agwavSNjpPmv8yIyEXBT1d gQ99GuS1caNunu7khmhRizPmMtY8762qthHFORIudZe5W7ChEzuQCxQ9PtNc7srTjuF5 OceYAqn/bts9w8Y3hbGDpasbfMvjXi2/PNgBO0xUP27fuVi6ioQ113tFJ7OCX8XRwR9Q g8/ljPVpJ7o6hg9ykb4CCUuxSeyIi4OaIitV8vNqmFL7MvhFOGwabs62TnQ8tOf6I4d9 vCu1NoHqMTfOryzira3Qdr7rsndinnG3SEwHz54By6nI9ASXBGEusuRb7ywJeqNP5cku N8bA== Received: by 10.52.30.168 with SMTP id t8mr50780vdh.45.1343958952557; Thu, 02 Aug 2012 18:55:52 -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 cz2sm7525734vdb.3.2012.08.02.18.55.42 (version=SSLv3 cipher=OTHER); Thu, 02 Aug 2012 18:55:42 -0700 (PDT) Date: Thu, 2 Aug 2012 21:55:36 -0400 From: Alexander Kabaev To: Steve Kargl Message-ID: <20120802215536.027914c9@kan.dyndns.org> In-Reply-To: <20120802213954.GA34928@troutmask.apl.washington.edu> References: <20120802213954.GA34928@troutmask.apl.washington.edu> 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_/OAEWdHNI6dfDGCzj5mra2+V"; protocol="application/pgp-signature" Cc: freebsd-current@freebsd.org, kib@freebsd.org 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 01:55:54 -0000 --Sig_/OAEWdHNI6dfDGCzj5mra2+V Content-Type: multipart/mixed; boundary="MP_/wtv/1FQa_M+lhEdRiKm_GCE" --MP_/wtv/1FQa_M+lhEdRiKm_GCE Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu, 2 Aug 2012 14:39:54 -0700 Steve Kargl wrote: > % file /usr/local/bin/ppdpo > /usr/local/bin/ppdpo: ELF 32-bit LSB shared object, Intel 80386, \ > version 1 (FreeBSD), dynamically linked (uses shared libs), > FreeBSD-style,\ for FreeBSD 10.0 (1000015), stripped >=20 > % ldd /usr/local/bin/ppdpo > /usr/local/bin/ppdpo: > /usr/local/bin/ppdpo: signal 11 >=20 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. Also available here: http://people.freebsd.org/~kan/rtld-digest-notes.diff --=20 Alexander Kabaev --MP_/wtv/1FQa_M+lhEdRiKm_GCE Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=rtld-digest-notes.diff 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 --MP_/wtv/1FQa_M+lhEdRiKm_GCE-- --Sig_/OAEWdHNI6dfDGCzj5mra2+V Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iD8DBQFQGy+dQ6z1jMm+XZYRAjVaAKCWwtCOiHermM7XJlBc3XWenaTC1wCfXyrI 5uZSQO6rlUwq2TJvgJszIAA= =e8ql -----END PGP SIGNATURE----- --Sig_/OAEWdHNI6dfDGCzj5mra2+V--