Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Oct 2006 08:50:26 GMT
From:      "Takahiro Kurosawa" <takahiro.kurosawa@gmail.com>
To:        freebsd-threads@FreeBSD.org
Subject:   Re: threads/103975: Implicit loading/unloading of libpthread.so may crash user processes
Message-ID:  <200610060850.k968oQwM084989@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR threads/103975; it has been noted by GNATS.

From: "Takahiro Kurosawa" <takahiro.kurosawa@gmail.com>
To: "Alexander Kabaev" <kabaev@gmail.com>
Cc: "John Baldwin" <john@baldwin.cx>, freebsd-threads@freebsd.org, 
	freebsd-gnats-submit@freebsd.org
Subject: Re: threads/103975: Implicit loading/unloading of libpthread.so may crash user processes
Date: Fri, 6 Oct 2006 17:49:48 +0900

 Alexander Kabaev <kabaev@gmail.com> wrote:
 > On Thu, 5 Oct 2006 09:06:20 -0400
 > John Baldwin <john@baldwin.cx> wrote:
 >
 > > > To fix the problem, a function that has __attribute__((destructor))
 > > > in libpthread should probably be implemented in order to recover
 > > > the initial state before unloading.
 > >
 > > I'm not sure you can recover the state actually, hence why I think
 > > maybe we should make it so that libpthread doesn't unload once it has
 > > been loaded.
 
 I understand that it's way easier to prohibit unloading of libpthread
 than to change the code safely unloadable.
 Thanks for your explanation, John!
 
 > Linux does not allow pthread library to be unloaded presumably because
 > of reasons like this. From readelf -a /compat/linux/lib/libpthread.so.0:
 >
 >  0x6ffffffb (FLAGS_1)                    Flags: NODELETE INITFIRST
 >
 > Infortunately, rtld does not implement NODELETE and INITFIRST. Both are
 > addressed in my patch that I am yet to commit.
 
 I'm looking forward to the commit of your patch into the CVS repository :-)
 Maybe the following line should be added to src/lib/libpthread/Makefile
 when rtld supports the NODELETE flag? :
   LDFLAGS+=-Wl,-znodelete
 
 Thanks,
 --
 KUROSAWA, Takahiro



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