Your message dated Fri, 02 May 2003 19:59:29 +0900
with message-id <[EMAIL PROTECTED]>
and subject line Bug#191398: pthread_mutex_lock() has different behaviour - 
dynamic/static link
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 30 Apr 2003 09:54:36 +0000
>From [EMAIL PROTECTED] Wed Apr 30 04:54:35 2003
Return-path: <[EMAIL PROTECTED]>
Received: from mailhost.cs.auc.dk [130.225.194.6] (root)
        by master.debian.org with esmtp (Exim 3.12 1 (Debian))
        id 19AoIN-0006ww-00; Wed, 30 Apr 2003 04:54:35 -0500
Received: from blade48.cs.auc.dk ([EMAIL PROTECTED] [130.225.194.133])
        by mailhost.cs.auc.dk (8.12.3/8.12.3) with ESMTP id h3U9sTVR016487
        for <[EMAIL PROTECTED]>; Wed, 30 Apr 2003 11:54:29 +0200 (MEST)
Date: Wed, 30 Apr 2003 11:54:29 +0200 (MEST)
From: Christian Thomsen <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: pthread_mutex_lock() has different behaviour - dynamic/static link
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Scanned-By: MIMEDefang 2.14
Delivered-To: [EMAIL PROTECTED]
X-Spam-Status: No, hits=-11.7 required=4.0
        tests=BAYES_01,HAS_PACKAGE,USER_AGENT_PINE
        autolearn=ham version=2.53-bugs.debian.org_2003_04_23
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_04_23 
(1.174.2.15-2003-03-30-exp)


Package: libc6-dev
Version: 2.2.5-11.2
Severity: normal



-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux splint 2.4.20 #2 Fri Apr 11 18:38:04 CEST 2003 i686
Locale: LANG=C, LC_CTYPE=C



The program below has different behaviour if it is linked either dynamic
or static with pthread:

gcc -lpthread libc_bug.c -o test
cannot reaquire the lock

whereas

gcc /usr/lib/libpthread.a libc_bug.c -o test

can reaquire forever..

also just

gcc libc_bug.c -o test
can reaquire the lock forever






 //program

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;

int main(int argc, char *argv) {
        while(1) {
                pthread_mutex_lock(&mutex);
                fprintf(stderr,"GOT LOCK\n");
                pthread_mutex_lock(&mutex);
                fprintf(stderr,"GOT LOCK\n");
                pthread_mutex_lock(&mutex);
                fprintf(stderr,"GOT LOCK\n");
        }
        return 0;
}


/Christian Thomsen
/DAT 8
/Aalborg Universitet
/Denmark



---------------------------------------
Received: (at 191398-done) by bugs.debian.org; 2 May 2003 10:59:33 +0000
>From [EMAIL PROTECTED] Fri May 02 05:59:31 2003
Return-path: <[EMAIL PROTECTED]>
Received: from oris.opensource.jp (oris.opensource.gr.jp) [218.44.239.73] 
(postfix)
        by master.debian.org with esmtp (Exim 3.12 1 (Debian))
        id 19BYGJ-0005gH-00; Fri, 02 May 2003 05:59:31 -0500
Received: from oris.opensource.jp (oris.opensource.jp [218.44.239.73])
        by oris.opensource.gr.jp (Postfix) with ESMTP
        id 519EEC33C6; Fri,  2 May 2003 19:59:29 +0900 (JST)
Date: Fri, 02 May 2003 19:59:29 +0900
Message-ID: <[EMAIL PROTECTED]>
From: GOTO Masanori <[EMAIL PROTECTED]>
To: Christian Thomsen <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: Bug#191398: pthread_mutex_lock() has different behaviour - 
dynamic/static link
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
User-Agent: Wanderlust/2.9.9 (Unchained Melody) SEMI/1.14.3 (Ushinoya)
 FLIM/1.14.3 (=?ISO-8859-4?Q?Unebigory=F2mae?=) APEL/10.3 Emacs/21.2
 (i386-debian-linux-gnu) MULE/5.0 (SAKAKI)
MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya")
Content-Type: text/plain; charset=US-ASCII
Delivered-To: [EMAIL PROTECTED]
X-Spam-Status: No, hits=-20.0 required=4.0
        tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,
              REFERENCES,REPLY_WITH_QUOTES,USER_AGENT
        autolearn=ham version=2.53-bugs.debian.org_2003_04_23
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_04_23 
(1.174.2.15-2003-03-30-exp)

At Wed, 30 Apr 2003 11:54:29 +0200 (MEST),
Christian Thomsen wrote:
> The program below has different behaviour if it is linked either dynamic
> or static with pthread:

This is caused by gcc pthread implementation vs glibc pthread
implementation.

> gcc -lpthread libc_bug.c -o test
> cannot reaquire the lock

It uses glibc's libpthread.  This is normal, and it's blocked.

> gcc /usr/lib/libpthread.a libc_bug.c -o test
> 
> can reaquire forever..
>
> also just
> 
> gcc libc_bug.c -o test
> can reaquire the lock forever

This two use gcc's pthread.  I don't know it's bug or not.  However,
I'm not surprised if gcc's pthread cannot block its process entity.

BTW, using static binaries with glibc, you should do:

        gcc -static -o test libc_bug.c -lpthread
                or
        gcc -static -o test libc_bug.c /usr/lib/libpthread.a

I close this bug.

Regards,
-- gotom


Reply via email to