From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14060 invoked by alias); 28 Jun 2003 05:32:17 -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 14049 invoked from network); 28 Jun 2003 05:32:15 -0000 Received: from unknown (HELO smtp-out.comcast.net) (24.153.64.116) by sources.redhat.com with SMTP; 28 Jun 2003 05:32:15 -0000 Received: from home.ringle.org (pcp03186657pcs.proctr01.fl.comcast.net [68.56.245.147]) by mtaout01.icomcast.net (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0HH600F2DF6WE4@mtaout01.icomcast.net> for gdb@sources.redhat.com; Sat, 28 Jun 2003 01:28:09 -0400 (EDT) Received: by home.ringle.org (Postfix, from userid 501) id 2FE0FB8244; Sat, 28 Jun 2003 01:28:02 -0400 (EDT) Date: Sat, 28 Jun 2003 07:16:00 -0000 From: Jon Ringle Subject: pthread_create does not return when remote debugging To: gdb@sources.redhat.com Message-id: <200306280128.02056.jon.ringle@comdial.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: KMail/1.5 X-SW-Source: 2003-06/txt/msg00519.txt.bz2 Hi, I am having an issue when remote debugging a multi-threaded app, a call to pthread_create hangs inside __pthread_wait_for_restart_signal on the host gdb. Thanks in advance. Jon I've built a gdb-5.3 cross debugging environment i686 host/arm target with the following: $ tar xzf gdb-5.3.tar.gz $ mkdir gdb-native $ cd gdb-native $ ../gdb-5.3/configure --host=i686-pc-linux-gnu \ --target=arm-linux \ --build=i686-pc-linux-gnu $ make $ cd .. $ mkdir gdb-cross $ cd gdb-cross $ HOSTCC=gcc CC='arm-linux-gcc -msoft-float' \ ../gdb-5.3/configure --host=arm-linux \ --target=arm-linux \ --build=i686-pc-linux-gnu $ make $ cd .. I copy gdb-cross/gdb/gdbserver/gdbserver to the target arm. On the target, I execute: # ./gdbserver :5555 test-thread Process test-thread created; pid = 380 On the host I run: $ gdb-native/gdb/gdb test-thread GNU gdb 5.3 Copyright 2002 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 "--host=i686-pc-linux-gnu --target=arm-linux"... (gdb) set solib-absolute-prefix /dev/null (gdb) set solib-search-path /usr/arm-linux/lib (gdb) target remote 10.10.10.101:5555 Remote debugging using 10.10.10.101:5555 0x400025c0 in ?? () (gdb) b pthread_create Breakpoint 1 at 0x20019e0 (gdb) c Continuing. [New Thread 1024] [Switching to Thread 1024] Breakpoint 1, 0x020019e0 in pthread_create () (gdb) finish Run till exit from #0 0x020019e0 in pthread_create () <<<<< at this point it gdb hangs indefinately. I ctrl-c out >>>>>> Program received signal SIGINT, Interrupt. 0x4014ebc4 in __sigsuspend (set=0xbffffbb4) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 48 ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or directory. in ../sysdeps/unix/sysv/linux/sigsuspend.c (gdb) bt #0 0x4014ebc4 in __sigsuspend (set=0xbffffbb4) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 #1 0x40101b34 in __pthread_wait_for_restart_signal (self=0x401116e0) at pthread.c:786 #2 0x40101138 in __pthread_create_2_1 (thread=0x206f8dc, attr=0xbffffc58, start_routine=0x20043ac , arg=0xbffffd88) at restart.h:26 #3 0x0204b424 in createThread (func=0x20043ac , arg=0xbffffd88, threadname=0x204f4f0 "console") at thread.c:84 #4 0x020022b8 in main (argc=1, argv=0xbffffdd4) at main.c:168 #5 0x401484a0 in __libc_start_main (main=0x2002054
, argc=1, argv=0xbffffdd4, init=0x2001848 <_init>, fini=0x204f334 <_fini>, rtld_fini=0x4000ca60 <_dl_fini>, stack_end=0xbffffeba) at ../sysdeps/generic/libc-start.c:92