Skip to content

vm.compileFunction is crashing the node process with unknown error #27256

Closed
@kalinkrustev

Description

@kalinkrustev
  • Version: 10.15.3
  • Platform: Windows 10
  • Subsystem: vm

The following simple script crashes the node process with no apparent reason:

const vm = require('vm');
console.log(process.version);
vm.compileFunction('return', ['ab'.replace('b', 'b'.repeat(12)).split('').join('')]);
console.log('compiled ok 1');
vm.compileFunction('return', ['ab'.replace('b', 'b'.repeat(11))]);
console.log('compiled ok 2');
try {
    vm.compileFunction('return', ['ab'.replace('b', 'b'.repeat(12))]); // crash here
    console.log('compiled ok 3');
} catch (e) { // no exception was caught
    console.error(e);
}

Output:

v10.15.3
compiled ok 1
compiled ok 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.v8 engineIssues and PRs related to the V8 dependency.vmIssues and PRs related to the vm subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions