Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak #134

Open
javiertejedorm opened this issue Feb 16, 2020 · 4 comments
Open

Memory Leak #134

javiertejedorm opened this issue Feb 16, 2020 · 4 comments
Labels
compiler-rt:lsan Leak sanitizer compiler-rt:ubsan Undefined behavior sanitizer

Comments

@javiertejedorm
Copy link

javiertejedorm commented Feb 16, 2020

Hello,
I am calling to the function __sanitizer_symbolize_pc several times from my application and it is leaking memory.

I have executed also your tests inside an endless loop and they are also leaking memory:

https://github.com/llvm/llvm-project/blob/master/compiler-rt/test/sanitizer_common/TestCases/symbolize_pc.cpp

#include <sanitizer/common_interface_defs.h>

int main() {

    void *PC = __builtin_return_address(0);
    char PcDescr[1024];

    for(;;){

        __sanitizer_symbolize_pc(PC, "%p %F %L", PcDescr, sizeof(PcDescr));

    }

    return 0;
}

I also detected __sanitizer_symbolize_global. I haven't tested the rest of the API.

Is there any other way that I can use to avoid this problem? I need to extract the function and the source file from the PC.

Thanks.

@androm3da
Copy link
Member

It's entirely possible that you have found a defect but how do you know there's a leak?

@javiertejedorm
Copy link
Author

Thanks for the replay. I'm running it in Ubuntu. I am monitoring the process with System Monitor (or top command) and I see that the memory consumed by the process increases without stop.

@androm3da
Copy link
Member

You are looking at the RSS and it is growing unbounded? Even still this could be a confusing signal. As long as the memory is released before the program exits, it's not a leak.

Generally I'd advise that you use LeakSanitizer to check but it's not clear to me whether you could safely do that with sanitizer code itself.

Maybe it would be better to discuss what led you to start looking there?

@javiertejedorm
Copy link
Author

Yes, I am looking at the Memory field of top and it grows unbounded (until the system starts consuming the swap memory and hangs)
I am using LeakSanitizer and it does not detect any leak.
The memory could be released when it exits but my program does not exit, the user decides it.
I think, after returning from __sanitizer_symbolize_pc the memory should be already released.

@RKSimon RKSimon added compiler-rt:ubsan Undefined behavior sanitizer compiler-rt:lsan Leak sanitizer labels Apr 12, 2022
lanza pushed a commit to lanza/llvm-project that referenced this issue Feb 8, 2024
…lineAttr (llvm#134)

Setting inline attributes based on user input and command line options.
This is optional as functions do not need such an attribute will not get
the attribute.
pysuxing pushed a commit to pysuxing/llvm-project that referenced this issue Jul 17, 2024
…lineAttr (llvm#134)

Setting inline attributes based on user input and command line options.
This is optional as functions do not need such an attribute will not get
the attribute.
pysuxing pushed a commit to pysuxing/llvm-project that referenced this issue Jul 17, 2024
…lineAttr (llvm#134)

Setting inline attributes based on user input and command line options.
This is optional as functions do not need such an attribute will not get
the attribute.
skatrak added a commit to skatrak/llvm-project that referenced this issue Aug 13, 2024
…#134)

This patch removes the `LoopWrapperInterface` from `omp.parallel` and updates
the semantics of the interface to make loop wrapper restrictions mandatory to
operations that have it, rather than a role they might optionally take.

MLIR operation verifiers are updated to expect the "hoisted omp.parallel"
representation for `distribute parallel do`, to be later implemented in place
of a loop wrapper `omp.parallel`.
keryell pushed a commit to keryell/llvm-project that referenced this issue Oct 19, 2024
…lineAttr (llvm#134)

Setting inline attributes based on user input and command line options.
This is optional as functions do not need such an attribute will not get
the attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-rt:lsan Leak sanitizer compiler-rt:ubsan Undefined behavior sanitizer
Projects
None yet
Development

No branches or pull requests

3 participants