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.
Bug 809179 - Global variable nested by another dso shows up incorrectly in gdb
Summary: Global variable nested by another dso shows up incorrectly in gdb
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gdb
Version: 7.0
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Sergio Durigan Junior
QA Contact: Miroslav Franc
URL:
Whiteboard:
Depends On: 745004
Blocks: 758797 1113520
TreeView+ depends on / blocked
 
Reported: 2012-04-02 16:57 UTC by Petr Muller
Modified: 2019-03-25 01:01 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: GDB was not correctly handling shared objects that contained identical global variables being exported. Consequence: When the user tried to inspect the global variable being exported by both shared objects, GDB would display an incorrect value for it. Fix: GDB now handles correctly different shared objects that export the same global variable. Result: The user can inspect the global variable without problems.
Clone Of: 745004
Environment:
Last Closed: 2015-03-05 09:23:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0404 0 normal SHIPPED_LIVE gdb bug fix and enhancement update 2015-03-05 14:17:37 UTC

Comment 2 Petr Muller 2012-04-02 17:05:04 UTC
This bug reappeared when compiled with a toolset gcc. Additionally, the toolset gcc toolset does not like the empty (if you supply something then it compiles) -Wl options in the original testcase:

$ scl enable devtoolset-1.0 'sh ./mk.sh'
gcc: error: unrecognized command line option ‘-Wl’
gcc: error: unrecognized command line option ‘-Wl’
gcc: error: unrecognized command line option ‘-Wl’

But when you remove them, you get the gdb behavior described in the bug. Both system (RHEL5+6) and Toolset gdb shows '$1 = 0' in the output.

Comment 3 Jakub Jelinek 2012-04-03 07:38:00 UTC
1) the rejection of bogus options passed to gcc driver when linking is documented: http://gcc.gnu.org/gcc-4.7/porting_to.html

2) I don't see how this testcase is related to PR39563, that PR was about block scope extern decls, there are none in the testcase

3) gcc generates the same debug info (and comparable code) in all versions I've tried (4.1/4.4/4.7/4.8), so if this worked, it would be a gdb change.  Try /usr/bin/gdb instead of gdb ?

Comment 4 Jan Kratochvil 2012-04-03 07:53:52 UTC
GDB does not support properly copy-relocations and conflicting names.

This is:
        common/.bss variables from shared libraries not displayed correctly
        http://sourceware.org/bugzilla/show_bug.cgi?id=11717

The possibilities how to fix it were discussed at:
        gfortran invalid DW_AT_location for overridable variables
        http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40040

You may get random result depending on which order GDB expands symtabs etc.

This is DTS-unrelated, it is a general GDB Bug/FEAT to fix.

Comment 5 Petr Muller 2012-04-03 08:57:32 UTC
(In reply to comment #3)
> 2) I don't see how this testcase is related to PR39563, that PR was about block
> scope extern decls, there are none in the testcase

I admit I just used the testcase, saw the reported behavior and reported it for DTS. Sorry. 

> 
> 3) gcc generates the same debug info (and comparable code) in all versions I've
> tried (4.1/4.4/4.7/4.8), so if this worked, it would be a gdb change.  Try
> /usr/bin/gdb instead of gdb ?

That is weird, because the factor is actually whether I use Toolset gcc or not.

If I compile with Toolset gcc, I get '$1 = 0' with both system and Toolset gdb
If I compile with system gcc, I get '$1 = 42' with both system and Toolset gdb

(In reply to comment #4)
> GDB does not support properly copy-relocations and conflicting names.
> 
> This is:
>         common/.bss variables from shared libraries not displayed correctly
>         http://sourceware.org/bugzilla/show_bug.cgi?id=11717
> 
> The possibilities how to fix it were discussed at:
>         gfortran invalid DW_AT_location for overridable variables
>         http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40040
> 
> You may get random result depending on which order GDB expands symtabs etc.
> 
> This is DTS-unrelated, it is a general GDB Bug/FEAT to fix.

Not sure if this is true - it seems to me that RHEL5/RHEL6 gdb/gcc (or whatever is the cause) is better than the Toolset one.

Comment 16 Sergio Durigan Junior 2014-09-04 21:38:01 UTC
Proposed patch for testing the issue (upstream): https://sourceware.org/ml/gdb-patches/2014-09/msg00136.html

Comment 21 errata-xmlrpc 2015-03-05 09:23:49 UTC
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.

https://rhn.redhat.com/errata/RHBA-2015-0404.html


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