Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Cause: GDB could not correctly access TLS (Thread Local Storage) data on statically linked binaries.
Consequence: The user was not able to inspect TLS data on the program being debugged, if this program was linked statically.
Fix: GDB now correctly accesses TLS data on statically linked binaries.
Result: The user can now inspect the TLS data on a statically linked binary.
Description of problem:
When you have a statically linked binary you can't access the tls data through gdb
Version-Release number of selected component (if applicable):
All. This problem exists in 6.4, 6.5, rhel7, F20 and even the upstream trunk version GDB
How reproducible:
always everywhere
Steps to Reproduce:
sierra648{jdelsign}82: gcc -g -o tls tls.c -pthread -static
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open':
(.text+0x764d): warning: the use of `mktemp' is dangerous, better use `mkstemp'
sierra648{jdelsign}83: gdb tls
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1)
...
Reading symbols from /g/g0/jdelsign/tls...done.
(gdb) b 12
Breakpoint 1 at 0x400511: file tls.c, line 12.
(gdb) run
Starting program: /g/g0/jdelsign/tls
[Thread debugging using libthread_db enabled]
[New Thread 0x2aaaaacac700 (LWP 6735)]
thread_local_p: & == 00002aaaaacac6c0, . == 00002aaaaacabd1c, * == 1
[Switching to Thread 0x2aaaaacac700 (LWP 6735)]
Breakpoint 1, start_routine (arg=0x1) at tls.c:12
12 return arg;
Actual results:
(gdb) p thread_local_p
Cannot find executable file `/g/g0/jdelsign/tls' in dynamic linker's load module list
Expected results:
It print's the variable
Additional info:
The way that we arrived at this problem was trying to diagnose a suspected problem with libthread_db's calculation of the address to TLS for OpenMP C/C++ threadprivate variables in statically linked binaries. Therefore, once GDB is able to properly load libthread_db there may be another problem with libthread_db's ability to return a correct address.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2014-1534.html
Description of problem: When you have a statically linked binary you can't access the tls data through gdb Version-Release number of selected component (if applicable): All. This problem exists in 6.4, 6.5, rhel7, F20 and even the upstream trunk version GDB How reproducible: always everywhere Steps to Reproduce: sierra648{jdelsign}82: gcc -g -o tls tls.c -pthread -static /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open': (.text+0x764d): warning: the use of `mktemp' is dangerous, better use `mkstemp' sierra648{jdelsign}83: gdb tls GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1) ... Reading symbols from /g/g0/jdelsign/tls...done. (gdb) b 12 Breakpoint 1 at 0x400511: file tls.c, line 12. (gdb) run Starting program: /g/g0/jdelsign/tls [Thread debugging using libthread_db enabled] [New Thread 0x2aaaaacac700 (LWP 6735)] thread_local_p: & == 00002aaaaacac6c0, . == 00002aaaaacabd1c, * == 1 [Switching to Thread 0x2aaaaacac700 (LWP 6735)] Breakpoint 1, start_routine (arg=0x1) at tls.c:12 12 return arg; Actual results: (gdb) p thread_local_p Cannot find executable file `/g/g0/jdelsign/tls' in dynamic linker's load module list Expected results: It print's the variable Additional info: