This is the mail archive of the
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
Bug ID: 21069
Summary: printf may deadlock when threads get cancled
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
test case to reproduce the bug
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
You are receiving this mail because:
You are on the CC list for the bug.