Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Aug 2012 07:20:12 -0400
From:      Alexander Kabaev <kabaev@gmail.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-current@freebsd.org, Steve Kargl <sgk@troutmask.apl.washington.edu>
Subject:   Re: rtld dropping core on recent -current
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>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <kostikbel@gmail.com> 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--



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