XDR-decoding can produce incorrect track-record-replay-progress flag
Categories
(Core Graveyard :: Web Replay, defect)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: bhackett1024, Assigned: bhackett1024)
References
Details
Attachments
(1 file, 2 obsolete files)
6.72 KB,
patch
|
tcampbell
:
review+
|
Details | Diff | Splinter Review |
When a script is XDR-decoded, its immutable flags (including whether to track record/replay progress) are set to those of the script which did the XDR-encoding. If the XDR-encoded script and XDR-decoded script are in processes with different values for IsRecordingOrReplaying(), we can get either incorrect behavior (progress values not being tracked when they should be) or crashes at null (calling a non-existent function pointer to get the progress counter address). I think this is causing some recent crashes.
The attached patch fixes this by resetting the flag after setting the immutable flags during XDR-decoding.
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
And sorry, I should have realized this :/
Assignee | ||
Comment 3•6 years ago
|
||
Updated patch. I don't think this needs to be updated in CopyScript, because CopyScript doesn't change the script's source object.
Comment 4•6 years ago
|
||
(In reply to Brian Hackett (:bhackett) from comment #3)
I don't think this needs to be updated in CopyScript, because CopyScript doesn't change the script's source object.
CopyScript doesn't copy the mutable flags so if we don't copy the flag explicitly we introduce a difference in behavior.
Thinking about it more, we should also fix the Ion code here to keep TSan from complaining:
Can you cache this flag on the CompileInfo?
Assignee | ||
Comment 5•6 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #4)
(In reply to Brian Hackett (:bhackett) from comment #3)
I don't think this needs to be updated in CopyScript, because CopyScript doesn't change the script's source object.
CopyScript doesn't copy the mutable flags so if we don't copy the flag explicitly we introduce a difference in behavior.
CopyScript operates on a destination script that went through CreateEmptyScriptForClone(), which calls JSScript::Create, which sets the TrackRecordReplayProgress flag. The source object used in this path (which affects whether the flag is set) is the one which the script will ultimately have, so the flag should already be set correctly by the time we get to CopyScript.
Thinking about it more, we should also fix the Ion code here to keep TSan from complaining:
Can you cache this flag on the CompileInfo?
I guess so, but I'm starting to feel that the original patch I wrote is the best fix here.
Assignee | ||
Comment 6•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Comment 7•6 years ago
|
||
Comment 8•6 years ago
•
|
||
In Bug 1525505, we fixed the issue of calling JSScript::Create with a bogus SSO. I believe that now that this is done, the best fix for this recordreplay bug is to simply move the |TrackRecordReplayProgress| flag to be a MutableFlag. The JSScript::Create function will compute the flag based on the SSO each time, and it will not be unnecessarily copied by XDR.
I'd like to maintain that ImmutableFlags are flags that are XDR-safe and be part of the input of an eventual pure parsing function.
In Bug 1525924, I've reworked the XDRScript code.
In Bug 1528964, I've reworked the CopyScript code.
Comment 9•6 years ago
|
||
Brian, with Bug 1525502 landed, does simply changing TrackRecordReplayProgress to MutableFlags fix the bug?
Assignee | ||
Comment 10•6 years ago
|
||
This patch makes TrackRecordReplayProgress a mutable flag, though I hesitate to call it simple.
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
Backed out changeset 133c2fc80e9c (bug 1528320) for causing multiple build bustages on BaselineCompiler.cpp CLOSED TREE
Backout revision https://hg.mozilla.org/integration/mozilla-inbound/rev/d0609ea11a18975a9de2e5e5650f54a53dff4514
Log failure https://treeherder.mozilla.org/logviewer.html#?job_id=229533634&repo=mozilla-inbound
https://treeherder.mozilla.org/logviewer.html#?job_id=229533645&repo=mozilla-inbound
https://treeherder.mozilla.org/logviewer.html#?job_id=229533694&repo=mozilla-inbound
:bhackett could you please take a look?
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
bugherder |
Assignee | ||
Updated•6 years ago
|
Updated•5 years ago
|
Description
•