Closed Bug 1716324 Opened 3 years ago Closed 3 years ago

Call JS_SetNativeStackQuota when creating the JSContext

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Not calling JS_SetNativeStackQuota can result in weird behavior. I think this is because we initialize jitStackLimit and jitStackLimitNoInterrupt to UINTPTR_MAX.

We should probably just call this with a value of 128 KB or so when we initialize the JSContext. Embedders can still override it, of course, but if they forget to call JS_SetNativeStackQuota they'd still get reasonable behavior.

Flags: needinfo?(jdemooij)
Blocks: sm-embedding

Uses the stack limit values currently used for the JS shell. This fixes confusing
behavior when the embedding forgets to call JS_SetNativeStackQuota.

Attachment #9226830 - Attachment description: Bug 1716324 part 2 - Rely on default stack size for jsapi-tests, gdb-test and JS shell main thread. r?tcampbell! → Bug 1716324 part 2 - Rely on default stack size for jsapi-tests, gdb-tests, and JS shell main thread. r?tcampbell!
Flags: needinfo?(jdemooij)
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d2aa7be66c9c
part 1 - Set default stack quota when creating the JSContext. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/0b62a8d087fd
part 2 - Rely on default stack size for jsapi-tests, gdb-tests, and JS shell main thread. r=tcampbell
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
No longer regressions: 1773650
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: