public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jon Ringle <jon.ringle@comdial.com>
To: gdb@sources.redhat.com
Subject: pthread_create does not return when remote debugging
Date: Sat, 28 Jun 2003 07:16:00 -0000	[thread overview]
Message-ID: <200306280128.02056.jon.ringle@comdial.com> (raw)

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 <console>, arg=0xbffffd88) at restart.h:26
#3  0x0204b424 in createThread (func=0x20043ac <console>, 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 <main>, 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

             reply	other threads:[~2003-06-28  5:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-28  7:16 Jon Ringle [this message]
2003-06-28 13:43 ` Jon Ringle
2003-06-28 15:52   ` Jon Ringle
2003-06-29  2:16     ` Jon Ringle
2003-06-28 15:01 ` Daniel Jacobowitz
2003-06-28 15:02   ` Jon Ringle
2003-06-28 15:30     ` Daniel Jacobowitz
2003-06-28 20:02       ` Jon Ringle
2003-06-28 20:29         ` Daniel Jacobowitz
2003-06-28 22:49           ` Jon Ringle
2003-06-29  2:02             ` Daniel Jacobowitz
2003-06-29  6:40               ` Jon Ringle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200306280128.02056.jon.ringle@comdial.com \
    --to=jon.ringle@comdial.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).