This is the mail archive of the glibc-bugs@sourceware.org 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/19515] New: wrong assertion in pthread_mutex_unlock() with lock elision


https://sourceware.org/bugzilla/show_bug.cgi?id=19515

            Bug ID: 19515
           Summary: wrong assertion in pthread_mutex_unlock() with lock
                    elision
           Product: glibc
           Version: unspecified
               URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=8103
                    22
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: aurelien at aurel32 dot net
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

The following code from Andreas Messer fails with an assertion when run on a
system with hardware support for lock elision, and with a libc with lock
elision enabled.

#include <pthread.h>
#include <time.h>

int main(int argc, char* argv[])
{
  pthread_mutex_t mutex;
  pthread_mutexattr_t attr;
  struct timespec ts;

  pthread_mutexattr_init( &attr );
  pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK );
  pthread_mutex_init( &mutex, &attr );

  clock_gettime( CLOCK_REALTIME, &ts );
  ts.tv_sec += 3;
  pthread_mutex_timedlock( &mutex, &ts );
  pthread_mutex_unlock(&mutex);
  return 0;
}

It returns the following assertion:

a.out: pthread_mutex_unlock.c:87: __pthread_mutex_unlock_usercnt: Assertion
`type == PTHREAD_MUTEX_ERRORCHECK_NP' failed.
Aborted

Patch will follow on the mailing list.

-- 
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]