From: Eric Crampton <[EMAIL PROTECTED]>
   Date: 17 Jul 2000 14:21:17 -0400

   [eric@newelmo eric]$ g++ -o test test.cpp
   /tmp/ccJ9VeQx.o: In function `main':
   /tmp/ccJ9VeQx.o(.text+0x58): undefined reference to `pthread_create'
   /tmp/ccJ9VeQx.o(.text+0x7a): undefined reference to `pthread_create'
   collect2: ld returned 1 exit status
   [eric@newelmo eric]$ g++ -o test test.cpp -lpthread
   [eric@newelmo eric]$ gdb ./test < debug.txt
   GNU gdb 5.0
   Copyright 2000 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 "i686-pc-linux-gnu"...
   (gdb) Breakpoint 1 at 0x804869a
   (gdb) Starting program: /home/eric/./test 
   [New Thread 1024 (runnable)]
   [Switching to Thread 1024 (runnable)]

   Breakpoint 1, 0x804869a in main ()
   (gdb) Continuing.
   [New Thread 2049 (runnable)]
   [New Thread 1026 (runnable)]
   thread1

   Program received signal SIGTRAP, Trace/breakpoint trap.
   [Switching to Thread 1026 (runnable)]
   0x0 in ?? ()
   (gdb) Continuing.

   Program received signal SIGILL, Illegal instruction.
   0x0 in ?? ()
   (gdb) Continuing.

   Program terminated with signal SIGILL, Illegal instruction.
   The program no longer exists.
   (gdb) The program is not being run.
   (gdb) The program is not being run.
   (gdb) The program is not being run.
   (gdb) The program is not being run.
   (gdb) The program is not being run.
   (gdb) The program is not being run.
   (gdb) Starting program: /home/eric/./test 
   warning: Cannot insert breakpoint -2:
   Cannot access memory at address 0x400257e4
   (gdb) [eric@newelmo eric]$ 

   The example is a bit contrived, but I tried to add some complexity of
   multiple threads and static instances of a class which allocate large
   chunks of memory. In our production system in-house, we see errors
   like this pretty often.

I believe you.

   Has anyone reported errors like this yet? We'd be willing to help in
   any way for this bug to be fixed. If you'd like me to build a debug
   version of gdb and give you information, let me know.

Not very many people have reported this, but I'm fully aware of the
problems the current threads debugging code has.  I've done some work
already to improve it, and I could send you a patch against the current
GDB development version if you'd like.

Mark

Reply via email to