Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions