This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC PATCH glibc v2] pthread_setspecific: Provide signal-safety across keys
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Mathieu Desnoyers <mathieu dot desnoyers at efficios dot com>
- Cc: "Carlos O'Donell" <carlos at redhat dot com>, "Ben Maurer" <bmaurer at fb dot com>, libc-alpha at sourceware dot org
- Date: Wed, 18 Oct 2017 07:33:20 +0200
- Subject: Re: [RFC PATCH glibc v2] pthread_setspecific: Provide signal-safety across keys
- Authentication-results: sourceware.org; auth=none
- References: <20171017232440.5134-1-mathieu.desnoyers@efficios.com>
* Mathieu Desnoyers:
> @@ -327,7 +328,7 @@ __nptl_deallocate_tsd (void)
> {
> /* The first block is allocated as part of the thread
> descriptor. */
> - free (level2);
> + (void) munmap (level2, PTHREAD_KEY_2NDLEVEL_SIZE * sizeof (*level2));
> THREAD_SETMEM_NC (self, specific, cnt, NULL);
I think __nptl_deallocate_tsd needs to disable signals as well, even
when the level2 pointer is NULL, and keep them disabled until the
thread exits. This is not a localized change; I don't know if it is
safe.