Date: Sat, 28 Mar 2009 15:47:40 +0200 From: Kostik Belousov <kostikbel@gmail.com> To: Ed Schouten <ed@80386.nl> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: LD_PRELOAD broken? Message-ID: <20090328134740.GI31897@deviant.kiev.zoral.com.ua> In-Reply-To: <20090328102552.GR73108@hoeg.nl> References: <20090328102552.GR73108@hoeg.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Sat, Mar 28, 2009 at 11:25:52AM +0100, Ed Schouten wrote: > Hi all, > > Is it possible that the changes to rtld-elf the last couple of weeks > cause LD_PRELOAD to crash applications on startup? Very simple way to > reproduce: > > LD_PRELOAD=/lib/libc.so.7 ls > > This causes a segmentation fault on startup, at least on AMD64. Yes. The following fixes the case for me. diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 823427a..d98ade7 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1125,7 +1125,7 @@ find_library(const char *xname, const Obj_Entry *refobj) xname); return NULL; } - if (refobj->z_origin) + if (refobj != NULL && refobj->z_origin) return origin_subst(xname, refobj->origin_path); else return xstrdup(xname); [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAknOKnwACgkQC3+MBN1Mb4j8JQCg2jXJ6FVuBM/YnVBg3ghKdEbB aoAAoJiA1wJgIfXunExSEXi1UVA0kW5U =DqFT -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090328134740.GI31897>
