[PATCH] libdw: add thread-safety to dwarf_getabbrev()

Mark Wielaard mark@klomp.org
Sat Oct 26 12:06:00 GMT 2019

On Sat, 2019-10-26 at 12:54 +0200, Florian Weimer wrote:
> * Jonathon Anderson:
> > Just finished some modifications to the patch series, git request-pull 
> > output below. This rebases onto the latest master and does a little 
> > diff cleaning, the major change is that I swapped out the memory 
> > management to use the pthread_key_* alternative mentioned before.
> This use of pthread_key_* is rather unusual.  In particular, there are
> only 1024 keys supported for the entire process, so it limits the
> number of Dwarf * objects that can be created by one process, even if
> it does not use any threads.

O, I didn't know that there was such a low limit on pthread_keys. That
is indeed a bit of a problem, especially with split-dwarf where
basically every CU could be its own Dwarf object (from a .dwo file).
That would easily exceed such a low limit.

I'll see if I can create a case where that is a problem. Then we can
see how to adjust things to use less pthread_keys. Is there a different
pattern we can use?



More information about the Elfutils-devel mailing list