This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/21069] New: printf may deadlock when threads get cancled
- From: "ma.jiang at zte dot com.cn" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 20 Jan 2017 02:24:50 +0000
- Subject: [Bug nptl/21069] New: printf may deadlock when threads get cancled
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=21069
Bug ID: 21069
Summary: printf may deadlock when threads get cancled
Product: glibc
Version: 2.24
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: nptl
Assignee: unassigned at sourceware dot org
Reporter: ma.jiang at zte dot com.cn
CC: drepper.fsp at gmail dot com
Target Milestone: ---
Created attachment 9764
--> https://sourceware.org/bugzilla/attachment.cgi?id=9764&action=edit
test case to reproduce the bug
Hi all,
I found a bug may cause deadlock still existed in the latest glibc source.
For a static binary, when a thread which is going through the printf function
get cancled, the stream lock will not be unlocked.
In ./sysdeps/nptl/libc-lockP.h, _pthread_cleanup_push_defer were declared to
be a weakref. So, in macro __libc_cleanup_region_start(in
sysdeps/nptl/libc-lock.h), after "_avail = PTFAVAIL
(_pthread_cleanup_push_defer);", _avail will turn out to be 0 as there are no
strong references for _pthread_cleanup_push_defer.
This bug can be reproduce by the attached file(I have tested it under
glibc-2.24 x86-64).
--
You are receiving this mail because:
You are on the CC list for the bug.