This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Race in dl code: dl_open_worker and _dl_fini


On Mon, Dec 25, 2006 at 11:04:26AM +0530, Sripathi Kodi wrote:
> I have attached a patch to this mail that implements the second solution
> I have  explained below. I have  added a flag l_fini_called  to link_map
> structure  and  I  have  used  that  flag  in  _dl_fini  to  ensure  the
> destructors are called only once.
> 
> Please let me know if either of these two approaches is acceptable.

Using a bit-field for this has issues (but so did the old code).
As that part of _dl_fini is executed without dl_load_lock, some other
thread modifying any of the bit-fields in the same word might race
with it.  Similarly --l->l_direct_opencount is unsafe, wonder if
we need that at all, the app is going to exit anyway.

The more important question is, what is supposed to happen when
calling functions from a library whose destructors have been run already.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]