ASAN/LSAN reports leak somewhere around g_daemon_vfs_init
- OS: Fedora Silverblue 34 (toolbox)
- Version:
1.48.1-1.fc34
I'm not sure this is false positive or not, but I couldn't find a suppression file for gvfs or mention of someone else encountering this.
I tried to create the most minimal example, but there may be other variables at play (eg. I know this only shows with G_DEBUG=always-malloc
).
static void
test_simple (void)
{
GFile *file = g_file_new_for_path ("/home");
g_object_unref (file);
}
LSAN will report something like below:
=================================================================
==120128==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 72 byte(s) in 3 object(s) allocated from:
#0 0x7f8bbc00993f in __interceptor_malloc (/lib64/libasan.so.6+0xae93f)
#1 0x7f8bbb3f6938 in g_malloc (/lib64/libglib-2.0.so.0+0x5d938)
#2 0x7f8bbb40e1f4 in g_slice_alloc (/lib64/libglib-2.0.so.0+0x751f4)
#3 0x7f8bbb40e85d in g_slice_alloc0 (/lib64/libglib-2.0.so.0+0x7585d)
#4 0x7f8bbb50e044 in g_type_create_instance ../gobject/gtype.c:1903
#5 0x7f8bbb4f5b8c in g_object_new_internal ../gobject/gobject.c:1939
#6 0x7f8bbb4f6b5c in g_object_new_with_properties ../gobject/gobject.c:2108
#7 0x7f8bbb4f7660 in g_object_new (/lib64/libgobject-2.0.so.0+0x24660)
#8 0x7f8bb27ee88c in g_daemon_vfs_init ../client/gdaemonvfs.c:328
#9 0x7f8bbb50e0d8 in g_type_create_instance ../gobject/gtype.c:1921
#10 0x7f8bbb4f5b8c in g_object_new_internal ../gobject/gobject.c:1939
#11 0x7f8bbb4f6b5c in g_object_new_with_properties ../gobject/gobject.c:2108
#12 0x7f8bbb4f7660 in g_object_new (/lib64/libgobject-2.0.so.0+0x24660)
#13 0x7f8bbb5a9fa3 in try_implementation ../gio/giomodule.c:887
#14 0x7f8bbb5b0335 in _g_io_module_get_default ../gio/giomodule.c:1016
#15 0x7f8bbb5e61dc in g_vfs_get_default (/lib64/libgio-2.0.so.0+0xb61dc)
#16 0x7f8bbb596eb1 in g_file_new_for_path (/lib64/libgio-2.0.so.0+0x66eb1)
#17 0x408da5 in test_simple ../src/tests/plugins/share/test-share-plugin.c:126
#18 0x7f8bbb415dd5 in test_case_run ../glib/gtestutils.c:2777
#19 0x7f8bbb415dd5 in g_test_run_suite_internal ../glib/gtestutils.c:2865
#20 0x7f8bbb415afa in g_test_run_suite_internal ../glib/gtestutils.c:2882
#21 0x7f8bbb4162a9 in g_test_run_suite ../glib/gtestutils.c:2959
#22 0x7f8bbb4162c4 in g_test_run (/lib64/libglib-2.0.so.0+0x7d2c4)
#23 0x408e8f in main ../src/tests/plugins/share/test-share-plugin.c:167
#24 0x7f8bba0c5b74 in __libc_start_main (/lib64/libc.so.6+0x27b74)
#25 0x4080bd in _start (/var/home/andrew/Projects/valent/_build_asan/src/tests/plugins/share/test-share-plugin+0x4080bd)
Direct leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x7f8bbc00993f in __interceptor_malloc (/lib64/libasan.so.6+0xae93f)
#1 0x7f8bbb3f6938 in g_malloc (/lib64/libglib-2.0.so.0+0x5d938)
#2 0x7f8bbb40e1f4 in g_slice_alloc (/lib64/libglib-2.0.so.0+0x751f4)
#3 0x7f8bbb40e85d in g_slice_alloc0 (/lib64/libglib-2.0.so.0+0x7585d)
#4 0x7f8bbb50e044 in g_type_create_instance ../gobject/gtype.c:1903
#5 0x7f8bbb4f5b8c in g_object_new_internal ../gobject/gobject.c:1939
#6 0x7f8bbb4f6b5c in g_object_new_with_properties ../gobject/gobject.c:2108
#7 0x7f8bbb4f7660 in g_object_new (/lib64/libgobject-2.0.so.0+0x24660)
#8 0x7f8bbb665918 in _g_local_file_new ../gio/glocalfile.c:212
#9 0x7f8bbb665918 in g_local_vfs_get_file_for_path ../gio/glocalvfs.c:86
#10 0x7f8bb27ee816 in g_daemon_vfs_init ../client/gdaemonvfs.c:315
#11 0x7f8bbb50e0d8 in g_type_create_instance ../gobject/gtype.c:1921
#12 0x7f8bbb4f5b8c in g_object_new_internal ../gobject/gobject.c:1939
#13 0x7f8bbb4f6b5c in g_object_new_with_properties ../gobject/gobject.c:2108
#14 0x7f8bbb4f7660 in g_object_new (/lib64/libgobject-2.0.so.0+0x24660)
#15 0x7f8bbb5a9fa3 in try_implementation ../gio/giomodule.c:887
#16 0x7f8bbb5b0335 in _g_io_module_get_default ../gio/giomodule.c:1016
#17 0x7f8bbb5e61dc in g_vfs_get_default (/lib64/libgio-2.0.so.0+0xb61dc)
#18 0x7f8bbb596eb1 in g_file_new_for_path (/lib64/libgio-2.0.so.0+0x66eb1)
#19 0x408da5 in test_simple ../src/tests/plugins/share/test-share-plugin.c:126
#20 0x7f8bbb415dd5 in test_case_run ../glib/gtestutils.c:2777
#21 0x7f8bbb415dd5 in g_test_run_suite_internal ../glib/gtestutils.c:2865
#22 0x7f8bbb415afa in g_test_run_suite_internal ../glib/gtestutils.c:2882
#23 0x7f8bbb4162a9 in g_test_run_suite ../glib/gtestutils.c:2959
#24 0x7f8bbb4162c4 in g_test_run (/lib64/libglib-2.0.so.0+0x7d2c4)
#25 0x408e8f in main ../src/tests/plugins/share/test-share-plugin.c:167
#26 0x7f8bba0c5b74 in __libc_start_main (/lib64/libc.so.6+0x27b74)
#27 0x4080bd in _start (/var/home/andrew/Projects/valent/_build_asan/src/tests/plugins/share/test-share-plugin+0x4080bd)
Indirect leak of 66 byte(s) in 1 object(s) allocated from:
#0 0x7f8bbc00993f in __interceptor_malloc (/lib64/libasan.so.6+0xae93f)
#1 0x7f8bbb3f6938 in g_malloc (/lib64/libglib-2.0.so.0+0x5d938)
#2 0x7f8bbb40bc23 in g_strdup (/lib64/libglib-2.0.so.0+0x72c23)
#3 0x7f8bbb3dab80 in g_canonicalize_filename (/lib64/libglib-2.0.so.0+0x41b80)
#4 0x7f8bbb665925 in _g_local_file_new ../gio/glocalfile.c:213
#5 0x7f8bbb665925 in g_local_vfs_get_file_for_path ../gio/glocalvfs.c:86
#6 0x7f8bb27ee816 in g_daemon_vfs_init ../client/gdaemonvfs.c:315
#7 0x7f8bbb50e0d8 in g_type_create_instance ../gobject/gtype.c:1921
#8 0x7f8bbb4f5b8c in g_object_new_internal ../gobject/gobject.c:1939
#9 0x7f8bbb4f6b5c in g_object_new_with_properties ../gobject/gobject.c:2108
#10 0x7f8bbb4f7660 in g_object_new (/lib64/libgobject-2.0.so.0+0x24660)
#11 0x7f8bbb5a9fa3 in try_implementation ../gio/giomodule.c:887
#12 0x7f8bbb5b0335 in _g_io_module_get_default ../gio/giomodule.c:1016
#13 0x7f8bbb5e61dc in g_vfs_get_default (/lib64/libgio-2.0.so.0+0xb61dc)
#14 0x7f8bbb596eb1 in g_file_new_for_path (/lib64/libgio-2.0.so.0+0x66eb1)
#15 0x408da5 in test_simple ../src/tests/plugins/share/test-share-plugin.c:126
#16 0x7f8bbb415dd5 in test_case_run ../glib/gtestutils.c:2777
#17 0x7f8bbb415dd5 in g_test_run_suite_internal ../glib/gtestutils.c:2865
#18 0x7f8bbb415afa in g_test_run_suite_internal ../glib/gtestutils.c:2882
#19 0x7f8bbb4162a9 in g_test_run_suite ../glib/gtestutils.c:2959
#20 0x7f8bbb4162c4 in g_test_run (/lib64/libglib-2.0.so.0+0x7d2c4)
#21 0x408e8f in main ../src/tests/plugins/share/test-share-plugin.c:167
#22 0x7f8bba0c5b74 in __libc_start_main (/lib64/libc.so.6+0x27b74)
#23 0x4080bd in _start (/var/home/andrew/Projects/valent/_build_asan/src/tests/plugins/share/test-share-plugin+0x4080bd)
SUMMARY: AddressSanitizer: 170 byte(s) leaked in 5 allocation(s).