This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4] Also use l_tls_dtor_count to decide on object unload (BZ #18657)
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org, roland at hack dot frob dot com
- Date: Thu, 16 Jul 2015 22:15:04 +0200
- Subject: Re: [PATCH v4] Also use l_tls_dtor_count to decide on object unload (BZ #18657)
- Authentication-results: sourceware.org; auth=none
- References: <1436552195-16464-1-git-send-email-siddhesh at redhat dot com> <1436958625-25492-1-git-send-email-siddhesh at redhat dot com>
On Wed, Jul 15, 2015 at 04:40:25PM +0530, Siddhesh Poyarekar wrote:
> v4: Take the big lock for a longer duration during destructor
> registration.
>
> When an TLS destructor is registered, we set the DF_1_NODELETE flag to
> signal that the object should not be destroyed. We then clear the
> DF_1_NODELETE flag when all destructors are called, which is wrong -
> the flag could have been set by other means too.
>
> This patch replaces this use of the flag by using l_tls_dtor_count
> directly to determine whether it is safe to unload the object. This
> change has the added advantage of eliminating the lock taking when
> calling the destructors, which could result in a deadlock. The patch
> also fixes the test case tst-tls-atexit - it was making an invalid
> dlclose call, which would just return an error silently.
>
> Change verified on x86_64; the test suite does not show any
> regressions due to the patch.
>
Now this looks ok for me.