Skip to content

Memory leak in Relooper Optimizer #3094

@dcodeIO

Description

@dcodeIO

There is a memory leak at the end of Optimizer::SkipEmptyBlocks

// FIXME do we leak old unused Branches?
CurrBlock->BranchesOut.swap(NewBranchesOut);

where the answer to the question appears to be "yes" according to LSan.

Steps to reproduce:

  • Compile with -fsanitize=address
  • Run check.py wasm-opt --filter=*flatten_rereloop*

I tried to naively iterate through the swapped NewBranchesOut and find the branches not contained in CurrBlock->BranchesOut anymore, and that found some, but this didn't fix the problem entirely. Requesting expert support once more :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions