Bug 17305 - Hang when joining thread with gdb 7.8
Summary: Hang when joining thread with gdb 7.8
Status: RESOLVED DUPLICATE of bug 17185
Alias: None
Product: gdb
Classification: Unclassified
Component: threads (show other bugs)
Version: 7.8
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-24 21:49 UTC by Ross Lagerwall
Modified: 2014-08-27 17:10 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
program to reproduce the problem (194 bytes, text/x-csrc)
2014-08-24 21:49 UTC, Ross Lagerwall
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Lagerwall 2014-08-24 21:49:22 UTC
Created attachment 7756 [details]
program to reproduce the problem

When using gdb 7.8 (or compiled from git), if a process does a pthread_join, gdb and the process hang and gdb stops responding to any input (Ctrl-C, Ctrl-\, Ctrl-z, etc). The only way to get out is to kill the process with SIGKILL, at which point gdb begins responding again. This did not happen with gdb 7.7.1.

$ gcc -Wall -o test -g test.c -pthread
$ gdb test
Exception caught while booting Guile.
Error in function "open-file":
No such file or directory: "/usr/share/gdb/guile/gdb/boot.scm"

warning: Could not complete Guile gdb module initialization from:
/usr/share/gdb/guile/gdb/boot.scm.
Limited Guile support is available.
Suggest passing --data-directory=/path/to/gdb/data-directory.

GNU gdb (GDB) 7.8.50.20140824-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tmp/test...done.
(gdb) r
Starting program: /tmp/test 
Got object file from memory but can't read symbols: File truncated.
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff780f700 (LWP 1277)]
test
test
test
test
test
test
test
test
test
test

At this point the process has hung (which it doesn't when not connected to gdb) and gdb doesn't respond to any keyboard input.

$ ps aux | grep test
ross      1268  0.0  0.3 108580 26096 pts/0    Sl   22:45   0:00 gdb/gdb /tmp/test
ross      1273  0.0  0.0  14588   740 pts/0    tl+  22:45   0:00 /tmp/test

For what it's worth, I'm running Arch Linux with Linux 3.16.1. Thanks!
Comment 1 Ross Lagerwall 2014-08-25 09:04:08 UTC
Marking as duplicate...

*** This bug has been marked as a duplicate of bug 17185 ***
Comment 2 Doug Evans 2014-08-26 06:41:12 UTC
For reference sake, there is also pr 17247 which is still open.
Comment 3 dje 2014-08-27 07:04:30 UTC
btw, I'm curious why you're getting the following:

Exception caught while booting Guile.
Error in function "open-file":
No such file or directory: "/usr/share/gdb/guile/gdb/boot.scm"

Can you tell me how you configured, built, and installed gdb?
Comment 4 Ross Lagerwall 2014-08-27 16:48:33 UTC
(In reply to dje from comment #3)
> btw, I'm curious why you're getting the following:
> 
> Exception caught while booting Guile.
> Error in function "open-file":
> No such file or directory: "/usr/share/gdb/guile/gdb/boot.scm"
> 
> Can you tell me how you configured, built, and installed gdb?

Well I just cloned the git repo, ran:
$ ./configure --prefix=/usr --disable-nls \
    --with-system-readline \
    --with-python=/usr/bin/python2 \
    --with-system-gdbinit=/etc/gdb/gdbinit
$ make -j4
$ gdb/gdb ...

It probably got that error because I hadn't installed it.
Comment 5 dje 2014-08-27 17:10:08 UTC
(In reply to Ross Lagerwall from comment #4)
> (In reply to dje from comment #3)
> > btw, I'm curious why you're getting the following:
> > 
> > Exception caught while booting Guile.
> > Error in function "open-file":
> > No such file or directory: "/usr/share/gdb/guile/gdb/boot.scm"
> > 
> > Can you tell me how you configured, built, and installed gdb?
> 
> Well I just cloned the git repo, ran:
> $ ./configure --prefix=/usr --disable-nls \
>     --with-system-readline \
>     --with-python=/usr/bin/python2 \
>     --with-system-gdbinit=/etc/gdb/gdbinit
> $ make -j4
> $ gdb/gdb ...
> 
> It probably got that error because I hadn't installed it.

Ok, thanks!