-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
Description
Version
v18.6.0
Platform
Darwin
Subsystem
vm
What steps will reproduce the bug?
Run node with node --experimental-vm-modules --max-heap-size=128 test.js
, and "test.js" as:
const vm = require('vm');
function work() {
const context = vm.createContext({});
const fn = vm.compileFunction(`
import('foo').then(() => {});
`, [], {
parsingContext: context,
importModuleDynamically: async (specifier, fn, importAssertions) => {
const m = new vm.SyntheticModule(['x'], () => {
m.setExport('x', 1);
}, {
context,
});
await m.link(() => {});
await m.evaluate();
return m;
},
});
fn();
}
(function main() {
work()
// yielding to give chance to the evaluation of promises.
setTimeout(main, 1);
})();
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
Should not crash as OOM.
What do you see instead?
The program crashed with OOM shortly.
Additional information
Opening this issue to track the problem #44198 (comment).
yehor-manzhula, kirillgroshkov, viceice, SimenB, lencioni and 32 more
Metadata
Metadata
Assignees
Labels
vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.