This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

threads/1320: lin-lwp.c:1317: internal-error: lin_lwp_wait: Assertion `iterate_over_lwps (running_callback, NULL)' failed.


>Number:         1320
>Category:       threads
>Synopsis:       lin-lwp.c:1317: internal-error: lin_lwp_wait: Assertion `iterate_over_lwps (running_callback, NULL)' failed.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 05 16:28:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     srikrish@in.ibm.com
>Release:        GNU gdb 20030731
>Organization:
>Environment:
2.4.19-suse-SMP
gcc version 3.2 
(>gcc -v 
Reading specs from /usr/lib/gcc-lib/s390-suse-linux/3.2/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-
prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/us
r/lib --enable-languages=c,c++,f77,objc,java --enable-libgcj --with-gxx-include-
dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --en
able-__cxa_atexit s390-suse-linux
Thread model: posix
gcc version 3.2)

This GDB was configured as "s390-ibm-linux".
>Description:
I am getting an assertion failure/internal-error while running a multi-threaded program using the GDB20030731. Can some one point out if this is a known bug or is there a workaround?

This happens when execv is called from the threadproc. 
Error Message: lin-lwp.c:1317: internal-error: lin_lwp_wait: Assertion
`iterate_over_lwps (runing_callback, NULL)' failed.

The program runs fine outside gdb.
Here's the output:
mymachine: /home/srik>./myprog somearg
entering main program. pid: 10861
In threadproc pid:10863

 getting up from sleep
entering main program. pid: 10863
end of main: 10863

mymachine: /home/srik>


The test program is given under 'How-To-Repeat' and output while using gdb follows. I am using 2.4.19-3Suse-SMP kernel.
(linuxthreads)
Thanks,
Srikrishnan

OUTOUT WHILE USING GDB after enabling printing of verbose/debug statements
in gdb/lin-lwp.c

> gdbdir/gdb myprog
GNU gdb 20030731
Copyright 2003 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 "s390-ibm-linux"...
(gdb) run somearg
Starting program: /home/srik/myprog somearg
CW:  waitpid 2122 received Trace/breakpoint trap (stopped)
CW:  waitpid 2122 received Trace/breakpoint trap (stopped)
CW:  waitpid 2122 received Trace/breakpoint trap (stopped)
[New Thread 1024 (LWP 2122)]
LLR: PTRACE_SINGLESTEP process 2122, 0 (resume event thread)
LLW: waitpid 2122 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 2122.
SEL: Select single-step LWP 2122
LLW: trap_ptid is process 2122.
LLR: PTRACE_CONT process 2122, 0 (resume event thread)
LLW: waitpid 2122 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 2122.
LLW: trap_ptid is process 2122.
LLR: PTRACE_SINGLESTEP process 2122, 0 (resume event thread)
LLW: waitpid 2122 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 2122.
SEL: Select single-step LWP 2122
LLW: trap_ptid is process 2122.
LLR: PTRACE_CONT process 2122, 0 (resume event thread)
LLW: waitpid 2122 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 2122.
LLW: trap_ptid is process 2122.
LLR: PTRACE_SINGLESTEP process 2122, 0 (resume event thread)
LLW: waitpid 2122 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 2122.
SEL: Select single-step LWP 2122
LLW: trap_ptid is process 2122.
LLR: PTRACE_CONT process 2122, 0 (resume event thread)
LLW: waitpid 2122 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 2122.
LLW: trap_ptid is process 2122.
[New Thread 2049 (LWP 2123)]
LLAL: PTRACE_ATTACH LWP 2123, 0, 0 (OK)
LLAL: waitpid LWP 2123 received Stopped (signal) (stopped)
LLR: PTRACE_SINGLESTEP process 2122, 0 (resume event thread)
LLW: waitpid 2122 received Trace/breakpoint trap (stopped)
LLTA: PTRACE_PEEKUSER LWP 2122, 0, 0 (OK)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 2122.
SEL: Select single-step LWP 2122
LLW: trap_ptid is LWP 2122.
RC:  PTRACE_CONT LWP 2123, 0, 0 (resume sibling)
LLR: PTRACE_CONT process 2122, 0 (resume event thread)
LLW: waitpid 2123 received Real-time signal 0 (stopped)
LLTA: PTRACE_PEEKUSER LWP 2123, 0, 0 (OK)
LLW: PTRACE_CONT LWP 2123, Unknown signal 77 (preempt 'handle')
LLW: waitpid 2123 received Trace/breakpoint trap (stopped)
LLTA: PTRACE_PEEKUSER LWP 2123, 0, 0 (OK)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 2123.
SC:  kill LWP 2122 **<SIGSTOP>**
SC:  lwp kill 0 ERRNO-OK
SWC: waitpid LWP 2122 received Stopped (signal) (stopped)
SWC: CALLING LLTA
LLTA: PTRACE_PEEKUSER LWP 2122, 0, 0 (OK)
LLW: trap_ptid is LWP 2123.
[New Thread 1026 (LWP 2124)]
LLAL: PTRACE_ATTACH LWP 2124, 0, 0 (OK)
LLAL: waitpid LWP 2124 received Stopped (signal) (stopped)
LLR: PTRACE_SINGLESTEP process 2123, 0 (resume event thread)
LLW: waitpid 2123 received Trace/breakpoint trap (stopped)
LLTA: PTRACE_PEEKUSER LWP 2123, 0, 0 (OK)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 2123.
SEL: Select single-step LWP 2123
LLW: trap_ptid is LWP 2123.
RC:  PTRACE_CONT LWP 2124, 0, 0 (resume sibling)
RC:  PTRACE_CONT LWP 2122, 0, 0 (resume sibling)
LLR: PTRACE_CONT process 2123, 0 (resume event thread)
LLW: waitpid 2124 received Real-time signal 0 (stopped)
LLTA: PTRACE_PEEKUSER LWP 2124, 0, 0 (OK)
LLW: PTRACE_CONT LWP 2124, Unknown signal 77 (preempt 'handle')
In threadproc pid:2124
LLW: waitpid 2122 received Real-time signal 0 (stopped)

LLTA: PTRACE_PEEKUSER LWP 2122, 0, 0 (OK)
back to main. pid:2122
LLW: PTRACE_CONT LWP 2122, Unknown signal 77 (preempt 'handle')
LLW: waitpid 2122 received Real-time signal 1 (stopped)
LLTA: PTRACE_PEEKUSER LWP 2122, 0, 0 (OK)
LLW: PTRACE_CONT LWP 2122, Real-time signal 13 (preempt 'handle')
LLW: waitpid 2124 received Real-time signal 0 (stopped)
LLTA: PTRACE_PEEKUSER LWP 2124, 0, 0 (OK)
LLW: PTRACE_CONT LWP 2124, Unknown signal 77 (preempt 'handle')
LLW: waitpid 2123 received 0 (exited)
LLW: LWP 2123 exited.
LLW: waitpid 2122 received 0 (exited)
SC:  kill LWP 2124 **<SIGSTOP>**
SC:  lwp kill 0 ERRNO-OK
SWC: waitpid LWP 2124 received Trace/breakpoint trap (stopped)
SWC: CALLING LLTA
LLTA: PTRACE_PEEKUSER LWP 2124, 0, 0 (OK)
PTRACE_CONT LWP 2124, 0, 0 (OK)
SWC: Candidate SIGTRAP event in LWP 2124
SWC: waitpid LWP 2124 received Stopped (signal) (stopped)
SWC: CALLING LLTA
LLTA: PTRACE_PEEKUSER LWP 2124, 0, 0 (OK)
LLW: LWP 2122 exited.
lin-lwp.c:1317: internal-error: lin_lwp_wait: Assertion `iterate_over_lwps
(run
ing_callback, NULL)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

Create a core file of GDB? (y or n) y
Abort
mymachine: /home/srik>

>How-To-Repeat:
Run the following test program as:
gdb myprog
> run somearg

TEST PROGRAM:
#include <stdio.h>
#include <pthread.h>
void * threadproc(void * junk)
{
 int i;
 printf("In threadproc pid:%d \n", getpid());
 execv("myprog",0);=20
 printf("exec failed \n");
}

int main(int argc, char * argv)
{
 int i;
 void * ret;
 pthread_t newthread;
 printf("entering main program. pid: %d \n", getpid());
 if(argc >1)
 {
  pthread_create(&newthread, NULL, threadproc, NULL);
  printf("back to main. pid:%d \n",getpid());
 }
    printf("end of main: %d \n", getpid());
}


>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]