This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Async signal safe TLS accesses


On Fri, Dec 06, 2013 at 04:15:37PM -0200, Alexandre Oliva wrote:
> On Dec  5, 2013, Andrew Hunter <ahh@google.com> wrote:
> 
> > On Thu, Nov 28, 2013 at 5:03 PM, Alexandre Oliva <aoliva@redhat.com> wrote:
> 
> >> The lock is recursive, but I don't see anything in the patch besides
> >> the CAS loops that avoids inconsistent state, particularly in the
> >> case of lazy TLS relocation (introduced with GNU2 TLS).  Was that not
> >> taken into account?
> 
> > glibc recursive locks aren't async-signal-safe.  We avoid problems
> > with reentrancy via dl_mask_all_signals.
> 
> But that doesn't avoid *concurrency* problems, does it?
> 
> Besides, GNU2 TLS provides for lazy TLS relocation (as mentioned above),
> and that most certainly takes the DL lock.  I don't see anything in the
> patch that would avoid signal-safety problems in that path.

I would propose just preallocating the descriptors at dlopen time...

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]