[wpt-sync] Sync PR 61678 - IndexedDB: assert a self-referential array key path exhausts the stack
Categories
(Core :: Storage: IndexedDB, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Attachments
(1 file)
|
221.98 KB,
text/plain
|
Details |
Sync web-platform-tests PR 61678 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/61678
Details from upstream follow.
Yusuke Suzuki <ysuzuki@apple.com> wrote:
IndexedDB: assert a self-referential array key path exhausts the stack
The "array loop -> stringify becomes ['']" case built a self-referential array and used it as an object store key path:
let loop_array = []; loop_array.push(loop_array);A sequence key path is converted with the WebIDL sequence<DOMString> conversion, so each item goes through ToString. For item 0 that is ToString(loop_array), which is Array.prototype.toString -> Array.prototype.join, and join converts element 0 with ToString again.
ECMA-262 defines no cycle detection for Array.prototype.join (https://tc39.es/ecma262/#sec-array.prototype.join), so that recursion is unbounded and the conversion cannot complete. The case asserted that the key path becomes [''] and each value is used as its own key, which only happens in an engine that non-normatively remembers the receivers it is already converting and substitutes the empty string on a repeat visit.
Assert the outcome the specification implies instead: the conversion exceeds an implementation limit and reports an error rather than quietly producing ['']. Every engine signals stack exhaustion with a RangeError.
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=109386
| Assignee | ||
Comment 2•1 month ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 820 tests and 1 subtests
Status Summary
Firefox
OK : 4[GitHub] 629[Gecko-windows11-32-25h2-debug] 643[Gecko-windows11-64-25h2-debug] 817[Gecko-windows11-32-25h2-opt] 818[Gecko-android-em-14-x86_64-debug-geckoview] 819[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-opt]
PASS: 76[GitHub] 3888[Gecko-windows11-64-25h2-debug] 3894[Gecko-windows11-32-25h2-debug] 5825[Gecko-android-em-14-x86_64-debug-geckoview] 5830[Gecko-windows11-32-25h2-opt] 5832[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 5835[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-opt]
FAIL: 4[GitHub] 17[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 20[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview]
Chrome
OK : 4
PASS: 76
FAIL: 4
Safari
OK : 4
PASS: 76
FAIL: 4
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
(See attachment for full changes)
Comment 4•24 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/16e5972274e0
https://hg.mozilla.org/mozilla-central/rev/608eb76c0b1e
Description
•