Subject: Re: gdb seems to ignore threads
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: felix zaslavskiy <felix@students.poly.edu>
List: current-users
Date: 06/01/2003 20:06:45
On Sun, 2003-06-01 at 15:42, Nathan J. Williams wrote:
> John Gordon <mailing.lists@dial.pipex.com> writes:
> 
> > I see something similar on my PPC system using your code as well as one
> > of my own test cases:
> 
> I'm still somewhat puzzled by these failures, as I haven't been able
> to reproduce them on i386 or powerpc, while using GDB interactively
> (ppc seems to have an i-cache sync issue that can foil breakpoints,
> but it only manifests when run quickly, such as inside of GDB's
> dejagnu testsuite). 
> 
>         - Nathan
> 
I this time didnt enable the breakpoint for main but only for
thread_executions
Here is some output of what i got:

(gdb) break thread_execution
Breakpoint 1 at 0x8048a6e: file simple_thread.c, line 9.
(gdb) r 
Starting program: /root/src/a.out 
Jun  1 20:02:13 localhost /netbsd: sa_switch(1337.16 flag 900004): Not
enough stacks.

Program received signal SIGBUS, Bus error.
pthread__upcall (type=0, sas=0x4863fcd4, ev=1214512352, intr=1214512364,
    arg=0x4863fcf8) at /usr/src/lib/libpthread/pthread_sa.c:89
89              PTHREADD_ADD(PTHREADD_UPCALLS);
(gdb) bt
#0  pthread__upcall (type=0, sas=0x4863fcd4, ev=1214512352,
intr=1214512364, 
    arg=0x4863fcf8) at /usr/src/lib/libpthread/pthread_sa.c:89
(gdb) info threads
  1 Thread 0 ()  0x48084a93 in sa_enable ()
    at /usr/src/lib/csu/i386_elf/../common_elf/crti.c:56


Interestingly this only occurs the first time i run this program with
gdb, subsequent runs dont cause this.

When the error does not occur the execution breaks at the correct place
but i still unable to step through the program.