Closed Bug 1998179 Opened 9 months ago Closed 8 months ago

Testcase calling async.iterator N times shows over-recursion error. Chrome appears to run it fine.

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: mayankleoboy1, Assigned: arai)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

Attached file async iteration.html

Open testcase and click on run.

chrome: https://share.firefox.dev/47UtB73
firefox: Uncaught (in promise) InternalError: too much recursion

shows error with/without the new js-utask.

there's a recursion with the following:
AsyncGeneratorResume -> AsyncGeneratorYield -> AsyncGeneratorUnwrapYieldResumption -> AsyncGeneratorResume

We should instead make it a loop inside AsyncGeneratorResume, with letting AsyncGeneratorYield and AsyncGeneratorUnwrapYieldResumption return a special value for the case.

Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED

N=5000000: https://share.firefox.dev/4oGLHzL

It also sometimes goes into a weird state: https://share.firefox.dev/4ovQFPK

Blocks: sm-runtime
Severity: -- → N/A
Priority: -- → P3
Pushed by arai_a@mac.com: https://github.com/mozilla-firefox/firefox/commit/93b533769665 https://hg.mozilla.org/integration/autoland/rev/6eb4df605cca Part 1: Add a dummy loop in AsyncGeneratorResume as a preparation . r=mgaudet https://github.com/mozilla-firefox/firefox/commit/937372ef80f6 https://hg.mozilla.org/integration/autoland/rev/641448b8955e Part 2: Use loop instead of recursion for the continuation after yield in async generator. r=mgaudet
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch

50000: https://share.firefox.dev/3WSfFnY (43ms)
5000000: https://share.firefox.dev/47OC1vH (15s)

Edit: seems heavy on js::NativeObject::elementsRangePostWriteBarrier

So taking a quick peek at that profile, it seems like part of the issue here is that we run into a gently awkward cliff; basically once a ListObject exceeds 2047 elements, we start having to actually -move- elements, triggering heaps of barrier cost.

Now, what we're manipulating is the generator object queue, so. I suspect this is rare outside of test cases. I hope.

QA Whiteboard: [qa-triage-done-c148/b147]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: