Closed Bug 822700 Opened 9 years ago Closed 8 years ago

[DMD] DMD-enabled builds running with DMD turned off crash when asked to dump memory reports

Categories

(Core :: DMD, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20
Tracking Status
firefox19 --- fixed
firefox20 --- fixed
b2g18 --- fixed

People

(Reporter: kats, Assigned: n.nethercote)

References

Details

Attachments

(2 files)

Attached file backtrace from gdb
I had a fennec build with --enable-dmd running without the DMD=1 environment variable. This meant that DMD was disabled (gDMDEnvVar was 0x0 and gIsDMDRunning was false). When I called nsIMemoryInfoDumper.DumpReportsToFile, it resulted in a crash. Backtrace is attached; it was segfaulting on JS_ASSERT(table) in Hashtable.h because "this" was 0x0 and "table" was garbage.
Assignee: nobody → n.nethercote
It'd be nice to have some more comprehensive DMD tests.  Hmm.
Comment on attachment 693643 [details] [diff] [review]
When DMD is disabled its SizeOf() function shouldn't try to measure non-existent structures.

Could you add a comment indicating that Sizes has a default zeroing constructor so you don't give the next person to read this a heart attack?  :)

r+a=me
Attachment #693643 - Flags: review?(justin.lebar+bug)
Attachment #693643 - Flags: review+
Attachment #693643 - Flags: approval-mozilla-b2g18+
Attachment #693643 - Flags: approval-mozilla-aurora+
> Could you add a comment indicating that Sizes has a default zeroing
> constructor so you don't give the next person to read this a heart attack? 

I added Sizes::Clear() and called it from both the constructor and SizeOf(), to avoid the need for a comment.

https://hg.mozilla.org/integration/mozilla-inbound/rev/a428738147c7
https://hg.mozilla.org/mozilla-central/rev/a428738147c7
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Component: General → DMD
You need to log in before you can comment on or make changes to this bug.