turn on debug mode for libstdc++ headers

REOPENED
Assigned to

Status

task
REOPENED
3 years ago
Last month

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

unspecified
mozilla49

Firefox Tracking Flags

(firefox49 fixed)

Details

Attachments

(1 attachment)

STL usages have crept into the tree and will continue to creep in, especially
as we move to a C++11 STL implementation everywhere.  Let's at least enable a
bit of checking for those data structures so we're not completely shooting
ourselves in the foot.
This patch seems to work; the FIXME appears to be no longer applicable with
newer GCC:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d9eb75e3d99
Attachment #8749640 - Flags: review?(mh+mozilla)
Comment on attachment 8749640 [details] [diff] [review]
turn on debug mode for libstdc++ headers

Review of attachment 8749640 [details] [diff] [review]:
-----------------------------------------------------------------

::: config/gcc-stl-wrapper.template.h
@@ -45,5 @@
>  
>  #if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)
>  // Enable checked iterators and other goodies
> -//
> -// FIXME/bug 551254: gcc's debug STL implementation requires -frtti.

Is this comment outdated?
Attachment #8749640 - Flags: review?(mh+mozilla)
(In reply to Mike Hommey [:glandium] from comment #2)
> Comment on attachment 8749640 [details] [diff] [review]
> turn on debug mode for libstdc++ headers
> 
> Review of attachment 8749640 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: config/gcc-stl-wrapper.template.h
> @@ -45,5 @@
> >  
> >  #if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)
> >  // Enable checked iterators and other goodies
> > -//
> > -// FIXME/bug 551254: gcc's debug STL implementation requires -frtti.
> 
> Is this comment outdated?

This comment appears to stem from bug 551254 comment 30, but the libstdc++ debug mode documentation makes no mention of the -frtti constraint:

https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode_using.html#debug_mode.using.mode

The only instances of |typeid| I can find in the debug headers are all guarded by preprocessor checks that RTTI is enabled.  Spelunking in libstdc++ leads me to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160 , which would have been fixed somewhere in the GCC 4.5 timeframe.  So yes, I think this comment is outdated.  OK to commit, then?
Flags: needinfo?(mh+mozilla)
Attachment #8749640 - Flags: review+
Flags: needinfo?(mh+mozilla)
(In reply to Pulsebot from comment #6)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/ccff1c4580ab

This revision landed with a change to ignore debug headers for static analysis.  We're not running the static analysis build, so I figure that not having the debug-ness turned on here is not a bad thing.
https://hg.mozilla.org/mozilla-central/rev/ccff1c4580ab
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Backed out in
https://hg.mozilla.org/integration/mozilla-inbound/rev/a640e6fa8ab9
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Product: Core → Firefox Build System
The fuzzing team was interested in this; they may also be interested in comment 9, and the commit message for the backout.
You need to log in before you can comment on or make changes to this bug.