Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2012 21:55:36 -0400
From:      Alexander Kabaev <kabaev@gmail.com>
To:        Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc:        freebsd-current@freebsd.org, kib@freebsd.org
Subject:   Re: rtld dropping core on recent -current
Message-ID:  <20120802215536.027914c9@kan.dyndns.org>
In-Reply-To: <20120802213954.GA34928@troutmask.apl.washington.edu>
References:  <20120802213954.GA34928@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <sgk@troutmask.apl.washington.edu> 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--



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