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/2843] New: Race between pthread_cancel and pthread_join (tst-join5)

I'm seeing intermittent failures in nptl/ tst-join5

Consider two threads, A and B:

Thread A calls pthread_cancel(B); pthread_join(B).
Some time later thread B calls pthread_join(A).
pthread_join is a cancellation point, so I would expect thread B to be cancelled
at that point. However what thread B sees thread A waiting and mistakenly
returns EDEADLK.

The attached testcase is based on tst-join5, with an extra busy look added to
make the failure reproducible.

The patch fixes this by checking if the current thread has been cancelled before
returning EDEADLK.

           Summary: Race between pthread_cancel and pthread_join (tst-join5)
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: drepper at redhat dot com
        ReportedBy: paul at codesourcery dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

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