[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#347793: marked as done (libc6-dev: most basic pthread program produces strange messages on stderr at exit)



Your message dated Thu, 19 Jan 2006 22:24:48 -0500
with message-id <20060120032448.GC25886@nevyn.them.org>
and subject line Bug#347793: libc6: well the 'most basic pthread program' is in error
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; 12 Jan 2006 18:13:18 +0000
>From fsblk@aurora.uaf.edu Thu Jan 12 10:13:18 2006
Return-path: <fsblk@aurora.uaf.edu>
Received: from 216-67-33-11-cdsl-rb1.fai.acsalaska.net ([216.67.33.11] helo=greenwood)
	by spohr.debian.org with esmtp (Exim 4.50)
	id 1Ex6wo-0008Qu-6Q
	for submit@bugs.debian.org; Thu, 12 Jan 2006 10:13:18 -0800
Received: from bkerin by greenwood with local (Exim 3.36 #1 (Debian))
	id 1Ex76D-0006PN-00; Thu, 12 Jan 2006 09:23:01 -0900
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Britton Leo Kerin <fsblk@aurora.uaf.edu>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libc6-dev: most basic pthread program produces strange messages on stderr at
 exit
Message-ID: <[🔎] 20060112182301.24098.84127.reportbug@localhost.localdomain>
X-Mailer: reportbug 3.18
Date: Thu, 12 Jan 2006 09:23:01 -0900
Sender: Britton Leo Kerin <bkerin@greenwood>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-7.0 required=4.0 tests=BAYES_00,HAS_PACKAGE,
	RCVD_IN_SORBS autolearn=no version=2.60-bugs.debian.org_2005_01_02

Package: libc6-dev
Version: 2.3.5-8
Severity: normal

This minimal program, test_threads.c:

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

   int thread_return;

   void *
   thread_function (void *arg)
   {
     int idx;
     for ( idx = 0 ; idx < 3 ; idx++ ) {
       sleep (1);
       printf ("thread_arg: %d\n", *((int *)arg));
     }

     thread_return = 42;

     pthread_exit (&thread_return);
   }


   int
   main (void)
   {
     int thread_arg = 2;
     pthread_t thread;
  
     int return_code;

     //  pthread_attr_t thread_attrs;
     //  return_code = pthread_attr_init (&thread_attrs);
    
     return_code = pthread_create (&thread, NULL, thread_function,
                                (void *) &thread_arg);
     assert (return_code == 0);

     int **return_location;
     return_code = pthread_join (thread, (void **) return_location);
     assert (return_code == 0);

     printf ("thread_return: %d\n", **return_location);

     return 0;
   }

Compiled this way:

   gcc -Wall -D_REENTRANT test_threads.c -lpthread -o test

without any errors or warnings, produces this output when run:

   thread_arg: 2
   thread_arg: 2
   thread_arg: 2
   thread_return: 42
         1581:
         1581:     runtime linker statistics:
         1581:                final number of relocations: 139
         1581:     final number of relocations from cache: 7

with the latter four lines being on stderr.  Is there some debugging
information that didn't get turned off or something?  I guess this
might be a libc bug report?

Uncommenting the lines that set up the thread_attrs structure and
passing a pointer to it to pthread_create insteal of NULL as the
second argument yields a different weird output:

   thread_arg: 2
   thread_arg: 2
   thread_arg: 2
   thread_return: 42
      1598:     binding file /lib/tls/libpthread.so.0 to
      /lib/tls/libc.so.6: normal symbol `__cxa_finalize' [GLIBC_2.1.3]
      1598:     binding file /lib/libgcc_s.so.1 to /lib/tls/libc.so.6:
      normal symbol `__cxa_finalize' [GLIBC_2.1.3]

Thanks,
Britton

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-1-k7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages libc6-dev depends on:
ii  libc6                      2.3.5-8       GNU C Library: Shared libraries an
ii  linux-kernel-headers       2.6.13+0rc3-2 Linux Kernel Headers for developme

Versions of packages libc6-dev recommends:
ii  gcc [c-compiler]             4:4.0.2-2   The GNU C compiler
ii  gcc-2.95 [c-compiler]        1:2.95.4-22 The GNU C compiler
ii  gcc-3.2 [c-compiler]         1:3.2.3-9   The GNU C compiler
ii  gcc-3.3 [c-compiler]         1:3.3.6-10  The GNU C compiler
ii  gcc-4.0 [c-compiler]         4.0.2-5     The GNU C compiler

-- no debconf information

---------------------------------------
Received: (at 347793-done) by bugs.debian.org; 20 Jan 2006 03:24:49 +0000
>From drow@nevyn.them.org Thu Jan 19 19:24:49 2006
Return-path: <drow@nevyn.them.org>
Received: from nevyn.them.org ([66.93.172.17] ident=Debian-exim)
	by spohr.debian.org with esmtp (Exim 4.50)
	id 1EzmtN-0000Fa-GU
	for 347793-done@bugs.debian.org; Thu, 19 Jan 2006 19:24:49 -0800
Received: from drow by nevyn.them.org with local (Exim 4.54)
	id 1EzmtM-0006kz-HZ; Thu, 19 Jan 2006 22:24:48 -0500
Date: Thu, 19 Jan 2006 22:24:48 -0500
From: Daniel Jacobowitz <dan@debian.org>
To: Britton Leo Kerin <fsblk@aurora.uaf.edu>, 347793-done@bugs.debian.org
Subject: Re: Bug#347793: libc6: well the 'most basic pthread program' is in error
Message-ID: <20060120032448.GC25886@nevyn.them.org>
References: <[🔎] 20060119190646.4305.44919.reportbug@localhost.localdomain>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[🔎] 20060119190646.4305.44919.reportbug@localhost.localdomain>
User-Agent: Mutt/1.5.8i
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

On Thu, Jan 19, 2006 at 10:06:46AM -0900, Britton Leo Kerin wrote:
> Package: libc6
> Version: 2.3.5-8
> Followup-For: Bug #347793
> 
> 
> The pthread_join call is wrong, as the second argument isn't the
> address of an actual pointer.  Get it right:
> 
>   void *return_pointer;
>   return_code = pthread_join (thread, &return_pointer);
> 
> and the complaint goes away.  So I guess my bug is what libc is
> complaining about, albiet in a fairly inscrutable way.
> 
> So I guess this is not a bug.

Correct.  You've clobbered memory at random; so something random has
happened.

-- 
Daniel Jacobowitz
CodeSourcery



Reply to: