Skip to content

Heap snapshot crash on v14.x #42558

@legendecas

Description

@legendecas

Version

v14.19.1

Platform

all

Subsystem

v8 engine

What steps will reproduce the bug?

Run the following script:

function that() {
  const p = new Promise(resolve => {
    setTimeout(resolve, 1);
  });
  Promise.all([p]); // <= The key problem here, it created a PromiseAllResolveElementContext which crashes the HeapSnapshotGenerator
}
that();

const v8 = require('v8');
const fs = require('fs');
const stream = fs.createWriteStream('./node.heapsnapshot');
v8.getHeapSnapshot().pipe(stream);

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

No crashes.

What do you see instead?

The program crashed with SIGSEGV.

image

Additional information

Node.js v16.x doesn't have this problem. So I'd think we may need to find the v8 commit that fixed the problem and backport it to v14.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions