Assert pointer is aligned to Value size in Poison functions
Categories
(Core :: JavaScript Engine, enhancement, P5)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
Details
Attachments
(1 file)
bug 1677224 comment #7 failure is caused by passing non-Value-size-aligned pointer to AlwaysPoison.
the function signature or comment doesn't imply the pointer should be Value-size-aligned,
but the underlying impl casts the pointer to JS::Value*
.
It should have debug assert about the alignment
Assignee | ||
Comment 1•3 years ago
|
||
if we pass not-Value-size-aligned pointer to Poison function, it results in Segmentation Fault in PodSet
.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/1e7cd648ecd5 Assert pointer is aliged to JS::Value size in Poison functions. r=jonco
Comment 4•3 years ago
•
|
||
Backed out for perma failures.
Logs:
https://treeherder.mozilla.org/logviewer?job_id=324798682&repo=autoland&lineNumber=3230
https://treeherder.mozilla.org/logviewer?job_id=324799862&repo=autoland&lineNumber=1704
Backout: https://hg.mozilla.org/integration/autoland/rev/fe225435be7c3417e5a572d740e5695784e6b6ff
Assignee | ||
Comment 5•3 years ago
|
||
looks like the assumption here holds only on 64-bit arch.
on 32-bit arch, minimum requirement for the pointers passed to Poison are 4-bytes-aligned (=pointer-size), and that doesn't match alignas(8)
for JS::Value
.
I wonder if reinterpret_cast<JS::Value*>
is valid here.
also, if the pointer doesn't align with 8 bytes, filling the memory block with poisoned object from the beginning doesn't contribute to safe crash,
given that value tag isn't in correct position when reading the block as Value.
maybe we should treat leading non-Value-size-aligned block separately on 32-bit arch?
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/a092c8578144 Assert pointer is aliged to JS::Value size in Poison functions on 64-bit arch. r=jonco
Comment 7•3 years ago
|
||
bugherder |
Description
•