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.

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.
Version
v14.19.1
Platform
all
Subsystem
v8 engine
What steps will reproduce the bug?
Run the following script:
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.
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.