This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/24963] deadlock between freopen and fclose
- From: "nsz at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 23 Sep 2019 10:35:31 +0000
- Subject: [Bug libc/24963] deadlock between freopen and fclose
- Auto-submitted: auto-generated
- References: <bug-24963-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=24963
--- Comment #6 from Szabolcs Nagy <nsz at gcc dot gnu.org> ---
lock order should be either
list_all_lock -> fp
and then list_all_lock must not be locked while
an fp is already locked, i.e. freopen should be
fixed (by taking list_all_lock before the fp lock).
or
fp -> list_all_lock
and then current _IO_un_link and fflush(0) are wrong
since they take list_all_lock first then the fp lock.
fixing this is harder (before all _IO_un_link call fp
should be locked and fflush should somehow lock all fps)
(i assumed both locks are recursive, if list_all_lock
is not recursive then fixing freopen may be trickier).
--
You are receiving this mail because:
You are on the CC list for the bug.