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 reported in tests with gcc compilers #364

Open
dschlaep opened this issue Aug 3, 2023 · 1 comment
Open

Memory leak reported in tests with gcc compilers #364

dschlaep opened this issue Aug 3, 2023 · 1 comment
Labels
Milestone

Comments

@dschlaep
Copy link
Member

dschlaep commented Aug 3, 2023

gcc compilers report a memory leak in our tests; all tested versions of gcc show this, i.e., gcc10, gcc11, and gcc12

Running the leaks command

CXX=g++ make clean test
leaks -quiet -atExit -- bin/sw_test

will report the following leak:

Process 63324: 230 nodes malloced for 115 KB
Process 63324: 1 leak for 16 total leaked bytes.

1 (16 bytes) ROOT LEAK: 0x60000234c000 [16]

Running leaks with the flag MallocStackLogging

MallocStackLogging=1 leaks -quiet -atExit -- bin/sw_test

provides additional information:

Process 63514: 233 nodes malloced for 115 KB
Process 63514: 1 leak for 16 total leaked bytes.

STACK OF 1 INSTANCE OF 'ROOT LEAK: malloc<16>':
9 dyld 0x1053f50d8 start + 596
8 libdyld.dylib 0x1c1684ec4 dyld4::LibSystemHelpers::getenv(char const*) const + 0
7 libsystem_c.dylib 0x1c1563b74 exit + 44
6 libsystem_c.dylib 0x1c1563dd0 __cxa_finalize_ranges + 464
5 libstdc++.6.dylib 0x1054b67e4 0x1054a4000 + 75748
4 libstdc++.6.dylib 0x1055027e0 std::ostream::flush() + 72
3 libstdc++.6.dylib 0x105502748 std::ostream::sentry::~sentry() + 44
2 libstdc++.6.dylib 0x1054af34c std::uncaught_exception() + 12
1 libstdc++.6.dylib 0x1054af4cc __cxa_get_globals + 52
0 libsystem_malloc.dylib 0x1c14a37bc _malloc_zone_malloc + 272

1 (16 bytes) ROOT LEAK: 0x6000028bc000 [16]

@dschlaep
Copy link
Member Author

dschlaep commented Aug 3, 2023

This looks very much like the case reported and discussed here on stackoverflow:

this is a bug in certain versions of glibc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant