Closed Bug 1846122 Opened 1 year ago Closed 1 year ago

createJitRuntime is called even if JIT is disabled

Categories

(Core :: JavaScript Engine: JIT, defect)

Firefox 115
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: xry111, Unassigned)

Details

Steps to reproduce:

For details see https://gitlab.freedesktop.org/polkit/polkit/-/issues/199.

Actual results:

Even if JIT is disabled via setDisableIon, setWasmIon(false), and setAsmJS(false), createJitRuntime is still called by InitSelfHostedCode. So if W/X mapping is disabled, InitSelfHostedCode will crash.

Expected results:

If JIT is disabled, Spidermonkey (expect JIT) should still function normally even if W/X mapping cannot be created.

(In reply to Xi Ruoyao from comment #0)

Expected results:

If JIT is disabled, Spidermonkey (expect JIT) should still function normally even if W/X mapping cannot be created.

Sorry, I mean "except", not "expect".

(In reply to Xi Ruoyao from comment #0)

Even if JIT is disabled via setDisableIon, setWasmIon(false), and setAsmJS(false), createJitRuntime is still called by InitSelfHostedCode. So if W/X mapping is disabled, InitSelfHostedCode will crash.

This doesn't disable all the JITs. You should call JS::DisableJitBackend() before creating the first context/runtime (and before JS_Init*) and that should prevent the engine from reserving JIT memory.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME

(In reply to Jan de Mooij [:jandem] from comment #2)

(In reply to Xi Ruoyao from comment #0)

Even if JIT is disabled via setDisableIon, setWasmIon(false), and setAsmJS(false), createJitRuntime is still called by InitSelfHostedCode. So if W/X mapping is disabled, InitSelfHostedCode will crash.

This doesn't disable all the JITs. You should call JS::DisableJitBackend() before creating the first context/runtime (and before JS_Init*) and that should prevent the engine from reserving JIT memory.

Indeed it works.

You need to log in before you can comment on or make changes to this bug.