Subject: Re: Apache & ld.elf_so
To: None <port-pmax@NetBSD.ORG>
From: Michael L. Hitch <mhitch@lightning.oscs.montana.edu>
List: port-pmax
Date: 06/15/1998 21:09:51
On Jun 16, 10:23am, Toru Nishimura wrote:
> NetBSD/newsmips (and macppc) guy, Masanori Tsubai, reported me
> privately that he could reproduce the symptom and found that the
> problem was around;
> 
> 	_rtld_load_object()::src/libexec/ld.elf_so/load.c
> 
> He tracked down there was something wrong in updating _rtld_objlist
> linked list, but failed to fix it.  Probably things are worse and
> deeper than they look like.  So, please submit this rt_ld trouble to
> PR database, with high severity.  The report/query PR page in
> www.netbsd.org is very handy to use. 

  I've reproduced the problem on my DECstation, but I'm seeing it at
a different place.  It's looping in _rtld_load_needed_objects().  This
is being called from _rtld_dlopen() after _rtld_load_object() is called.

  What it looks like is that _rtld_load_object() is not getting the
new object linked into the _rtld_objlist correctly, and the new object
entry is linked to itself.  That is where it loops, chasing it's own
tail.

  Ah ha!  I just found the problem.  When dlclose() removes an unused
object, it neglects to update _rtld_objtail.  When dlopen() is called
again, it allocats the same memory for the object, and then links it
to the entry pointed to by _rtld_objtail - which is the same object
being added.

Michael

-- 
Michael L. Hitch			mhitch@montana.edu
Computer Consultant
Information Technology Center
Montana State University	Bozeman, MT	USA