public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Fwd: gdb & pthreads - the Ike and Tina of Linux dev
@ 2005-05-27 16:22 Bryan Wilkerson
  2005-05-27 16:42 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Bryan Wilkerson @ 2005-05-27 16:22 UTC (permalink / raw)
  To: gdb


I tried sending this to gdb-prs but that failed so....
 Any help is greatly appreciated.

-b

--- Bryan Wilkerson <bryanwilkerson@yahoo.com> wrote:
> Date: Fri, 27 May 2005 09:13:41 -0700 (PDT)
> From: Bryan Wilkerson <bryanwilkerson@yahoo.com>
> Subject: gdb & pthreads - the Ike and Tina of Linux
> dev
> To: gdb-prs@sources.redhat.com
> 
> 
> I've submitted a bug regarding this issue but maybe
> there is something I'm doing wrong or could do
> better.
>  
> 
> It's seems as though I have *never* been able to get
> gdb to debug pthread threaded applications.  The
> latest problem is that when gdb hits a breakpoint in
> code that running on a thread other than the main
> thread, I get the following:
> 
> Program terminated with signal SIGTRAP,
> Trace/breakpoint trap.
> The program no longer exists
> 
> ...and no further debugging is possible.  
> 
> below is all of the relevant version information.
> Perhaps someone could suggest a workaround?  Note
> that
> while I am using the kernel.org 2.6.12-rc3 kernel
> with
> the inotify 0.23 patch, I've confirmed that the
> problem also happens with the stock SuSE 9.3 kernel.
> 
> Please CC my e-mail on any replies. 
> 
> Thanks,
> 
> -bryan
> 
> 
> Linux vincent 2.6.12-rc3-inotify-smp #2 SMP Sat May
> 21
> 08:50:26 PDT 2005 i686 i686 i386 GNU/Linux
> bwilkers@vincent:~/proj/aux-media/bin>
> bwilkers@vincent:~/proj/aux-media/bin> gcc -v
> Reading specs from
> /usr/lib/gcc-lib/i586-suse-linux/3.3.5/specs
> Configured with: ../configure --enable-threads=posix
> --prefix=/usr --with-local-prefix=/usr/local
> --infodir=/usr/share/info --mandir=/usr/share/man
> --enable-languages=c,c++,f77,objc,java,ada
> --disable-checking --libdir=/usr/lib --enable-libgcj
> --with-slibdir=/lib --with-system-zlib
> --enable-shared
> --enable-__cxa_atexit i586-suse-linux
> Thread model: posix
> gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
> bwilkers@vincent:~/proj/aux-media/bin>
> bwilkers@vincent:~/proj/aux-media/bin> gdb -v
> GNU gdb 6.3
> 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 "i586-suse-linux".
> bwilkers@vincent:~/proj/aux-media/bin>
> bwilkers@vincent:~/proj/aux-media/bin>
> /lib/libc.so.6
> GNU C Library stable release version 2.3.4
> (20050218),
> by Roland McGrath et al.
> Copyright (C) 2005 Free Software Foundation, Inc.
> This is free software; see the source for copying
> conditions.
> There is NO warranty; not even for MERCHANTABILITY
> or
> FITNESS FOR A
> PARTICULAR PURPOSE.
> Configured for i686-suse-linux.
> Compiled by GNU CC version 3.3.5 20050117
> (prerelease)
> (SUSE Linux).
> Compiled on a Linux 2.6.9 system on 2005-03-19.
> Available extensions:
>         GNU libio by Per Bothner
>         crypt add-on version 2.1 by Michael Glad and
> others
>         linuxthreads-0.10 by Xavier Leroy
>         GNU Libidn by Simon Josefsson
>         NoVersion patch for broken glibc 2.0
> binaries
>         BIND-8.2.3-T5B
>         libthread_db work sponsored by Alpha
> Processor
> Inc
>         NIS(YP)/NIS+ NSS modules 0.19 by Thorsten
> Kukuk
> Thread-local storage support included.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/libc/bugs.html>.
> bwilkers@vincent:~/proj/aux-media/bin>   
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: gdb & pthreads - the Ike and Tina of Linux dev
  2005-05-27 16:22 Fwd: gdb & pthreads - the Ike and Tina of Linux dev Bryan Wilkerson
@ 2005-05-27 16:42 ` Daniel Jacobowitz
  2005-06-01 12:43   ` Bryan Wilkerson
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2005-05-27 16:42 UTC (permalink / raw)
  To: Bryan Wilkerson; +Cc: gdb

On Fri, May 27, 2005 at 09:22:00AM -0700, Bryan Wilkerson wrote:
> 
> I tried sending this to gdb-prs but that failed so....
>  Any help is greatly appreciated.

You didn't include a test case.  You didn't include a log of the
session where the problem occurs.  There's not enough information for
me to make a reasonable guess about what's wrong.

I use thread debugging every week without trouble, so you can be
assured that it does work for some of us.  I haven't seen this problem
reported by Debian users, either.


-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: gdb & pthreads - the Ike and Tina of Linux dev
  2005-05-27 16:42 ` Daniel Jacobowitz
@ 2005-06-01 12:43   ` Bryan Wilkerson
  2005-06-01 13:04     ` Ramana Radhakrishnan
  0 siblings, 1 reply; 5+ messages in thread
From: Bryan Wilkerson @ 2005-06-01 12:43 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 704 bytes --]

--- Daniel Jacobowitz <drow@false.org> wrote:

> 
> You didn't include a test case.  You didn't include
> a log of the
> session where the problem occurs.  There's not
> enough information for
> me to make a reasonable guess about what's wrong.
>
Attached is a test case.  Try setting a breakpoint at
gdbthread.cpp:31
 
> I use thread debugging every week without trouble,
> so you can be
> assured that it does work for some of us.  I haven't
> seen this problem
> reported by Debian users, either.
> 
I'm glad that it works in some cases and I'm willing
to bend my habits somewhat to accomodate but I think
it probably unwise to exclude the entire user
population of the 2nd [?] largest distro vendor. 

[-- Attachment #2: 2454512864-gdbthread.tar.gz --]
[-- Type: application/x-gzip, Size: 17008 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: gdb & pthreads - the Ike and Tina of Linux dev
  2005-06-01 12:43   ` Bryan Wilkerson
@ 2005-06-01 13:04     ` Ramana Radhakrishnan
  2005-06-03 12:57       ` Bryan Wilkerson
  0 siblings, 1 reply; 5+ messages in thread
From: Ramana Radhakrishnan @ 2005-06-01 13:04 UTC (permalink / raw)
  To: bryanwilkerson; +Cc: Daniel Jacobowitz, gdb

Hi Bryan ,

Took your testcase. Can't repeat this on Debian unstable 
running 2.6.11-686-smp / gcc 3.3.5 / binutils 2.15 / glibc 
2.3.2 .

Whats the compiler / binutils / glibc version you are using 
? There still is not enough information for anyone else to 
replicate this.

Also I tried it on a stock Suse 9.2 and it worked just fine.



cheers
Ramana



ramana@arnor:~/gdbthread$ gdb gdbthread
GNU gdb 6.3-debian
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 "i386-linux"...Using host 
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) b gdbthread.cpp:31
Breakpoint 1 at 0x804877e: file gdbthread.cpp, line 31.
(gdb) run
Starting program: /home/ramana/gdbthread/gdbthread
[Thread debugging using libthread_db enabled]
[New Thread -1210399648 (LWP 25876)]
[New Thread -1210401872 (LWP 25879)]
[Switching to Thread -1210401872 (LWP 25879)]

Breakpoint 1, threadFn (arg=0x0) at gdbthread.cpp:33
33                      sleep(1);
(gdb) bt
#0  threadFn (arg=0x0) at gdbthread.cpp:33
#1  0xb7fccb63 in start_thread () from /lib/tls/libpthread.so.0
#2  0xb7e8518a in clone () from /lib/tls/libc.so.6
(gdb) up
#1  0xb7fccb63 in start_thread () from /lib/tls/libpthread.so.0
(gdb) down
#0  threadFn (arg=0x0) at gdbthread.cpp:33
33                      sleep(1);
(gdb) bt
#0  threadFn (arg=0x0) at gdbthread.cpp:33
#1  0xb7fccb63 in start_thread () from /lib/tls/libpthread.so.0
#2  0xb7e8518a in clone () from /lib/tls/libc.so.6
(gdb) l
33                      sleep(1);
34                      if( i % 2 == 0 )
35                              puts("Tick");
36                      else
37                              puts("Tock");
38                      i++;
39              }
40      }
41
42
(gdb) l 31
26      using namespace bwutils;
27
28      void *threadFn(void *arg)
29      {
30              int i = 0;
31              while( 1 )
32              {
33                      sleep(1);
34                      if( i % 2 == 0 )
35                              puts("Tick");
(gdb) bt
#0  threadFn (arg=0x0) at gdbthread.cpp:33
#1  0xb7fccb63 in start_thread () from /lib/tls/libpthread.so.0
#2  0xb7e8518a in clone () from /lib/tls/libc.so.6
(gdb)



-- 
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: gdb & pthreads - the Ike and Tina of Linux dev
  2005-06-01 13:04     ` Ramana Radhakrishnan
@ 2005-06-03 12:57       ` Bryan Wilkerson
  0 siblings, 0 replies; 5+ messages in thread
From: Bryan Wilkerson @ 2005-06-03 12:57 UTC (permalink / raw)
  To: Ramana Radhakrishnan; +Cc: Daniel Jacobowitz, gdb



--- Ramana Radhakrishnan
<ramana.radhakrishnan@codito.com> wrote:

> Hi Bryan ,
> 
> Whats the compiler / binutils / glibc version you
> are using? 


That information, except binutils, was in my original
post.  To summarize:  

gcc - 3.3.5-5 20050117 Thread model: posix
binutils - 2.15.94.0.2.2-3 
glibc - 2.3.4-23
kernel - 2.6.11.4-20a-default

All up to date, standard, SuSE Pro 9.3 components.
I've repeated the problem on two different hardware
platforms - a Prescott P4 system and a Pentium-M
system. 

Below is a screen dump of my attempt to debug the
previously attached test case.  Note that I didn't
type the final "Quit" it did that in response to my
running the program.  If I don't put in the breakpoint
or put a breakpoint in main() only, everything works
fine.

If there is any other information I can provide, let
me know.



bwilkers@bwilkers-mobl:~/proj/temp/gdbthread> gdb
gdbthread
GNU gdb 6.3
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 "i586-suse-linux"...Using
host libthread_db library
"/lib/tls/libthread_db.so.1".

(gdb) b gdbthread.cpp:30
Breakpoint 1 at 0x804879f: file gdbthread.cpp, line
30.
(gdb) r
Starting program:
/home/bwilkers/proj/temp/gdbthread/gdbthread

Program terminated with signal SIGTRAP,
Trace/breakpoint trap.
The program no longer exists.
(gdb) Quit
(gdb)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-06-03 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-27 16:22 Fwd: gdb & pthreads - the Ike and Tina of Linux dev Bryan Wilkerson
2005-05-27 16:42 ` Daniel Jacobowitz
2005-06-01 12:43   ` Bryan Wilkerson
2005-06-01 13:04     ` Ramana Radhakrishnan
2005-06-03 12:57       ` Bryan Wilkerson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).