This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/21069] New: printf may deadlock when threads get cancled

            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
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 9764
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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]