Subject: lib/24125: core dump in pthread_mutex_unlock(3)
To: None <>
From: Min Sik Kim <>
List: netbsd-bugs
Date: 01/17/2004 01:45:15
>Number:         24125
>Category:       lib
>Synopsis:       core dump in pthread_mutex_unlock(3)
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 17 07:46:00 UTC 2004
>Originator:     Min Sik Kim
>Release:        NetBSD 1.6ZH
System: NetBSD 1.6ZH NetBSD 1.6ZH (SULLEY) #3: Fri Jan 16 16:57:45 CST 2004 i386
Architecture: i386
Machine: i386

When pthread_mutex_unlock(3) is called with a new mutex, it dumps core
with the following error message.  Many gtk2 appliations are affected.

test: Error detected by libpthread: Unlocking unlocked mutex.
Detected by file "/usr/src/lib/libpthread/pthread_mutex.c", line 340, function "pthread_mutex_unlock".
See pthread(3) for information.
Abort (core dumped)


Save the following program as and run as follows.

gcc -pthread -o test test.c
#include <pthread.h>

int main()
  pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
  pthread_mutex_unlock (&m);
  return 0;
 Checked out on Jan 16.