Deadlock in signal safe functions.

Ondřej Bílka neleai@seznam.cz
Sat Jul 11 11:41:00 GMT 2015


Hi,

I realized that there is possible deadlock when we call any signal-safe
function in signal handler. Its quite simple.

1. Create two threads to force locking in _dl_fixup with
THREAD_GSCOPE_SET_FLAG ();
2. Send signal and and with handler calling unresolved function, say
mkdir. 

This causes deadlock unless we implement locking as signal-safe
recursive mutex, which isn't recursive on x64.

I don't have reproducer yet as I don't know how to force enough lookups
to make this condition likely.



More information about the Libc-alpha mailing list