JM: Some math operations don't load from backing stores

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: dvander, Assigned: dvander)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

Reduced test case is in the patch, and is most of the failures on the Stanford Crypto Library test suite. The bug is in the integer overflow path for ADD, SUB, and MUL. Sometimes the result register overlaps with an input data register. To rematerialize the input, a load is required.

However it used frame.addressOf(), which really must be used with extreme care when loads are involved. It will return the raw address of a copy, rather than following the copy to its backing store. The copy was not synced, so it was reading garbage.

This affected a few other uses of addressOf() as well. The attached patch introduces a version that follows copies and asserts a sync()'d state.
Created attachment 468241 [details] [diff] [review]
fix v2

SJCL tests pass with this.
Attachment #468212 - Attachment is obsolete: true
Attachment #468241 - Flags: review?(dmandelin)
Attachment #468212 - Flags: review?(dmandelin)
Created attachment 468328 [details] [diff] [review]
fix v2, correct patch
Attachment #468241 - Attachment is obsolete: true
Attachment #468328 - Flags: review?(dmandelin)
Attachment #468241 - Flags: review?(dmandelin)
Comment on attachment 468328 [details] [diff] [review]
fix v2, correct patch

Thanks for the excellent explanation of the cause and the workings of the fix!
Attachment #468328 - Flags: review?(dmandelin) → review+
http://hg.mozilla.org/projects/jaegermonkey/rev/c923a0329e02
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.