Subject: lib/24125: core dump in pthread_mutex_unlock(3)
To: None <gnats-bugs@gnats.NetBSD.org>
From: Min Sik Kim <minskim@bawi.org>
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
>Closed-Date:
>Last-Modified:
>Originator:     Min Sik Kim
>Release:        NetBSD 1.6ZH
>Organization:
>Environment:
System: NetBSD sulley.infnis.com 1.6ZH NetBSD 1.6ZH (SULLEY) #3: Fri Jan 16 16:57:45 CST 2004 root@sulley.infnis.com:/usr/obj/sys/arch/i386/compile/SULLEY i386
Architecture: i386
Machine: i386
>Description:

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)

>How-To-Repeat:

Save the following program as test.cc and run as follows.

gcc -pthread -o test test.c
./test

test.cc--------------------------------------------------
#include <pthread.h>

int main()
{
  pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
  pthread_mutex_unlock (&m);
  return 0;
}
---------------------------------------------------------
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
 Checked out on Jan 16.