Skip to content

LSAN_OPTIONS=malloc_context_size=1 results in all leaks being supressed #55906

Open
@sbc100

Description

@sbc100

We ended up patching LeakSuppressionContext::SuppressInvalid this in emscripten in order to avoid this issue:

https://github.com/emscripten-core/emscripten/blob/d8f677e301ca8877eae63940b934046f9376059b/system/lib/compiler-rt/lib/lsan/lsan_common.cpp#L186-L195

We advise users to use LSAN_OPTIONS=malloc_context_size=0 but this bug also effects anyone who sets it to 1. Basically if we limit the amount of stack frames we collect it causes GetCallerPC to return 0 for all leaks which in turn causes all leaks to be suppresed via SuppressInvalid.

While investigating I noticed that LSAN currently sets a lower limit of 1 for malloc_context_size (in FlagParser::parse_flags).. I suppose one possible solution to this issue would be to instead set this to 2.. since that is currently minimum required to get any leaks reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions