Bug 445912 - [RHEL5.2] static variable not available in gdb
[RHEL5.2] static variable not available in gdb
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gdb (Show other bugs)
5.1
All Linux
medium Severity medium
: rc
: ---
Assigned To: Jan Kratochvil
:
Depends On: 462897 465824
Blocks: 391501
  Show dependency treegraph
 
Reported: 2008-05-09 15:34 EDT by Alan Matsuoka
Modified: 2010-10-22 20:53 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 07:26: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)
pr27574.C (271 bytes, text/x-csrc)
2008-05-09 15:34 EDT, Alan Matsuoka
no flags Details
pr27574.wi (3.24 KB, application/octet-stream)
2008-05-09 15:35 EDT, Alan Matsuoka
no flags Details
Fix + testcase (of the _static_ variable). (6.62 KB, patch)
2008-10-05 19:25 EDT, Jan Kratochvil
no flags Details | Diff
Fix + testcase (of the _static_ variable; updated). (6.44 KB, patch)
2008-10-06 07:52 EDT, Jan Kratochvil
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 33044 None None None Never
Red Hat Product Errata RHBA-2009:1361 normal SHIPPED_LIVE gdb bug fix update 2009-09-01 06:57:06 EDT

  None (edit)
Description Alan Matsuoka 2008-05-09 15:34:32 EDT
Description of problem:

Date: Tue, 15 Jan 2008 13:54:20 -0500
From: Seppo Sahrakorpi <seppo@totalviewtech.com>
Organization: Totalview Technologies
User-Agent: Thunderbird 2.0.0.6 (X11/20070728)
MIME-Version: 1.0
To: Ben Woodard <bwoodard@llnl.gov>
Cc: Matt Wolfe <mwolfe@llnl.gov>,
       Nikolay Piskun <nikolay.piskun@totalviewtech.com>,
       seppo@totalviewtech.com
Subject: Update/help needed: Local variables not visible in C++ constructor
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Ben,

I would like to bring to your attention / update you on two bugs related
to local (static and non-static) variables in C++ constructor.

The short summary of the bugs is as follows: "In gcc 3.2.3 (and more
recent versions) the DWARF information created by gcc does not create
DW_AT_location attribute for (1) local static variables and (2) local
(non-static) static variables inside a C++ constructor."

We have reported these bugs to gcc-bugzilla, where they are not moving
very quickly. We were thinking that perhaps you could help in getting
these bugs fixed.

The local static variable problem is gcc-bug #33044, and the local
(non-static) variable problem is gcc-bug #27574.
http://gcc.gnu.org /bugzilla/show_bug.cgi?id=33044
http://gcc.gnu.org /bugzilla/show_bug.cgi?id=27574

The bug number #27574 is being reviewed by a new person right now.

The ("static") report #33044, seems to have stuck in the system, it
would be great if you could help finding someone who could give this a
look and move it forward.

Thanks,
Seppo

-- 
Seppo Sahrakorpi
Partner Technologies Engineer
TotalView Technologies, 24 Prime Parkway, Natick, MA 01760
Whiteboard	[It's All Text!] 
Version-Release number of selected component (if applicable):


How reproducible:
 always

Steps to Reproduce:
1. compile test programs
2.
3.
  
Actual results:


Expected results:


Additional info:

Seems similar to:
https://enterprise.redhat.com/issue-tracker/?module=issues&action=view&tid=39586
https://enterprise.redhat.com/issue-tracker/?module=issues&action=view&tid=57461



woodard assigned to issue for LLNL (HPC).

Date problem reported: 1-15-08

problem:
LLNL basically has a gcc issue that apparently has stalled out on the gcc
bugzilla lists. Both bugs are related to local (static and non-static) variables
in C++ constructor.  At this point we aren't sure if the two are actually one in
the same or separate issues.  The issue (according to the output sent in by Ben)
is still present even in the latest versions of the gcc compiler in RHEL5.1.

This has also been cloned for RHEL4.6 in IT 158679

What's needed from SEG / Engineering: The customer has asked for our help in
getting these issues resolved on the gcc lists so they can be ported to the RHEL
releases in a future fix.

Source file and readelf output from customer is attached.
From SEG:

 I've tried the patch described in http://gcc.gnu.org
/bugzilla/show_bug.cgi?id=27574 and while it does fix the problem in the
testcase, it breaks a million other things which is probably why it hasn't been
put into the upstream sources.
Comment 1 Alan Matsuoka 2008-05-09 15:34:33 EDT
Created attachment 304979 [details]
pr27574.C
Comment 2 Alan Matsuoka 2008-05-09 15:35:34 EDT
Created attachment 304980 [details]
pr27574.wi
Comment 3 RHEL Product and Program Management 2008-06-02 16:00:51 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 5 Issue Tracker 2008-08-26 02:22:19 EDT
Can I get an update on this one please.


This event sent from IssueTracker by woodard 
 issue 146253
Comment 7 Dodji Seketeli 2008-09-02 14:43:51 EDT
Hello,

I have done an anlysis for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33044 that lead to the problem report being closed upstream because the bug is invalid. Basically, there is enough debug info generated by GCC there for the debuggers (GDB and TotalView) to find the static variable. So I think the debuggers should be fixed.

For http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27574, I have tested the patch that is attached to the bug and it seems to work for me and passes the regression tests on the 4.1 branch. I have contacted the author of the patch to try to apply it upstream. I will update this bug accordingly when I have more info on that front.
Comment 8 Alan Matsuoka 2008-09-05 09:25:20 EDT
Further investigation by engineering points to a  gdb problem.
Comment 9 Jan Kratochvil 2008-10-05 17:44:23 EDT
Currently considering this GDB Bug only for _static_ variables:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33044

The _non-static_ variables are currently broken in GCC and still not committed even in GCC HEAD:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27574

(OTOH you are right for GDB it should be the same fix.)
Comment 10 Jan Kratochvil 2008-10-05 19:25:19 EDT
Created attachment 319510 [details]
Fix + testcase (of the _static_ variable).

Proof of the concept was more simple but it had quadratic complexity.
Comment 11 Jan Kratochvil 2008-10-06 07:52:14 EDT
Created attachment 319541 [details]
Fix + testcase (of the _static_ variable; updated).

Small QUIT-leak fix by make_cleanup().
Comment 12 Dodji Seketeli 2008-11-18 19:26:36 EST
Hello, I have committed a fix for the gcc bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27574 in trunk (upcoming 4.4), 4.3 and 4.2 branches. I believe this should fix the _non-static_ variables case in GCC.
Comment 13 Jan Kratochvil 2008-11-21 14:37:10 EST
_static_ variables GDB fix:
For F11 present in:
archer-jankratochvil-misc
60eb8684d0d85d0884aca7a2f013e5eb16a51d47
Comment 14 Petr Muller 2009-02-23 12:52:30 EST
qe_ack+, testcase in gdb.cp/abstract-origin.exp
Comment 15 Jan Kratochvil 2009-04-13 11:47:20 EDT
The post for FSF GDB (with no reply):
http://sourceware.org/ml/gdb-patches/2008-12/msg00367.html
Comment 16 Jan Kratochvil 2009-04-17 17:59:52 EDT
Built:
* Wed Apr 15 2009 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8-28
- Fix visibility of static variables in C++ constructors (BZ 445912).
Comment 18 Chris Ward 2009-07-03 14:02:46 EDT
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.
Comment 21 errata-xmlrpc 2009-09-02 07:26:17 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1361.html

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