Re: GDB locks up -- Cannot find new threads: generic error

Daniel Jacobowitz
2005-04-27T19:01:14Z

On Wed, Apr 27, 2005 at 07:42:37PM +0100, David Lecomber wrote:
> (gdb) b main
> Breakpoint 1 at 0x804ed18: file
> main.cpp, line 10.
> (gdb) run
> Starting program: a.out
> warning: linux_test_for_tracefork: unexpected result from waitpid
> (28261,
> status 0x117f)
> [Thread debugging using libthread_db enabled]
> Error while reading shared library symbols:
> Cannot find new threads: generic error
>
> at this point GDB does nothing and is unresponsive to any user input.
>
> The system is:
> kernel-2.4.21-27.EL
> glibc-2.3.2-95.30

At a guess, your kernel is buggered. You really should never see that
warning. The unexpected signal is SIGCHLD; your kernel has accepted
the SETOPTIONS but obviously failed to stop when the test thread
vforked.

> - and if it helps, I turned on debug of lin-lwp and saw:
>
> Starting program: ./a.out
> CW: waitpid 28606 received Trace/breakpoint trap (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Child exited (stopped)
> CW: waitpid 28606 received Trace/breakpoint trap (stopped)
> warning: linux_test_for_tracefork: unexpected result from waitpid
> (28629,
> status
> 0x117f)
> CW: waitpid 28606 received Trace/breakpoint trap (stopped)
> [Thread debugging using libthread_db enabled]
> Error while reading shared library symbols:
> Cannot find new threads: generic error
> LLR: PTRACE_SINGLESTEP process 28606, 0 (resume event thread)
> LLW: waitpid 28606 received Trace/breakpoint trap (stopped)

So um, if the program has stopped, what does GDB think it's still
waiting for? Might want to strace gdb (without -f, with -e
wait4,ptrace).

--
Daniel Jacobowitz
CodeSourcery, LLC