0

I am using the latest apt packages on Ubuntu 18.04.6:

  • Boost 1.65.1
  • valgrind-3.13.0

Here is the test file; it intentionally doesn't include any tests:

// temp.cpp
#define BOOST_TEST_MODULE some_name_here
#include <boost/test/included/unit_test.hpp>

The source is compiled then linked like this (dumped from cmake):

/usr/bin/clang++-12    -O3 -DNDEBUG   -Wall -Wextra -O0 -g -std=gnu++17 -o temp.o -c temp.cpp
/usr/bin/clang++-12  -O3 -DNDEBUG   temp.o  -o temp /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so

I invoke valgrind on the executable:

valgrind --leak-check=full          --show-leak-kinds=all          --track-origins=yes          --verbose          --log-file=valgrind-out.txt ./temp

Which yields this error log:

==4820== Memcheck, a memory error detector
==4820== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4820== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==4820== Command: ./temp
==4820== Parent PID: 10928
==4820== 
--4820-- 
--4820-- Valgrind options:
--4820--    --leak-check=full
--4820--    --show-leak-kinds=all
--4820--    --track-origins=yes
--4820--    --verbose
--4820--    --log-file=valgrind-out.txt
--4820-- Contents of /proc/version:
--4820--   Linux version 5.15.90.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Jan 27 02:56:13 UTC 2023
--4820-- 
--4820-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--4820-- Page sizes: currently 4096, max supported 4096
--4820-- Valgrind library directory: /usr/lib/valgrind
--4820-- Reading syms from /home/john/choose/temp
--4820-- Reading syms from /lib/x86_64-linux-gnu/ld-2.27.so
--4820--   Considering /lib/x86_64-linux-gnu/ld-2.27.so ..
--4820--   .. CRC mismatch (computed 2977d8b2 wanted c64f09ed)
--4820--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.27.so ..
--4820--   .. CRC is valid
--4820-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--4820--   Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--4820--   .. CRC mismatch (computed 41ddb025 wanted 9972f546)
--4820--    object doesn't have a symbol table
--4820--    object doesn't have a dynamic symbol table
--4820-- Scheduler: using generic scheduler lock implementation.
--4820-- Reading suppressions file: /usr/lib/valgrind/default.supp
==4820== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-4820-by-john-on-???
==4820== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-4820-by-john-on-???
==4820== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-4820-by-john-on-???
==4820== 
==4820== TO CONTROL THIS PROCESS USING vgdb (which you probably
==4820== don't want to do, unless you know exactly what you're doing,
==4820== or are doing some strange experiment):
==4820==   /usr/lib/valgrind/../../bin/vgdb --pid=4820 ...command...
==4820== 
==4820== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==4820==   /path/to/gdb ./temp
==4820== and then give GDB the following command
==4820==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=4820
==4820== --pid is optional if only one valgrind process is running
==4820== 
--4820-- REDIR: 0x4020d20 (ld-linux-x86-64.so.2:strlen) redirected to 0x580608c1 (???)
--4820-- REDIR: 0x4020b00 (ld-linux-x86-64.so.2:index) redirected to 0x580608db (???)
--4820-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--4820--   Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--4820--   .. CRC mismatch (computed 50df1b30 wanted 4800a4cf)
--4820--    object doesn't have a symbol table
--4820-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--4820--   Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--4820--   .. CRC mismatch (computed f893b962 wanted 95ee359e)
--4820--    object doesn't have a symbol table
==4820== WARNING: new redirection conflicts with existing -- ignoring it
--4820--     old: 0x04020d20 (strlen              ) R-> (0000.0) 0x580608c1 ???
--4820--     new: 0x04020d20 (strlen              ) R-> (2007.0) 0x04c34db0 strlen
--4820-- REDIR: 0x401d540 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c35ee0 (strcmp)
--4820-- REDIR: 0x4021260 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c394f0 (mempcpy)
--4820-- Reading syms from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1
--4820--    object doesn't have a symbol table
--4820-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29
--4820--    object doesn't have a symbol table
--4820-- Reading syms from /lib/x86_64-linux-gnu/libm-2.27.so
--4820--   Considering /lib/x86_64-linux-gnu/libm-2.27.so ..
--4820--   .. CRC mismatch (computed 4e7cf542 wanted 8d27f134)
--4820--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.27.so ..
--4820--   .. CRC is valid
--4820-- Reading syms from /lib/x86_64-linux-gnu/libgcc_s.so.1
--4820--    object doesn't have a symbol table
--4820-- Reading syms from /lib/x86_64-linux-gnu/libc-2.27.so
--4820--   Considering /lib/x86_64-linux-gnu/libc-2.27.so ..
--4820--   .. CRC mismatch (computed f250d419 wanted 4aacab51)
--4820--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so ..
--4820--   .. CRC is valid
--4820-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.27.so
--4820--   Considering /usr/lib/debug/.build-id/1f/06001733b9be9478b105faf0dac6bdf36c85de.debug ..
--4820--   .. build-id is valid
--4820-- REDIR: 0x5b6aa50 (libc.so.6:memmove) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b69d60 (libc.so.6:strncpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6ad30 (libc.so.6:strcasecmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b697b0 (libc.so.6:strcat) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b69d90 (libc.so.6:rindex) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6c480 (libc.so.6:rawmemchr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6abc0 (libc.so.6:mempcpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6a9f0 (libc.so.6:bcmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b69d20 (libc.so.6:strncmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b69820 (libc.so.6:strcmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6ab20 (libc.so.6:memset) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b87db0 (libc.so.6:wcschr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b69cc0 (libc.so.6:strnlen) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b69890 (libc.so.6:strcspn) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6ad80 (libc.so.6:strncasecmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b69860 (libc.so.6:strcpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6aec0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b69dc0 (libc.so.6:strpbrk) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b697e0 (libc.so.6:index) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b69c90 (libc.so.6:strlen) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b74380 (libc.so.6:memrchr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6add0 (libc.so.6:strcasecmp_l) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6a9c0 (libc.so.6:memchr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b88b70 (libc.so.6:wcslen) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6a070 (libc.so.6:strspn) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6ad00 (libc.so.6:stpncpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6acd0 (libc.so.6:stpcpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6c4b0 (libc.so.6:strchrnul) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5b6ae20 (libc.so.6:strncasecmp_l) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--4820-- REDIR: 0x5c5a280 (libc.so.6:__strrchr_avx2) redirected to 0x4c34730 (rindex)
--4820-- REDIR: 0x5b63020 (libc.so.6:malloc) redirected to 0x4c31aa0 (malloc)
--4820-- REDIR: 0x5c5a450 (libc.so.6:__strlen_avx2) redirected to 0x4c34cf0 (strlen)
--4820-- REDIR: 0x5c56a60 (libc.so.6:__memcmp_avx2_movbe) redirected to 0x4c37e00 (bcmp)
--4820-- REDIR: 0x5b75b30 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c35da0 (strcmp)
--4820-- REDIR: 0x5c513d0 (libc.so.6:__strncmp_sse42) redirected to 0x4c35570 (__strncmp_sse42)
--4820-- REDIR: 0x5c5a990 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x4c386e0 (memmove)
--4820-- REDIR: 0x51b1c60 (libstdc++.so.6:operator new(unsigned long)) redirected to 0x4c32110 (operator new(unsigned long))
--4820-- REDIR: 0x5b66050 (libc.so.6:calloc) redirected to 0x4c33a70 (calloc)
--4820-- REDIR: 0x51aff20 (libstdc++.so.6:operator delete(void*)) redirected to 0x4c331d0 (operator delete(void*))
--4820-- REDIR: 0x5c5ae10 (libc.so.6:__memset_avx2_unaligned_erms) redirected to 0x4c385d0 (memset)
--4820-- REDIR: 0x5c5a090 (libc.so.6:__strchrnul_avx2) redirected to 0x4c39020 (strchrnul)
--4820-- REDIR: 0x5c565b0 (libc.so.6:__rawmemchr_avx2) redirected to 0x4c39050 (rawmemchr)
--4820-- REDIR: 0x51b1cc0 (libstdc++.so.6:operator new[](unsigned long)) redirected to 0x4c32830 (operator new[](unsigned long))
--4820-- REDIR: 0x5b63910 (libc.so.6:free) redirected to 0x4c32cd0 (free)
--4820-- REDIR: 0x51aff50 (libstdc++.so.6:operator delete[](void*)) redirected to 0x4c336d0 (operator delete[](void*))
==4820== Invalid free() / delete / delete[] / realloc()
==4820==    at 0x4C3323B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x5B0F604: __cxa_finalize (cxa_finalize.c:83)
==4820==    by 0x4E7DE62: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x4010D12: _dl_fini (dl-fini.c:138)
==4820==    by 0x5B0F030: __run_exit_handlers (exit.c:108)
==4820==    by 0x5B0F129: exit (exit.c:139)
==4820==    by 0x5AEDC8D: (below main) (libc-start.c:344)
==4820==  Address 0x60ef3c0 is 0 bytes inside a block of size 18 free'd
==4820==    at 0x4C3323B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x5B0F030: __run_exit_handlers (exit.c:108)
==4820==    by 0x5B0F129: exit (exit.c:139)
==4820==    by 0x5AEDC8D: (below main) (libc-start.c:344)
==4820==  Block was alloc'd at
==4820==    at 0x4C3217F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x4B4C6B: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag) (basic_string.tcc:219)
==4820==    by 0x4B4BE4: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct_aux<char const*>(char const*, char const*, std::__false_type) (basic_string.h:247)
==4820==    by 0x4B4B64: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*) (basic_string.h:266)
==4820==    by 0x46998D: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::allocator<char> >(char const*, std::allocator<char> const&) (basic_string.h:527)
==4820==    by 0x432337: __cxx_global_var_init.311 (unit_test_parameters.ipp:98)
==4820==    by 0x432651: _GLOBAL__sub_I_temp.cpp (temp.cpp:0)
==4820==    by 0x4D1E6C: __libc_csu_init (in /home/john/choose/temp)
==4820==    by 0x5AEDC17: (below main) (libc-start.c:266)
==4820== 
==4820== 
==4820== HEAP SUMMARY:
==4820==     in use at exit: 102 bytes in 5 blocks
==4820==   total heap usage: 3,016 allocs, 3,016 frees, 262,209 bytes allocated
==4820== 
==4820== Searching for pointers to 5 not-freed blocks
==4820== Checked 152,728 bytes
==4820== 
==4820== 18 bytes in 1 blocks are definitely lost in loss record 1 of 5
==4820==    at 0x4C3217F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x4EB84DC: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x4E7DB1C: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x40108D2: call_init (dl-init.c:72)
==4820==    by 0x40108D2: _dl_init (dl-init.c:119)
==4820==    by 0x40010C9: ??? (in /lib/x86_64-linux-gnu/ld-2.27.so)
==4820== 
==4820== 20 bytes in 1 blocks are definitely lost in loss record 2 of 5
==4820==    at 0x4C3217F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x4EB84DC: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x4E7D7D4: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x40108D2: call_init (dl-init.c:72)
==4820==    by 0x40108D2: _dl_init (dl-init.c:119)
==4820==    by 0x40010C9: ??? (in /lib/x86_64-linux-gnu/ld-2.27.so)
==4820== 
==4820== 20 bytes in 1 blocks are definitely lost in loss record 3 of 5
==4820==    at 0x4C3217F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x4EB84DC: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x4E7D84C: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x40108D2: call_init (dl-init.c:72)
==4820==    by 0x40108D2: _dl_init (dl-init.c:119)
==4820==    by 0x40010C9: ??? (in /lib/x86_64-linux-gnu/ld-2.27.so)
==4820== 
==4820== 21 bytes in 1 blocks are definitely lost in loss record 4 of 5
==4820==    at 0x4C3217F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x4EB84DC: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x4E7D824: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x40108D2: call_init (dl-init.c:72)
==4820==    by 0x40108D2: _dl_init (dl-init.c:119)
==4820==    by 0x40010C9: ??? (in /lib/x86_64-linux-gnu/ld-2.27.so)
==4820== 
==4820== 23 bytes in 1 blocks are definitely lost in loss record 5 of 5
==4820==    at 0x4C3217F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x4EB84DC: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x4E7DA04: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x40108D2: call_init (dl-init.c:72)
==4820==    by 0x40108D2: _dl_init (dl-init.c:119)
==4820==    by 0x40010C9: ??? (in /lib/x86_64-linux-gnu/ld-2.27.so)
==4820== 
==4820== LEAK SUMMARY:
==4820==    definitely lost: 102 bytes in 5 blocks
==4820==    indirectly lost: 0 bytes in 0 blocks
==4820==      possibly lost: 0 bytes in 0 blocks
==4820==    still reachable: 0 bytes in 0 blocks
==4820==         suppressed: 0 bytes in 0 blocks
==4820== 
==4820== ERROR SUMMARY: 10 errors from 6 contexts (suppressed: 0 from 0)
==4820== 
==4820== 5 errors in context 1 of 6:
==4820== Invalid free() / delete / delete[] / realloc()
==4820==    at 0x4C3323B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x5B0F604: __cxa_finalize (cxa_finalize.c:83)
==4820==    by 0x4E7DE62: ??? (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
==4820==    by 0x4010D12: _dl_fini (dl-fini.c:138)
==4820==    by 0x5B0F030: __run_exit_handlers (exit.c:108)
==4820==    by 0x5B0F129: exit (exit.c:139)
==4820==    by 0x5AEDC8D: (below main) (libc-start.c:344)
==4820==  Address 0x60ef3c0 is 0 bytes inside a block of size 18 free'd
==4820==    at 0x4C3323B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x5B0F030: __run_exit_handlers (exit.c:108)
==4820==    by 0x5B0F129: exit (exit.c:139)
==4820==    by 0x5AEDC8D: (below main) (libc-start.c:344)
==4820==  Block was alloc'd at
==4820==    at 0x4C3217F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4820==    by 0x4B4C6B: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag) (basic_string.tcc:219)
==4820==    by 0x4B4BE4: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct_aux<char const*>(char const*, char const*, std::__false_type) (basic_string.h:247)
==4820==    by 0x4B4B64: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*) (basic_string.h:266)
==4820==    by 0x46998D: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::allocator<char> >(char const*, std::allocator<char> const&) (basic_string.h:527)
==4820==    by 0x432337: __cxx_global_var_init.311 (unit_test_parameters.ipp:98)
==4820==    by 0x432651: _GLOBAL__sub_I_temp.cpp (temp.cpp:0)
==4820==    by 0x4D1E6C: __libc_csu_init (in /home/john/choose/temp)
==4820==    by 0x5AEDC17: (below main) (libc-start.c:266)
==4820== 
==4820== ERROR SUMMARY: 10 errors from 6 contexts (suppressed: 0 from 0)

Why is this leaking?

Here is what I have tried so far:

I noticed that using the static library in the link command fixes the leak, by replacing libboost_unit_test_framework.so with libboost_unit_test_framework.a, however this doesn't explain why this is happening.

Thanks.

jagprog5
  • 69
  • 1
  • 4
  • 1
    Installing `libboost-test-dev-dbgsym` might make your output a bit more informative (i.e. replacing most of these `???` with something informative) – user17732522 May 07 '23 at 12:28
  • Could be intentional. Some applications intentionally leak some resources at exit if they don't need explicit cleanup and then rely on the OS to release all process memory when the application terminates. Not all leaks are necessarily a problem. – Jesper Juhl May 07 '23 at 12:30
  • This does look like a library bug. Although some leaking of memory allocated from shared library initialization code might be ignored, valgrind is also reporting a double-free, which is definitely a library bug. – Sam Varshavchik May 07 '23 at 12:31
  • @JesperJuhl Valgrind doesn't count those under "definitively lost" (as long as a pointer/reference remains until the program ends) and it is also reporting a double-free. However, I agree that this is probably a false positive, due to some unusual interaction between the shared libraries. – user17732522 May 07 '23 at 12:33
  • Fix the "Invalid Free" first, then look at any leaks. – Paul Floyd May 07 '23 at 19:56
  • All the leaks are static/global `std::string` objects in the libboost_unit_test_framework.so shared library The invalid free is in a static/global `std::string` destruction in that library. You may want to file a bug against boost (or perhaps debug the problem with a debug build of libboost_unit_test_framework and submit a fix). – n. m. could be an AI Jul 14 '23 at 21:20

0 Answers0