Still reachable blocks in Valgrind
- PipeWire version (
pipewire --version
): 0.3.59 - Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
): Arch Linux - Desktop Environment: sway
- Kernel version (
uname -r
): 6.0.2-arch1-1
Description of Problem:
pw_deinit()
does not deallocate all memory.
Steps to Reproduce:
- Create
test1.c
:
#include <pipewire/pipewire.h>
int main(int argc, char *argv[])
{
pw_init(&argc, &argv);
pw_deinit();
return 0;
}
gcc -Wall test1.c -o test1 -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2 -D_REENTRANT -lpipewire-0.3
valgrind --leak-check=full --show-leak-kinds=all -s ./test1
Actual Results:
==13448== Memcheck, a memory error detector
==13448== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==13448== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==13448== Command: ./test1
==13448==
==13448==
==13448== HEAP SUMMARY:
==13448== in use at exit: 14,964 bytes in 36 blocks
==13448== total heap usage: 63 allocs, 27 frees, 37,563 bytes allocated
==13448==
==13448== 86 bytes in 2 blocks are still reachable in loss record 1 of 7
==13448== at 0x4841888: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13448== by 0x40248AE: malloc (rtld-malloc.h:56)
==13448== by 0x40248AE: strdup (strdup.c:42)
==13448== by 0x400847D: _dl_map_object (dl-load.c:2186)
==13448== by 0x400BD58: dl_open_worker_begin (dl-open.c:534)
==13448== by 0x4AABE3D: _dl_catch_exception (dl-error-skeleton.c:208)
==13448== by 0x400B4FA: dl_open_worker (dl-open.c:782)
==13448== by 0x4AABE3D: _dl_catch_exception (dl-error-skeleton.c:208)
==13448== by 0x400B8EC: _dl_open (dl-open.c:886)
==13448== by 0x49DE9DB: dlopen_doit (dlopen.c:56)
==13448== by 0x4AABE3D: _dl_catch_exception (dl-error-skeleton.c:208)
==13448== by 0x4AABEF2: _dl_catch_error (dl-error-skeleton.c:227)
==13448== by 0x49DE4AE: _dlerror_run (dlerror.c:138)
==13448==
.............
==13448==
==13448== 8,612 bytes in 7 blocks are still reachable in loss record 7 of 7
==13448== at 0x4846A73: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13448== by 0x400AF9D: calloc (rtld-malloc.h:44)
==13448== by 0x400AF9D: _dl_new_object (dl-object.c:92)
==13448== by 0x4006A5E: _dl_map_object_from_fd (dl-load.c:1063)
==13448== by 0x4008504: _dl_map_object (dl-load.c:2253)
==13448== by 0x4002294: openaux (dl-deps.c:64)
==13448== by 0x4AABE3D: _dl_catch_exception (dl-error-skeleton.c:208)
==13448== by 0x40026F5: _dl_map_object_deps (dl-deps.c:232)
==13448== by 0x400BDBE: dl_open_worker_begin (dl-open.c:592)
==13448== by 0x4AABE3D: _dl_catch_exception (dl-error-skeleton.c:208)
==13448== by 0x400B4FA: dl_open_worker (dl-open.c:782)
==13448== by 0x4AABE3D: _dl_catch_exception (dl-error-skeleton.c:208)
==13448== by 0x400B8EC: _dl_open (dl-open.c:886)
==13448==
==13448== LEAK SUMMARY:
==13448== definitely lost: 0 bytes in 0 blocks
==13448== indirectly lost: 0 bytes in 0 blocks
==13448== possibly lost: 0 bytes in 0 blocks
==13448== still reachable: 14,964 bytes in 36 blocks
==13448== suppressed: 0 bytes in 0 blocks
==13448==
==13448== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Expected Results:
No blocks are still reachable