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 11/28/2013 11:01 PM, Rich Felker wrote:
> On Fri, Nov 29, 2013 at 04:55:48AM +0100, OndÅej BÃlka wrote:
>> A proper solution would be make generic malloc async-signal safe. It is 
>> question of what is acceptable overhead. I can make a wrapper over any
>> allocator that does that at cost of two tls access. You would pay a mmap
>> overhead only when you are in signal where we do not care about
>> effectivity.
> 
> Not a solution as long as glibc officially supports applications
> replacing malloc.

The loader could access the implementation's malloc via GLIBC_PRIVATE
symbols.

I'm against this because any sufficiently complex and performant 
implementation of malloc will be difficult to audit for AS-safety.

In the end AS-safety may even limit your flexibility, but I don't
discount the possibility of writing the allocator such that it performs
well.

A small signal-safe allocator as proposed by Google is the easiest way
to get the job done. We can always fix this later.

Cheers,
Carlos.



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