Memory leak in jack API when connecting or disconnecting ports
- PipeWire version (
0.3.55
): - Distribution and distribution version (
Arch Linux
): - Kernel version (
5.18.12.arch1
):
Description of Problem:
When using the jack API in pipewire, each call to jack_connect and jack_disconnect calls leak 72 bytes of memory.
This also occurs with the jack_connect and jack_disconnect binaries.
I checked against master, and it had the same behavior.
How Reproducible:
Always
Steps to Reproduce:
valgrind --leak-check=full --track-origins=yes jack_(dis)connect
Actual Results:
==108708== Memcheck, a memory error detector
==108708== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==108708== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==108708== Command: jack_disconnect Steinberg\ UR816C\ Pro:capture_AUX3 Steinberg\ UR816C\ Pro:playback_AUX3
==108708==
==108708==
==108708== HEAP SUMMARY:
==108708== in use at exit: 217,162 bytes in 99 blocks
==108708== total heap usage: 884 allocs, 785 frees, 778,436 bytes allocated
==108708==
==108708== 72 bytes in 1 blocks are definitely lost in loss record 13 of 28
==108708== at 0x484AA73: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==108708== by 0x48B5B44: client_node_set_activation (pipewire-jack.c:2410)
==108708== by 0x53FC34C: client_node_demarshal_set_activation.lto_priv.0 (protocol-native.c:634)
==108708== by 0x5007F83: process_remote (module-protocol-native.c:915)
==108708== by 0x500861F: on_remote_data (module-protocol-native.c:949)
==108708== by 0x485EE3C: loop_iterate (loop.c:430)
==108708== by 0x4B81519: do_loop (thread-loop.c:253)
==108708== by 0x497254C: start_thread (pthread_create.c:442)
==108708== by 0x49F7873: clone (clone.S:100)
==108708==
==108708== 14,592 bytes in 1 blocks are possibly lost in loss record 25 of 28
==108708== at 0x484AA73: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==108708== by 0x48BB55F: alloc_object.lto_priv.0 (pipewire-jack.c:425)
==108708== by 0x48CDDF8: registry_event_global.part.0.lto_priv.0 (pipewire-jack.c:2989)
==108708== by 0x5014CC9: registry_demarshal_global.lto_priv.0 (protocol-native.c:1797)
==108708== by 0x5007F83: process_remote (module-protocol-native.c:915)
==108708== by 0x500861F: on_remote_data (module-protocol-native.c:949)
==108708== by 0x485EE3C: loop_iterate (loop.c:430)
==108708== by 0x4B81519: do_loop (thread-loop.c:253)
==108708== by 0x497254C: start_thread (pthread_create.c:442)
==108708== by 0x49F7873: clone (clone.S:100)
==108708==
==108708== 29,184 bytes in 2 blocks are possibly lost in loss record 27 of 28
==108708== at 0x484AA73: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==108708== by 0x48BB55F: alloc_object.lto_priv.0 (pipewire-jack.c:425)
==108708== by 0x48CCDBE: registry_event_global.part.0.lto_priv.0 (pipewire-jack.c:2799)
==108708== by 0x5014CC9: registry_demarshal_global.lto_priv.0 (protocol-native.c:1797)
==108708== by 0x5007F83: process_remote (module-protocol-native.c:915)
==108708== by 0x500861F: on_remote_data (module-protocol-native.c:949)
==108708== by 0x485EE3C: loop_iterate (loop.c:430)
==108708== by 0x4B81519: do_loop (thread-loop.c:253)
==108708== by 0x497254C: start_thread (pthread_create.c:442)
==108708== by 0x49F7873: clone (clone.S:100)
==108708==
==108708== 131,328 bytes in 9 blocks are possibly lost in loss record 28 of 28
==108708== at 0x484AA73: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==108708== by 0x48BB55F: alloc_object.lto_priv.0 (pipewire-jack.c:425)
==108708== by 0x48CD81E: registry_event_global.part.0.lto_priv.0 (pipewire-jack.c:2919)
==108708== by 0x5014CC9: registry_demarshal_global.lto_priv.0 (protocol-native.c:1797)
==108708== by 0x5007F83: process_remote (module-protocol-native.c:915)
==108708== by 0x500861F: on_remote_data (module-protocol-native.c:949)
==108708== by 0x485EE3C: loop_iterate (loop.c:430)
==108708== by 0x4B81519: do_loop (thread-loop.c:253)
==108708== by 0x497254C: start_thread (pthread_create.c:442)
==108708== by 0x49F7873: clone (clone.S:100)
==108708==
==108708== LEAK SUMMARY:
==108708== definitely lost: 72 bytes in 1 blocks
==108708== indirectly lost: 0 bytes in 0 blocks
==108708== possibly lost: 175,104 bytes in 12 blocks
==108708== still reachable: 41,986 bytes in 86 blocks
==108708== suppressed: 0 bytes in 0 blocks
==108708== Reachable blocks (those to which a pointer was found) are not shown.
==108708== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==108708==
==108708== For lists of detected and suppressed errors, rerun with: -s
==108708== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)
Expected Results:
72 bytes aren't being leaked every call.
The rest of the memory reported doesn't appear to grow in size no matter how many clients I make or ports I connect and disconnect.