DynamoRIO / DynamoRIO/drmemory

Possible leak in MinGW on use of std::cerr

Open
#2,228 7 comments 0 reactions 0 assignees View on GitHub
Bug-FalsePositive Component-LeakCheck Hotlist-Release OpSys-MinGW
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

drmemory detects any calls to std::cerr as a memory leak

for example:
```cpp
#include
using namespace std;

int main() {
cerr << "example text";
return 0;
}
```

when compiling and running this with drmemory, this is the following output
drmemory -visual_studio a.exe
```
Dr. Memory version 2.2.0
Running "a.exe"
example text
Error #1: POSSIBLE LEAK 12 bytes
replace_malloc
d:\drmemory_package\common\alloc_replace.c(2577):
libgcc_s_dw2-1.dll!?
??:0
libstdc++-6.dll!?
??:0
libstdc++-6.dll!?
??:0
_fu0___ZSt4cerr
drMemoryProblem.cpp(7):
__tmainCRTStartup
??:0
KERNEL32.dll!BaseThreadInitThunk
??:0

ERRORS FOUND:
0 unique, 0 total unaddressable access(es)
0 unique, 0 total uninitialized access(es)
0 unique, 0 total invalid heap argument(s)
0 unique, 0 total GDI usage error(s)
0 unique, 0 total handle leak(s)
0 unique, 0 total warning(s)
0 unique, 0 total, 0 byte(s) of leak(s)
1 unique, 1 total, 12 byte(s) of possible leak(s)
```

valgrind, on the other hand, does not display any errors.
I am on windows 10, if that helps provide any context.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.