[PATCH] Async signal safe TLS accesses
Rich Felker
dalias@aerifal.cx
Fri Jan 3 07:45:00 GMT 2014
On Thu, Jan 02, 2014 at 11:31:42PM -0800, Andrew Hunter wrote:
> On Thu, Jan 2, 2014 at 6:48 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> > This one looks like a possible bug to me:
> > it will always error if map->l_tls_offset == FORCED_DYNAMIC_TLS_OFFSET.
> >
>
> I believe this is WAI -- if I remember correctly you're quoting the
> snippet invoked when we need to fulfill a TLS relocation while loading
> code that assumes init-exec model for some TLS variable X. If X's
> map->l_tls_offset = FORCED_DYNAMIC, that means that X was already
> accessed from at least one thread, which did so in dynamic model (and
> malloced an arena to hold the section). This means that thread can't
> use a static TLS offset; we can't fulfill that relocation; ERROR.
> (Well, we could sighandler over to each thread and move their dynamic
> area to the static TLS section, but...no.)
No, you can't; you cannot prove that the application did not already
save the address of a thread-local object for later usage. If it did,
moving the object to a different address would be illegal.
Rich
More information about the Libc-alpha
mailing list