Skip to content

"pure virtual method called" when creating a heap snapshot #28786

Closed
@laino

Description

@laino
  • Version: v11.15.0
  • Platform: Linux

Run the following script with node --inspect script.js, connect a debugger with Google Chrome and instruct it to do a heap snapshot.

Edit: See my comment below for a better snippet.

function memoryLeak() {
    return new Promise(() => {});
}

function loop() {
    for (let i = 0; i < 10000; i++) {
        memoryLeak();
    }

    setTimeout(loop, 0);
}

loop();

Roughly half of the time node will crash with "pure virtual method called".

That code actually causes a memory leak, but it will likely be annoying to debug if this isn't fixed first.

Metadata

Metadata

Assignees

Labels

async_hooksIssues and PRs related to the async hooks subsystem.confirmed-bugIssues with confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions