Open Bug 936279 Opened 11 years ago Updated 2 years ago

NS_RUNTIMEABORT puts file paths into release builds

Categories

(Core :: XPCOM, defect)

x86_64
Windows 7
defect

Tracking

()

People

(Reporter: away, Unassigned)

References

Details

On currently shipping builds I see over 400 file paths in xul. I believe the vast majority of these come from NS_RUNTIMEABORT. They all start with e:/builds/moz2_slave/rel-m-rel-w32_bld-000000000000/build/ (58 characters) and let's say there's an average of 50% more for the actual source path, and that adds up to 35KB.

Most of the assertion macros compile down to nothing in opt builds, but NS_RUNTIMEABORT is deliberately left enabled. Does it really need to use __FILE__ outside of debug though?

Maybe having file names is valuable enough for investigations to be worth the cost. Or maybe it was just an oversight. I don't know.
I'd think that the stack in the crash report would be enough.
And there's probably another dozen or two KB in the abort messages, though perhaps those are more valuable.
The stack in the crash report is not always reliable, especially in low-memory situations, and the abort message including the file name is sometimes quite valuable. But really all we need is the leafname, not the full path.
(In reply to comment #3)
> The stack in the crash report is not always reliable, especially in low-memory
> situations, and the abort message including the file name is sometimes quite
> valuable. But really all we need is the leafname, not the full path.

Well, all that we have at our disposal is __FILE__.
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #4)
> (In reply to comment #3)
> > The stack in the crash report is not always reliable, especially in low-memory
> > situations, and the abort message including the file name is sometimes quite
> > valuable. But really all we need is the leafname, not the full path.
> 
> Well, all that we have at our disposal is __FILE__.

not really, we could have the build system pass the compiler -DMOZ_FILE=$(basename $CPP_FILE) and then use MOZ_FILE instead of __FILE__ in places like this.

(seems relevent to froydnj's interests so cc += him)
(In reply to comment #5)
> (In reply to :Ehsan Akhgari (needinfo? me!) from comment #4)
> > (In reply to comment #3)
> > > The stack in the crash report is not always reliable, especially in low-memory
> > > situations, and the abort message including the file name is sometimes quite
> > > valuable. But really all we need is the leafname, not the full path.
> > 
> > Well, all that we have at our disposal is __FILE__.
> 
> not really, we could have the build system pass the compiler
> -DMOZ_FILE=$(basename $CPP_FILE) and then use MOZ_FILE instead of __FILE__ in
> places like this.

That will break in a number of cases, such as unfiied builds, code in headers, etc.
Depends on: 1024168
No longer depends on: 1024168
Depends on: 1412048
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.