On Thu, Oct 20, 2011 at 2:55 AM, Lassi Tuura <[email protected]> wrote:

> Didn't test this yet, but looks very reasonable to me. I'll spin some tests on
> this with our software chain (also with Konstantin's patch for FreeBSD) next 
> week.
>

Looks like I dropped at least one patch in September :( Please let me
know how your testing goes.

Paul: The reason why libpthread loops over the keys multiple times
seems to be related to

"A destructor function might, however, re-associate non-NULL values to
that key or some other key"

I'm guessing that most destructors don't do this, which is why your
solution works. But if we get keys with crazy destructors which call
pthread_setspecific(), could we be in trouble again on the last
iteration?

How about:

static __thread bool trace_destroy_started = false;

trace_cache_free():
  trace_destroy_started = true

trace_cache_get():
  if trace_destroy_started: return NULL

I also worry a bit about libpthread changing
PTHREAD_DESTRUCTOR_ITERATIONS underneath us.

 -Arun

_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to