You are not logged in.
From my searches, I found the following:
https://bugs.archlinux.org/task/52578
Sums up my problem nicely. But at the bottom of the page it says:
Closed by Sven-Hendrik Haase (Svenstaro)
Thursday, 14 October 2021, 21:54 GMT
Reason for closing: Fixed
But I don't think it is fixed. How can I find out what is wrong with getaddrinfo() and not freeing allocated memory?
My valgrind output from using linked file:
==506452== Memcheck, a memory error detector
==506452== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==506452== Using Valgrind-3.25.1 and LibVEX; rerun with -h for copyright info
==506452== Command: ./btest http://sony.com
==506452==
==506452==
==506452== HEAP SUMMARY:
==506452== in use at exit: 11,438 bytes in 26 blocks
==506452== total heap usage: 434 allocs, 408 frees, 59,527 bytes allocated
==506452==
==506452== 63 bytes in 3 blocks are still reachable in loss record 1 of 8
==506452== at 0x484E7A8: malloc (vg_replace_malloc.c:446)
==506452== by 0x402CE9F: malloc (rtld-malloc.h:56)
==506452== by 0x402CE9F: strdup (strdup.c:42)
==506452== by 0x401AF94: _dl_load_cache_lookup (dl-cache.c:498)
==506452== by 0x400F1B5: _dl_map_new_object (dl-load.c:2049)
==506452== by 0x400883C: openaux (dl-deps.c:64)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4008CA2: _dl_map_object_deps (dl-deps.c:232)
==506452== by 0x4012C47: dl_open_worker_begin (dl-open.c:609)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x401221B: dl_open_worker (dl-open.c:762)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4012759: _dl_open (dl-open.c:900)
==506452==
==506452== 63 bytes in 3 blocks are still reachable in loss record 2 of 8
==506452== at 0x484E7A8: malloc (vg_replace_malloc.c:446)
==506452== by 0x4011FF0: malloc (rtld-malloc.h:56)
==506452== by 0x4011FF0: _dl_new_object (dl-object.c:199)
==506452== by 0x400D234: _dl_map_object_from_fd (dl-load.c:1065)
==506452== by 0x400EE18: _dl_map_new_object (dl-load.c:2182)
==506452== by 0x400883C: openaux (dl-deps.c:64)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4008CA2: _dl_map_object_deps (dl-deps.c:232)
==506452== by 0x4012C47: dl_open_worker_begin (dl-open.c:609)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x401221B: dl_open_worker (dl-open.c:762)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4012759: _dl_open (dl-open.c:900)
==506452==
==506452== 93 bytes in 3 blocks are still reachable in loss record 3 of 8
==506452== at 0x484E7A8: malloc (vg_replace_malloc.c:446)
==506452== by 0x402CE9F: malloc (rtld-malloc.h:56)
==506452== by 0x402CE9F: strdup (strdup.c:42)
==506452== by 0x401AF94: _dl_load_cache_lookup (dl-cache.c:498)
==506452== by 0x400F1B5: _dl_map_new_object (dl-load.c:2049)
==506452== by 0x4013300: dl_open_worker_begin (dl-open.c:535)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x401221B: dl_open_worker (dl-open.c:762)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4012759: _dl_open (dl-open.c:900)
==506452== by 0x49F8AD4: do_dlopen (dl-libc.c:95)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x40075A8: _dl_catch_error (dl-catch.c:260)
==506452==
==506452== 93 bytes in 3 blocks are still reachable in loss record 4 of 8
==506452== at 0x484E7A8: malloc (vg_replace_malloc.c:446)
==506452== by 0x4011FF0: malloc (rtld-malloc.h:56)
==506452== by 0x4011FF0: _dl_new_object (dl-object.c:199)
==506452== by 0x400D234: _dl_map_object_from_fd (dl-load.c:1065)
==506452== by 0x400EE18: _dl_map_new_object (dl-load.c:2182)
==506452== by 0x4013300: dl_open_worker_begin (dl-open.c:535)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x401221B: dl_open_worker (dl-open.c:762)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4012759: _dl_open (dl-open.c:900)
==506452== by 0x49F8AD4: do_dlopen (dl-libc.c:95)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x40075A8: _dl_catch_error (dl-catch.c:260)
==506452==
==506452== 128 bytes in 2 blocks are still reachable in loss record 5 of 8
==506452== at 0x484E7A8: malloc (vg_replace_malloc.c:446)
==506452== by 0x40133FB: malloc (rtld-malloc.h:56)
==506452== by 0x40133FB: resize_scopes (dl-open.c:294)
==506452== by 0x40133FB: dl_open_worker_begin (dl-open.c:687)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x401221B: dl_open_worker (dl-open.c:762)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4012759: _dl_open (dl-open.c:900)
==506452== by 0x49F8AD4: do_dlopen (dl-libc.c:95)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x40075A8: _dl_catch_error (dl-catch.c:260)
==506452== by 0x49F8A3B: dlerror_run (dl-libc.c:45)
==506452== by 0x49F8C23: __libc_dlopen_mode (dl-libc.c:162)
==506452== by 0x49D022C: module_load (nss_module.c:187)
==506452==
==506452== 3,456 bytes in 6 blocks are still reachable in loss record 6 of 8
==506452== at 0x4855C13: calloc (vg_replace_malloc.c:1675)
==506452== by 0x401A2BD: calloc (rtld-malloc.h:44)
==506452== by 0x401A2BD: _dl_check_map_versions (dl-version.c:280)
==506452== by 0x4012CB5: dl_open_worker_begin (dl-open.c:617)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x401221B: dl_open_worker (dl-open.c:762)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4012759: _dl_open (dl-open.c:900)
==506452== by 0x49F8AD4: do_dlopen (dl-libc.c:95)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x40075A8: _dl_catch_error (dl-catch.c:260)
==506452== by 0x49F8A3B: dlerror_run (dl-libc.c:45)
==506452== by 0x49F8C23: __libc_dlopen_mode (dl-libc.c:162)
==506452==
==506452== 3,756 bytes in 3 blocks are still reachable in loss record 7 of 8
==506452== at 0x4855C13: calloc (vg_replace_malloc.c:1675)
==506452== by 0x4011D0C: calloc (rtld-malloc.h:44)
==506452== by 0x4011D0C: _dl_new_object (dl-object.c:92)
==506452== by 0x400D234: _dl_map_object_from_fd (dl-load.c:1065)
==506452== by 0x400EE18: _dl_map_new_object (dl-load.c:2182)
==506452== by 0x400883C: openaux (dl-deps.c:64)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4008CA2: _dl_map_object_deps (dl-deps.c:232)
==506452== by 0x4012C47: dl_open_worker_begin (dl-open.c:609)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x401221B: dl_open_worker (dl-open.c:762)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4012759: _dl_open (dl-open.c:900)
==506452==
==506452== 3,786 bytes in 3 blocks are still reachable in loss record 8 of 8
==506452== at 0x4855C13: calloc (vg_replace_malloc.c:1675)
==506452== by 0x4011D0C: calloc (rtld-malloc.h:44)
==506452== by 0x4011D0C: _dl_new_object (dl-object.c:92)
==506452== by 0x400D234: _dl_map_object_from_fd (dl-load.c:1065)
==506452== by 0x400EE18: _dl_map_new_object (dl-load.c:2182)
==506452== by 0x4013300: dl_open_worker_begin (dl-open.c:535)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x401221B: dl_open_worker (dl-open.c:762)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x4012759: _dl_open (dl-open.c:900)
==506452== by 0x49F8AD4: do_dlopen (dl-libc.c:95)
==506452== by 0x4007455: _dl_catch_exception (dl-catch.c:241)
==506452== by 0x40075A8: _dl_catch_error (dl-catch.c:260)
==506452==
==506452== LEAK SUMMARY:
==506452== definitely lost: 0 bytes in 0 blocks
==506452== indirectly lost: 0 bytes in 0 blocks
==506452== possibly lost: 0 bytes in 0 blocks
==506452== still reachable: 11,438 bytes in 26 blocks
==506452== suppressed: 0 bytes in 0 blocks
==506452==
==506452== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)Offline
==506452== LEAK SUMMARY:
==506452== definitely lost: 0 bytes in 0 blocks
==506452== indirectly lost: 0 bytes in 0 blocks
==506452== possibly lost: 0 bytes in 0 blocks
==506452== still reachable: 11,438 bytes in 26 blocks
==506452== suppressed: 0 bytes in 0 blockshttps://developers.redhat.com/blog/2021 … ak_summary
Or maybe I need glasses?
The linked bug had actually 4k lost, rn there's a lack of tidyness but no actual leak - and the problem seems to be dlopen, so the "problem" is most likely libnss* ?
Online