Subject: lib/26096: Assertion on normal mutex double lock
To: None <gnats-bugs@NetBSD.org>
From: =?iso-8859-1?Q?J=E9r=F4me_Laban?= <jlaban@wanadoo.fr>
List: netbsd-bugs
Date: 06/28/2004 11:08:02
>Number:         26096
>Category:       lib
>Synopsis:       Assertion on normal mutex double lock
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 28 09:09:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 2.0_BETA -- (20040620)
>Organization:

>Environment:
System:         NetBSD jaylee 2.0_BETA NetBSD 2.0_BETA (GENERIC) #1: Sun Jun
20 14:31:22 CEST 2004
root@jaylee:/usr/obj/src-2.0/src/sys/arch/i386/compile/
GENERIC i386
Architecture: i386
Machine: i386
>Description:
An assertion is thrown when locking a normal mutex twice. Even if the
operation causes a deadlock, it should not assert.
>How-To-Repeat:
        #include <stdio.h>
        #include <pthread.h>

        int main()
        {
                pthread_mutex_t myMutex;

                pthread_mutexattr_t attr;
                pthread_mutexattr_init(&attr);
                pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);

                pthread_mutex_init(&myMutex, &attr);
                pthread_mutex_lock(&myMutex);
                pthread_mutex_lock(&myMutex);   // Assertion

                return 0;
        }

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: