Should glibc be fully reentrant? -- No. (Roland was right).

Florian Weimer fweimer@redhat.com
Mon Dec 15 08:53:00 GMT 2014


On 12/12/2014 05:17 PM, Ondřej Bílka wrote:
> On Fri, Dec 12, 2014 at 10:50:19AM +0100, Florian Weimer wrote:
>> On 12/11/2014 03:11 PM, Ondřej Bílka wrote:
>>
>>> Yes, I wrote that from head so I forgot volatile/asm barrier. One could
>>> add requirement like needs to be compiled by gcc4-6+ instead pure C as
>>> just using signals is not part of C standard.
>>
>> GCC emulates atomics with locks on some platforms, or some lock-free
>> instruction sequences may not be reentrant.  This begins to look
>> like a can of worms, unfortunately.
>>
> It uses only thread local variable. If they are not reentrant its
> gigantic hole, you could not for example use sigaction as it could
> set errno which is thread local variable.

Sorry, what I'm trying to say is that atomics are not specified as 
async-signal-safe, and some actually aren't in practice.

-- 
Florian Weimer / Red Hat Product Security



More information about the Libc-alpha mailing list