From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27843 invoked by alias); 15 Jun 2004 18:01:35 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 27773 invoked from network); 15 Jun 2004 18:01:31 -0000 Received: from unknown (HELO DYN319581.beaverton.ibm.com) (32.97.110.142) by sourceware.org with SMTP; 15 Jun 2004 18:01:31 -0000 Received: by DYN319581.beaverton.ibm.com (Postfix, from userid 1000) id DEF52B166; Tue, 15 Jun 2004 10:59:59 -0700 (PDT) From: Paul Gilliam Reply-To: pgilliam@us.ibm.com To: gdb@sources.redhat.com Subject: Re: Did the fix for recycled thread ids uncover another bug? Date: Tue, 15 Jun 2004 18:01:00 -0000 User-Agent: KMail/1.6.2 Cc: Daniel Jacobowitz References: <20040614232228.GA31523@nevyn.them.org> In-Reply-To: <20040614232228.GA31523@nevyn.them.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_fkzzAZfYVqxbEMX" Message-Id: <200406151059.59807.pgilliam@us.ibm.com> X-SW-Source: 2004-06/txt/msg00153.txt.bz2 --Boundary-00=_fkzzAZfYVqxbEMX Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 1060 On Monday 14 June 2004 16:22, Daniel Jacobowitz wrote: > On Mon, Jun 14, 2004 at 04:17:47PM -0700, Paul Gilliam wrote: > > I will post a follow-up with the details if someone tells me this is the > > right mail-list. > > I already did... I have done some more homework and found that the problem is with 6.1 and seems to be fixed in 6.1.0.90_2004-06-15-cvs (I just tried it). This is all on the PowerPC. So now I need to find a patch for 6.1 that will fix this. I have attached four files: the first is the test case, tbug.c; two are transcripts from gdb 6.1 (with some back-porting) for ppc-32 and for ppc-64; the last is a transcript from gdb 6.1.0.90_2004-06-15-cvs for ppc-32.. 'tbug' starts two threads, each using the same thread function which just waits a few seconds and returns. Set a break-point in 'tf' (the thread function) and run. In the 64-bit case, everything works as expected. In the 32 bit case, we get a message 'reading register pc (#64): No such process' and then we're hosed. Thanks for any help, -=# Paul Gilliam #=- --Boundary-00=_fkzzAZfYVqxbEMX Content-Type: text/x-log; charset="iso-8859-1"; name="gdb-6.1-ppc32-tbug.log" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb-6.1-ppc32-tbug.log" Content-length: 1659 madcow:/home/public/test-tools/gdb # gdb tbug GNU gdb 6.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "ppc-suse-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) break main Breakpoint 1 at 0x10000630: file tbug.c, line 31. (gdb) run Starting program: /home/public/test-tools/gdb/tbug [Thread debugging using libthread_db enabled] [New Thread 1074020384 (LWP 26705)] [Switching to Thread 1074020384 (LWP 26705)] Breakpoint 1, main (argc=1, argv=0xffffe464) at tbug.c:31 31 for (n = 0; n < N; ++n) (gdb) cont Continuing. [New Thread 1078217504 (LWP 26708)] tf(0): begin [New Thread 1082411808 (LWP 26709)] after create tf(1): begin tf(0): end [Thread 1078217504 (LWP 26708) exited] tf(1): end [Thread 1082411808 (LWP 26709) exited] after join Program exited normally. (gdb) clear main Deleted breakpoint 1 (gdb) break tf Breakpoint 2 at 0x10000594: file tbug.c, line 15. (gdb) run Starting program: /home/public/test-tools/gdb/tbug [Thread debugging using libthread_db enabled] [New Thread 1074020384 (LWP 26710)] reading register pc (#64): No such process. (gdb) cont Continuing. reading register pc (#64): No such process. (gdb) cont Continuing. reading register pc (#64): No such process. (gdb) cont Continuing. reading register pc (#64): No such process. (gdb) quit The program is running. Exit anyway? (y or n) y --Boundary-00=_fkzzAZfYVqxbEMX Content-Type: text/x-log; charset="iso-8859-1"; name="gdb-6.1-ppc64-tbug.log" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb-6.1-ppc64-tbug.log" Content-length: 1952 madcow:/home/public/test-tools/gdb # gdb64 tbug64 GNU gdb 6.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "ppc64-suse-linux"...Using host libthread_db library "/lib64/tls/libthread_db.so.1". (gdb) break main Breakpoint 1 at 0x100007f8: file tbug.c, line 31. (gdb) run Starting program: /home/public/test-tools/gdb/tbug64 [Thread debugging using libthread_db enabled] [New Thread 549757822848 (LWP 26734)] [Switching to Thread 549757822848 (LWP 26734)] Breakpoint 1, main (argc=1, argv=0x1fffffff2b8) at tbug.c:31 31 for (n = 0; n < N; ++n) (gdb) cont Continuing. [New Thread 549762017472 (LWP 26737)] tf(0): begin [New Thread 549766211776 (LWP 26738)] after create tf(1): begin tf(0): end [Thread 549762017472 (LWP 26737) exited] tf(1): end [Thread 549766211776 (LWP 26738) exited] after join Program exited normally. (gdb) clear main Deleted breakpoint 1 (gdb) break tf Breakpoint 2 at 0x1000074c: file tbug.c, line 15. (gdb) run Starting program: /home/public/test-tools/gdb/tbug64 [Thread debugging using libthread_db enabled] [New Thread 549757822848 (LWP 26739)] [New Thread 549762017472 (LWP 26740)] [Switching to Thread 549762017472 (LWP 26740)] Breakpoint 2, tf (arg=0x0) at tbug.c:15 15 int n = (int) (long int) arg; (gdb) cont Continuing. [New Thread 549766211776 (LWP 26741)] [Switching to Thread 549766211776 (LWP 26741)] Breakpoint 2, tf (arg=0x1) at tbug.c:15 15 int n = (int) (long int) arg; (gdb) cont Continuing. tf(1): begin tf(0): begin after create tf(1): end tf(0): end [Thread 549762017472 (LWP 26740) exited] [Thread 549766211776 (LWP 26741) exited] after join Program exited normally. (gdb) quit --Boundary-00=_fkzzAZfYVqxbEMX Content-Type: text/x-log; charset="iso-8859-1"; name="gdb-cvs-top-ppc32-tbug.log" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb-cvs-top-ppc32-tbug.log" Content-length: 1177 pgilliam@elm3b11:~/gdb_cvs_top/build-ppc32> gdb/gdb ~/tbug GNU gdb 6.1.0.90_2004-06-15-cvs Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc--linux"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) b tf Breakpoint 1 at 0x10000584: file tbug.c, line 15. (gdb) run Starting program: /home/pgilliam/tbug [Thread debugging using libthread_db enabled] [New Thread 1024 (LWP 10689)] [New Thread 2049 (LWP 10692)] [New Thread 1026 (LWP 10693)] [Switching to Thread 1026 (LWP 10693)] Breakpoint 1, tf (arg=0x0) at tbug.c:15 15 int n = (int) (long int) arg; (gdb) c Continuing. [New Thread 2051 (LWP 10694)] tf(0): begin after create [Switching to Thread 2051 (LWP 10694)] Breakpoint 1, tf (arg=0x1) at tbug.c:15 15 int n = (int) (long int) arg; (gdb) c Continuing. tf(1): begin tf(0): end tf(1): end after join Program exited normally. (gdb) q --Boundary-00=_fkzzAZfYVqxbEMX Content-Type: text/x-csrc; charset="iso-8859-1"; name="tbug.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tbug.c" Content-length: 1000 /* File tbug.c created by Steve Munroe on Thu Jan 15 2004. */ #include #include #include #include #include #include #define N 2 static void * tf (void *arg) { int n = (int) (long int) arg; char number[160]; sprintf(number, "tf(%ld): begin", (long)arg); puts (number); sleep (10); sprintf(number, "tf(%ld): end", (long)arg); puts (number); return NULL; } int main (int argc, char *argv[]) { int n; pthread_t th[N]; for (n = 0; n < N; ++n) if (pthread_create (&th[n], NULL, tf, (void *) (long int) n) != 0) { puts ("create failed"); exit (1); } puts("after create"); for (n = 0; n < N; ++n) if (pthread_join (th[n], NULL) != 0) { puts ("join failed"); exit (1); } puts("after join"); return 0; } /* Change Log <@log@> Thu Jan 15 2004 13:44:33 by Steve Munroe */ --Boundary-00=_fkzzAZfYVqxbEMX--