❯ valgrind --leak-check=full ./build/dlopen_test
==297546== Memcheck, a memory error detector
==297546== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==297546== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
==297546== Command: ./build/dlopen_test
==297546== 
==297546== 
==297546== HEAP SUMMARY:
==297546==     in use at exit: 24,807 bytes in 29 blocks
==297546==   total heap usage: 342 allocs, 313 frees, 242,640 bytes allocated
==297546== 
==297546== 8 bytes in 1 blocks are definitely lost in loss record 1 of 15
==297546==    at 0x48447A8: malloc (vg_replace_malloc.c:446)
==297546==    by 0x9889A35: ???
==297546==    by 0x98A088F: ???
==297546==    by 0x98881BB: ???
==297546==    by 0x40045B6: call_init (dl-init.c:74)
==297546==    by 0x40045B6: call_init (dl-init.c:26)
==297546==    by 0x40046AC: _dl_init (dl-init.c:121)
==297546==    by 0x40015C1: _dl_catch_exception (dl-catch.c:215)
==297546==    by 0x400B4FB: dl_open_worker (dl-open.c:829)
==297546==    by 0x4001522: _dl_catch_exception (dl-catch.c:241)
==297546==    by 0x400B903: _dl_open (dl-open.c:905)
==297546==    by 0x4C92F13: dlopen_doit (dlopen.c:56)
==297546==    by 0x4001522: _dl_catch_exception (dl-catch.c:241)
==297546== 
==297546== 96 bytes in 1 blocks are definitely lost in loss record 10 of 15
==297546==    at 0x484BC13: calloc (vg_replace_malloc.c:1675)
==297546==    by 0x9889A6D: ???
==297546==    by 0x9888100: ???
==297546==    by 0x98881D7: ???
==297546==    by 0x40045B6: call_init (dl-init.c:74)
==297546==    by 0x40045B6: call_init (dl-init.c:26)
==297546==    by 0x40046AC: _dl_init (dl-init.c:121)
==297546==    by 0x40015C1: _dl_catch_exception (dl-catch.c:215)
==297546==    by 0x400B4FB: dl_open_worker (dl-open.c:829)
==297546==    by 0x4001522: _dl_catch_exception (dl-catch.c:241)
==297546==    by 0x400B903: _dl_open (dl-open.c:905)
==297546==    by 0x4C92F13: dlopen_doit (dlopen.c:56)
==297546==    by 0x4001522: _dl_catch_exception (dl-catch.c:241)
==297546== 
==297546== LEAK SUMMARY:
==297546==    definitely lost: 104 bytes in 2 blocks
==297546==    indirectly lost: 0 bytes in 0 blocks
==297546==      possibly lost: 0 bytes in 0 blocks
==297546==    still reachable: 24,703 bytes in 27 blocks
==297546==         suppressed: 0 bytes in 0 blocks
==297546== Reachable blocks (those to which a pointer was found) are not shown.
==297546== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==297546== 
==297546== For lists of detected and suppressed errors, rerun with: -s
==297546== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
❯ valgrind --leak-check=full /usr/bin/ldd ./build/dlopen_test
==297699== Memcheck, a memory error detector
==297699== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==297699== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
==297699== Command: /usr/bin/ldd ./build/dlopen_test
==297699== 
==298328== 
==298328== HEAP SUMMARY:
==298328==     in use at exit: 87,904 bytes in 1,671 blocks
==298328==   total heap usage: 6,244 allocs, 4,573 frees, 337,273 bytes allocated
==298328== 
==298328== LEAK SUMMARY:
==298328==    definitely lost: 0 bytes in 0 blocks
==298328==    indirectly lost: 0 bytes in 0 blocks
==298328==      possibly lost: 0 bytes in 0 blocks
==298328==    still reachable: 87,904 bytes in 1,671 blocks
==298328==         suppressed: 0 bytes in 0 blocks
==298328== Reachable blocks (those to which a pointer was found) are not shown.
==298328== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==298328== 
==298328== For lists of detected and suppressed errors, rerun with: -s
==298328== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
        linux-vdso.so.1 (0x00007702745f1000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0000770274200000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007702744b5000)
        libgcc_s.so.1 => ./libgcc_s.so.1 (0x0000770273e00000)
        libc.so.6 => /usr/lib/libc.so.6 (0x0000770273c0f000)
        /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007702745f3000)
==298327== 
==298327== HEAP SUMMARY:
==298327==     in use at exit: 85,297 bytes in 1,576 blocks
==298327==   total heap usage: 5,847 allocs, 4,271 frees, 324,860 bytes allocated
==298327== 
==298327== LEAK SUMMARY:
==298327==    definitely lost: 0 bytes in 0 blocks
==298327==    indirectly lost: 0 bytes in 0 blocks
==298327==      possibly lost: 0 bytes in 0 blocks
==298327==    still reachable: 85,297 bytes in 1,576 blocks
==298327==         suppressed: 0 bytes in 0 blocks
==298327== Reachable blocks (those to which a pointer was found) are not shown.
==298327== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==298327== 
==298327== For lists of detected and suppressed errors, rerun with: -s
==298327== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==297699== 
==297699== HEAP SUMMARY:
==297699==     in use at exit: 83,306 bytes in 1,295 blocks
==297699==   total heap usage: 5,709 allocs, 4,414 frees, 307,885 bytes allocated
==297699== 
==297699== LEAK SUMMARY:
==297699==    definitely lost: 0 bytes in 0 blocks
==297699==    indirectly lost: 0 bytes in 0 blocks
==297699==      possibly lost: 0 bytes in 0 blocks
==297699==    still reachable: 83,306 bytes in 1,295 blocks
==297699==         suppressed: 0 bytes in 0 blocks
==297699== Reachable blocks (those to which a pointer was found) are not shown.
==297699== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==297699== 
==297699== For lists of detected and suppressed errors, rerun with: -s
==297699== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
