PTAL, thanks, we found this during the V8 update in Node.js
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks for fixing this!
looks good, but could you please create a regression test for this issue?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
SLOW_DCHECK(array->IsSortedNoDuplicates());BTW, do these checks catch the issue?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks for fixing this!
looks good, but could you please create a regression test for this issue?
I tried to add a test, but it doesn't seem to be crashing without the patch. From what I can tell from the Node.js reproduction, it involves one special transition (with the frozen symbol), though it's a bit tricky to track down what was inserted in that reproduction which is fairly huge. I'll try to see if I can trace what exactly was inserted in that faulting object and in what order..
BTW, do these checks catch the issue?
From testing the Node.js built, the check caught it when there were duplicates, and the fix here was enough for me to turn these two into DCHECK and still pass the entire Node.js test suite.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
I looked into the reproduction a bit more and worked out a reproducing test. It basically goes like this:
1. During snapshot creation, Node.js grows the transitions of the cached map
2. After a round of snapshot serialization/deserialization, the transitions gets rehashed, so it's "shuffled" in terms of ordering based on the hash (in this case, it's an array of size 27)
3. TransitionAccessor:InsertHelper() assumes that the array is always sorted even if it's below the kMaxElementsForLinearSearch, and after rehashing that assumption gets broken. So once the insertion grows the size to 32 that broken assumption start to show.
Another fix might be to update `HeapObject::RehashBasedOnMap` so that it always sort the transition arrays even if their size is below the linear search size, though I feel that the current fix still seems more robust as it seems a bit shaky to assume the array must always be sorted even when it's below kMaxElementsForLinearSearch, and maintaining the sorting regardless of size also defeats the purpose of having this threshold.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |