This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Deadlock in signal safe functions.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Sat, 11 Jul 2015 13:40:53 +0200
- Subject: Deadlock in signal safe functions.
- Authentication-results: sourceware.org; auth=none
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.