From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6954 invoked by alias); 27 Apr 2005 18:40:43 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 6922 invoked from network); 27 Apr 2005 18:40:34 -0000 Received: from unknown (HELO webmail.streamline-computing.com) (82.133.39.164) by sourceware.org with SMTP; 27 Apr 2005 18:40:34 -0000 Received: from [81.105.116.111] (helo=cpc4-oxfd5-5-0-cust111.oxfd.cable.ntl.com) by webmail.streamline-computing.com with asmtp (Exim 3.35 #1 (Debian)) id 1DQrTt-00036h-00 for ; Wed, 27 Apr 2005 19:41:53 +0100 Subject: GDB locks up -- Cannot find new threads: generic error From: David Lecomber To: gdb Content-Type: text/plain Date: Wed, 27 Apr 2005 19:01:00 -0000 Message-Id: <1114627357.31720.81.camel@cpc4-oxfd5-5-0-cust111.oxfd.cable.ntl.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-04/txt/msg00202.txt.bz2 Hi all I've been using an Opteron - with a 32-bit app and 32-bit GDB taken from GDB 6.3.50.20050310, and get the aforementioned error. I'm hoping someone can help.. I can reproduce this, easily, every time with a short pthreads program. The problem does *not* occur with GNU gdb Red Hat Linux (6.1post-1.20040607.52rh) The session is typically: (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 GDB's stack is: (gdb) bt #0 0x400bd098 in sigsuspend () from /lib/tls/libc.so.6 #1 0x080971e5 in child_wait () #2 0x0809359a in thread_db_init () #3 0x080e4695 in wait_for_inferior () #4 0x080e4425 in proceed () #5 0x0807b426 in find_default_create_inferior () #6 0x080e18cd in kill_if_already_running () #7 0x080e1a0b in kill_if_already_running () #8 0x080a9f1e in _initialize_cli_dump () #9 0x080ab8ea in cmd_func () #10 0x08080311 in execute_command () #11 0x080f0fa1 in async_disable_stdin () #12 0x080f13dd in async_disable_stdin () #13 0x081b4d25 in rl_callback_read_char () #14 0x080f095b in delete_timer () #15 0x080f0eae in stdin_event_handler () #16 0x080f0280 in delete_file_handler () #17 0x080efdc8 in standard_macro_lookup () #18 0x080efe10 in gdb_do_one_event () #19 0x080edd3b in catch_errors () #20 0x080efe33 in start_event_loop () #21 0x080785db in main () - 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) The example below, gcc -m32 ptest.c -lpthread, generates the issue. #include #include #define NUM_THREADS 5 void *PrintHello(void *threadid) { printf("\n%d: Hello World!\n", threadid); pthread_exit(NULL); } int main (int argc, char *argv[]) { pthread_t threads[NUM_THREADS]; int rc, t; for(t=0;t < NUM_THREADS;t++){ printf("Creating thread %d\n", t); rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t); if (rc){ printf("ERROR; return code from pthread_create() is %d\n", rc); exit(-1); } } pthread_exit(NULL); } Thanks David -- David Lecomber