This service will be undergoing maintenance at 20:00 UTC, 2017-04-03. It is expected to last about 30 minutes
Bug 53755 - gdb is broken for linuxthreads
gdb is broken for linuxthreads
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
7.3
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-09-17 15:44 EDT by hjl
Modified: 2007-04-18 12:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-09-27 11:18:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
A testcase (3.52 KB, text/plain)
2001-09-17 15:45 EDT, hjl
no flags Details
A patch (5.41 KB, patch)
2001-09-18 18:24 EDT, hjl
no flags Details | Diff

  None (edit)
Description hjl 2001-09-17 15:44:49 EDT
gdb-5.0rh-15.i386.rpm is broken for linuxthreads:

# gcc -g ex11.c -lpthread -lrt -D_GNU_SOURCE
# a.out&
# ps -xal | grep a.out 
000  1103 28229  3705   9   0 247300 600 rt_sig S    pts/17     0:00
./a.out
040  1103 28230 28229  17   0 247300 600 do_pol S    pts/17     0:00
./a.out
040  1103 28231 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28232 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28233 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28234 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28235 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28236 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28237 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28238 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28239 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28240 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28241 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28242 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28243 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28244 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28245 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28246 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28247 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28248 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28249 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28250 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28251 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28252 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28253 28230   9   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28254 28230  10   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28255 28230  10   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28256 28230  10   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28257 28230  11   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28258 28230  11   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28259 28230  11   0 247300 600 nanosl S    pts/17     0:00
./a.out
040  1103 28260 28230  13   0 247300 600 nanosl S    pts/17     0:00
./a.out
# gdb a.out
GNU gdb Red Hat Linux 7.x (5.0rh-15) (MI_OUT)
Copyright 2001 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 "i386-redhat-linux"...
(gdb) att 28243
Attaching to program: /home/hjl/bugs/gdb/thread/a.out, process 28243
Child process unexpectedly missing: No child processes.

Program terminated with signal ?, Unknown signal.
The program no longer exists.
(gdb) att 28229
Attaching to program: /home/hjl/bugs/gdb/thread/a.out, process 28229
Reading symbols from /lib/i686/libpthread.so.0...done.
[New Thread 1024 (LWP 28229)]
[New Thread 2049 (LWP 28230)]
[New Thread 1026 (LWP 28231)]
[New Thread 2051 (LWP 28232)]
[New Thread 3076 (LWP 28233)]
[New Thread 4101 (LWP 28234)]
[New Thread 5126 (LWP 28235)]
[New Thread 6151 (LWP 28236)]
[New Thread 7176 (LWP 28237)]
[New Thread 8201 (LWP 28238)]
[New Thread 9226 (LWP 28239)]
[New Thread 10251 (LWP 28240)]
[New Thread 11276 (LWP 28241)]
[New Thread 12301 (LWP 28242)]
[New Thread 13326 (LWP 28243)]
[New Thread 14351 (LWP 28244)]
[New Thread 15376 (LWP 28245)]
[New Thread 16401 (LWP 28246)]
[New Thread 17426 (LWP 28247)]
[New Thread 18451 (LWP 28248)]
[New Thread 19476 (LWP 28249)]
[New Thread 20501 (LWP 28250)]
[New Thread 21526 (LWP 28251)]
[New Thread 22551 (LWP 28252)]
[New Thread 23576 (LWP 28253)]
[New Thread 24601 (LWP 28254)]
[New Thread 25626 (LWP 28255)]
[New Thread 26651 (LWP 28256)]
[New Thread 27676 (LWP 28257)]
[New Thread 28701 (LWP 28258)]
[New Thread 29726 (LWP 28259)]
[New Thread 30751 (LWP 28260)]
Loaded symbols for /lib/i686/libpthread.so.0
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0x4007cb55 in __sigsuspend (set=0xbffff580)
    at ../sysdeps/unix/sysv/linux/sigsuspend.c:45
45        return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set),
_NSIG / 8
);
Comment 1 hjl 2001-09-17 15:45:25 EDT
Created attachment 31919 [details]
A testcase
Comment 2 hjl 2001-09-17 15:46:11 EDT
gdb 4.18 from RedHat 6.2 works fine on the testcase. It is a very
serious regression.
Comment 3 Trond Eivind Glomsrxd 2001-09-18 18:23:42 EDT
It does work in most cases, but it certainly has it problems as well. Note that
4.18 (and 5.0) are seriously broken on 2.4 kernels and can munge values in your
program by just running a programmed linked against pthreads.
Comment 4 hjl 2001-09-18 18:24:09 EDT
Created attachment 32098 [details]
A patch
Comment 5 Trond Eivind Glomsrxd 2001-09-27 11:18:11 EDT
The problem, as discussed on the gdb-list, is attaching to a random thread, as
opposed to the first thread. GDB gets confused.
Comment 6 Trond Eivind Glomsrxd 2002-05-07 18:46:21 EDT
Gdb 5.2 has a fix.

Note You need to log in before you can comment on or make changes to this bug.