Possible memory leak in GUnixVolumeMonitor
As seen in this CI run:
▶ 243/352 /volumemonitor/connected_drives OK
▶ 243/352 /volumemonitor/volumes OK
▶ 243/352 /volumemonitor/mounts OK
▶ 209/352 /gsubprocess/fd-conflation/inherit-fds OK
▶ 16/352 /date/year/3001 OK
▶ 209/352 /gsubprocess/fd-conflation/child-err-report-fd OK
243/352 glib:gio / volumemonitor ERROR 6.44s exit status 1
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
==14152== Memcheck, a memory error detector
==14152== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==14152== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==14152== Command: /builds/GNOME/glib/_build/gio/tests/volumemonitor
==14152==
==14152==
==14152== HEAP SUMMARY:
==14152== in use at exit: 84,630 bytes in 972 blocks
==14152== total heap usage: 2,255 allocs, 1,283 frees, 607,352 bytes allocated
==14152==
==14152== 16 bytes in 1 blocks are possibly lost in loss record 296 of 904
==14152== at 0x484380F: malloc (vg_replace_malloc.c:442)
==14152== by 0x4D4AFFD: strdup (in /usr/lib64/libc.so.6)
==14152== by 0x4F833B6: mnt_monitor_enable_userspace (in /usr/lib64/libmount.so.1.1.0)
==14152== by 0x4B5B284: mount_monitor_start (gunixmounts.c:2052)
==14152== by 0x4AA992B: g_context_specific_group_change_state (gcontextspecificgroup.c:105)
==14152== by 0x48CA05B: g_idle_dispatch (gmain.c:6150)
==14152== by 0x48C6CF1: g_main_dispatch (gmain.c:3344)
==14152== by 0x48C7D98: g_main_context_dispatch_unlocked (gmain.c:4152)
==14152== by 0x48C7F4D: g_main_context_iterate_unlocked (gmain.c:4217)
==14152== by 0x48C8005: g_main_context_iteration (gmain.c:4282)
==14152== by 0x48CA3F9: glib_worker_main (gmain.c:6442)
==14152== by 0x4907422: g_thread_proxy (gthread.c:835)
==14152== by 0x4D3519C: start_thread (in /usr/lib64/libc.so.6)
==14152== by 0x4DB5E13: clone (in /usr/lib64/libc.so.6)
==14152==
==14152== 21 bytes in 1 blocks are possibly lost in loss record 308 of 904
==14152== at 0x484380F: malloc (vg_replace_malloc.c:442)
==14152== by 0x4D4AFFD: strdup (in /usr/lib64/libc.so.6)
==14152== by 0x4F83681: mnt_monitor_enable_kernel (in /usr/lib64/libmount.so.1.1.0)
==14152== by 0x4B5B230: mount_monitor_start (gunixmounts.c:2048)
==14152== by 0x4AA992B: g_context_specific_group_change_state (gcontextspecificgroup.c:105)
==14152== by 0x48CA05B: g_idle_dispatch (gmain.c:6150)
==14152== by 0x48C6CF1: g_main_dispatch (gmain.c:3344)
==14152== by 0x48C7D98: g_main_context_dispatch_unlocked (gmain.c:4152)
==14152== by 0x48C7F4D: g_main_context_iterate_unlocked (gmain.c:4217)
==14152== by 0x48C8005: g_main_context_iteration (gmain.c:4282)
==14152== by 0x48CA3F9: glib_worker_main (gmain.c:6442)
==14152== by 0x4907422: g_thread_proxy (gthread.c:835)
==14152== by 0x4D3519C: start_thread (in /usr/lib64/libc.so.6)
==14152== by 0x4DB5E13: clone (in /usr/lib64/libc.so.6)
==14152==
==14152== 56 bytes in 1 blocks are possibly lost in loss record 579 of 904
==14152== at 0x484AE60: calloc (vg_replace_malloc.c:1595)
==14152== by 0x4F83624: mnt_monitor_enable_kernel (in /usr/lib64/libmount.so.1.1.0)
==14152== by 0x4B5B230: mount_monitor_start (gunixmounts.c:2048)
==14152== by 0x4AA992B: g_context_specific_group_change_state (gcontextspecificgroup.c:105)
==14152== by 0x48CA05B: g_idle_dispatch (gmain.c:6150)
==14152== by 0x48C6CF1: g_main_dispatch (gmain.c:3344)
==14152== by 0x48C7D98: g_main_context_dispatch_unlocked (gmain.c:4152)
==14152== by 0x48C7F4D: g_main_context_iterate_unlocked (gmain.c:4217)
==14152== by 0x48C8005: g_main_context_iteration (gmain.c:4282)
==14152== by 0x48CA3F9: glib_worker_main (gmain.c:6442)
==14152== by 0x4907422: g_thread_proxy (gthread.c:835)
==14152== by 0x4D3519C: start_thread (in /usr/lib64/libc.so.6)
==14152== by 0x4DB5E13: clone (in /usr/lib64/libc.so.6)
==14152==
==14152== 56 bytes in 1 blocks are possibly lost in loss record 580 of 904
==14152== at 0x484AE60: calloc (vg_replace_malloc.c:1595)
==14152== by 0x4F8335D: mnt_monitor_enable_userspace (in /usr/lib64/libmount.so.1.1.0)
==14152== by 0x4B5B284: mount_monitor_start (gunixmounts.c:2052)
==14152== by 0x4AA992B: g_context_specific_group_change_state (gcontextspecificgroup.c:105)
==14152== by 0x48CA05B: g_idle_dispatch (gmain.c:6150)
==14152== by 0x48C6CF1: g_main_dispatch (gmain.c:3344)
==14152== by 0x48C7D98: g_main_context_dispatch_unlocked (gmain.c:4152)
==14152== by 0x48C7F4D: g_main_context_iterate_unlocked (gmain.c:4217)
==14152== by 0x48C8005: g_main_context_iteration (gmain.c:4282)
==14152== by 0x48CA3F9: glib_worker_main (gmain.c:6442)
==14152== by 0x4907422: g_thread_proxy (gthread.c:835)
==14152== by 0x4D3519C: start_thread (in /usr/lib64/libc.so.6)
==14152== by 0x4DB5E13: clone (in /usr/lib64/libc.so.6)
==14152==
==14152== LEAK SUMMARY:
==14152== definitely lost: 0 bytes in 0 blocks
==14152== indirectly lost: 0 bytes in 0 blocks
==14152== possibly lost: 149 bytes in 4 blocks
==14152== still reachable: 15,001 bytes in 230 blocks
==14152== suppressed: 64,592 bytes in 670 blocks
==14152== Reachable blocks (those to which a pointer was found) are not shown.
==14152== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==14152==
==14152== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 1 from 1)
--14152--
--14152-- used_suppression: 2 glib-init-malloc /builds/GNOME/glib/tools/glib.supp:70 suppressed: 16,480 bytes in 2 blocks
--14152-- used_suppression: 46 gobject-init-realloc /builds/GNOME/glib/tools/glib.supp:97 suppressed: 4,864 bytes in 46 blocks
--14152-- used_suppression: 1 g-rand-init2 /builds/GNOME/glib/tools/glib.supp:217 suppressed: 2,500 bytes in 1 blocks
--14152-- used_suppression: 3 g-quark-table-resize /builds/GNOME/glib/tools/glib.supp:237 suppressed: 5,120 bytes in 3 blocks
--14152-- used_suppression: 62 g-type-register-static-realloc /builds/GNOME/glib/tools/glib.supp:133 suppressed: 3,840 bytes in 62 blocks
--14152-- used_suppression: 1 g-type-interface-init /builds/GNOME/glib/tools/glib.supp:247 suppressed: 840 bytes in 1 blocks
--14152-- used_suppression: 18 g-type-class-ref /builds/GNOME/glib/tools/glib.supp:360 suppressed: 4,032 bytes in 18 blocks
--14152-- used_suppression: 74 g-object-do-class-init-signals /builds/GNOME/glib/tools/glib.supp:274 suppressed: 3,656 bytes in 74 blocks
--14152-- used_suppression: 1 g-system-thread-init /builds/GNOME/glib/tools/glib.supp:497 suppressed: 304 bytes in 1 blocks
--14152-- used_suppression: 94 gobject-init-calloc /builds/GNOME/glib/tools/glib.supp:106 suppressed: 8,232 bytes in 94 blocks
--14152-- used_suppression: 174 g-type-register-static-calloc /builds/GNOME/glib/tools/glib.supp:142 suppressed: 9,768 bytes in 174 blocks
--14152-- used_suppression: 6 g-type-class-init /builds/GNOME/glib/tools/glib.supp:265 suppressed: 368 bytes in 6 blocks
--14152-- used_suppression: 3 g-io-module-default-singleton-malloc /builds/GNOME/glib/tools/glib.supp:380 suppressed: 216 bytes in 3 blocks
--14152-- used_suppression: 2 g-param-spec-pool-new /builds/GNOME/glib/tools/glib.supp:326 suppressed: 120 bytes in 2 blocks
--14152-- used_suppression: 8 gobject-init-malloc /builds/GNOME/glib/tools/glib.supp:88 suppressed: 504 bytes in 8 blocks
--14152-- used_suppression: 1 g-system-thread-init-malloc /builds/GNOME/glib/tools/glib.supp:506 suppressed: 80 bytes in 1 blocks
--14152-- used_suppression: 4 g-io-module-default-singleton-weak-ref /builds/GNOME/glib/tools/glib.supp:435 suppressed: 120 bytes in 4 blocks
--14152-- used_suppression: 9 g-type-add-interface-static-realloc /builds/GNOME/glib/tools/glib.supp:187 suppressed: 304 bytes in 9 blocks
--14152-- used_suppression: 14 g-type-prerequisites /builds/GNOME/glib/tools/glib.supp:284 suppressed: 176 bytes in 14 blocks
--14152-- used_suppression: 26 g-type-add-interface-static-calloc /builds/GNOME/glib/tools/glib.supp:196 suppressed: 832 bytes in 26 blocks
--14152-- used_suppression: 2 g-io-module-default-singleton /builds/GNOME/glib/tools/glib.supp:404 suppressed: 48 bytes in 2 blocks
--14152-- used_suppression: 15 g_io_extension_point_register /builds/GNOME/glib/tools/glib.supp:1062 suppressed: 480 bytes in 15 blocks
--14152-- used_suppression: 1 g_strerror /builds/GNOME/glib/tools/glib.supp:1072 suppressed: 29 bytes in 1 blocks
--14152-- used_suppression: 50 g-io-module-default-singleton-name /builds/GNOME/glib/tools/glib.supp:424 suppressed: 606 bytes in 50 blocks
--14152-- used_suppression: 26 g-type-add-interface-static /builds/GNOME/glib/tools/glib.supp:178 suppressed: 624 bytes in 26 blocks
--14152-- used_suppression: 4 g_private_set_alloc0-calloc /builds/GNOME/glib/tools/glib.supp:1122 suppressed: 88 bytes in 4 blocks
--14152-- used_suppression: 1 g-type-add-interface-check-realloc /builds/GNOME/glib/tools/glib.supp:304 suppressed: 16 bytes in 1 blocks
--14152-- used_suppression: 19 g-type-register-fundamental-calloc /builds/GNOME/glib/tools/glib.supp:160 suppressed: 304 bytes in 19 blocks
--14152-- used_suppression: 2 g_get_charset /builds/GNOME/glib/tools/glib.supp:1194 suppressed: 30 bytes in 2 blocks
--14152-- used_suppression: 1 g_get_home_dir /builds/GNOME/glib/tools/glib.supp:890 suppressed: 11 bytes in 1 blocks
==14152==
==14152== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 1 from 1)
(test program exited with status code 1)