This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] pthread_once hangs when init routine throws an exception [BZ #18435]
- From: Martin Sebor <msebor at redhat dot com>
- To: Mike Frysinger <vapier at gentoo dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 04 Jun 2015 14:24:09 -0600
- Subject: Re: [PATCH] pthread_once hangs when init routine throws an exception [BZ #18435]
- Authentication-results: sourceware.org; auth=none
- References: <556B7F10 dot 40209 at redhat dot com> <556C1A22 dot 30504 at redhat dot com> <556C8062 dot 4010309 at redhat dot com> <20150602054139 dot GZ4496 at vapier>
By removing the macro redefinitions from nptl/pthreadP.h
the change causes pthread_once.c to be compiled with the
more robust macros defined in pthread.h and allows cleanup
to take place even after an exception has been thrown so
long as glibc has been compiled with -fexceptions.
they're in there to avoid the PLT right ? so deleting them means the relocs
come back. can't we get both here ?
Looking at the powepc64 assembly for ___pthread_once_slow before
and after the change, there are no PLT calls in either. The only
difference is that with the change, the function calls GCC's
_Unwind_Resume which is a direct branch to the function.
Comparing the rest of libpthread.so before and after the change,
the number of calls via the PLT is the same.
I admit I'm not sure what the intended purpose of the internal
macros was. I had searched git logs before I made the change
but couldn't find anything helpful beyond some ChangeLog entries
that referred to it as an internal optimization. They seem to
have been introduced before 2001 (the year of the first Git
commit, AFAICS).
If I missed something let me know.
Martin