Closed Bug 1149739 Opened 6 years ago Closed 6 years ago

Censor |performance| object in JS_MORE_DETERMINISTIC builds

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: jruderman, Assigned: sfink)

References

Details

(Keywords: testcase)

Attachments

(1 file)

|performance.mozMemory| was added to the js shell in bug 1125412. Gary noticed that it trips up differential testing, when the fuzzer generates code like:

> print(JSON.stringify(this))
{ ... "mozMemory": { ... "gcBytes": 237568 ... } ... }

Where would be the best place to hide this information in JS_MORE_DETERMINISTIC builds? I'm thinking either:

A) Where the performance object is created
https://hg.mozilla.org/mozilla-central/file/18a8ea7c2c62/js/src/shell/js.cpp#l5650

B) Where the mozMemory object is populated
https://hg.mozilla.org/mozilla-central/file/18a8ea7c2c62/js/src/jsgc.cpp#l7245
Steve worked on bug 1125412, adding needinfo? from him.
Flags: needinfo?(sphink)
Yep, this was totally me. I'm not sure what the right place to cut this is, but I don't suppose it really matters. I was worried that making the JS::NewMemoryInfoObject call fail might mess up initialization without further fixes, and returning an empty object is a little odd because in my code, I feature-test the existence of performance.mozMemory. How about this?
Attachment #8587617 - Flags: review?(terrence)
Assignee: nobody → sphink
Status: NEW → ASSIGNED
Comment on attachment 8587617 [details] [diff] [review]
Nerf performance.mozMemory ifdef JS_MORE_DETERMINISTIC

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

wfm
Attachment #8587617 - Flags: review?(terrence) → review+
https://hg.mozilla.org/mozilla-central/rev/1d672188b8aa
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.