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/21031] New: pthread_key_delete() race with thread finalization

            Bug ID: 21031
           Summary: pthread_key_delete() race with thread finalization
           Product: glibc
           Version: 2.24
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: leo at yuriev dot ru
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

A race condition could occur between the pthread_key_delete() and the

For instance, __nptl_deallocate_tsd() could call a destructor for the key,
immediately before the pthread_key_delete() invalidates it (from an another
thread), and will continue destructor execution after the completion of

>From a user code this looks as if the corresponding destructor executes after
the key has been removed by pthread_key_delete(), and there is no way to know
whether was destructor called/executed or not.

Suggest add pthread_rwlock_rdlock() for __nptl_deallocate_tsd() and
pthread_rwlock_wrlock() for pthread_key_delete().

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]