From 505755e4d2e7ea57adcad3a7daf45c50b745e264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 14 Sep 2022 21:50:38 +0200 Subject: [PATCH 1/2] glib.supp: Ignore gutils leaks for user and system dirs These leaks happens "by design" in case that the private API g_set_user_dirs() is used to replace directories during some tests. And we've to leak the previously set values (if any) not to free strings that may be used by other user code before. In fact we're already ignoring LSAN reports for the very same reason here. We could create a private suppression file too, but I don't think we've to bother with that, given that user code should never hit this path anyways. It's the only leak we have, sooo: Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/333 --- tools/glib.supp | 122 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 121 insertions(+), 1 deletion(-) diff --git a/tools/glib.supp b/tools/glib.supp index b06efec0d..0609db44e 100644 --- a/tools/glib.supp +++ b/tools/glib.supp @@ -904,6 +904,126 @@ fun:desktop_file_dir_unindexed_setup_search } +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_user_data_dir + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_user_data_dir +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_filename + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_filename +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_home_dir + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_home_dir +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_path + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_path +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_system_config_dirs + Memcheck:Leak + match-leak-kinds:definite + fun:realloc + ... + fun:g_build_system_config_dirs +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_system_data_dir + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_system_data_dir +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_system_data_dirs + Memcheck:Leak + match-leak-kinds:definite + fun:realloc + ... + fun:g_build_system_data_dirs +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_user_cache_dir + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_user_cache_dir +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_user_config_dir + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_user_config_dir +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_user_data_dir + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_user_data_dir +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_user_runtime_dir + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_user_runtime_dir +} + +#gutils.c caches system and user dirs and may need to replace them during tests. +{ + g_build_user_state_dir + Memcheck:Leak + match-leak-kinds:definite + fun:malloc + ... + fun:g_build_user_state_dir +} + # g_io_extension_point_register() caches a one-time allocation global table of @extension_points. { g_io_extension_point_register @@ -1124,4 +1244,4 @@ fun:calloc ... fun:xdg_mime_init -} \ No newline at end of file +} From 4432f78407039cd2551807db4f0bdfc2f0e07b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 14 Sep 2022 22:00:45 +0200 Subject: [PATCH 2/2] CI: Do not allow failures in the valgrind job We're no more leaks, so we can just be more restrictive at it, in order to find new problems easier. --- .gitlab-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f1e511b8..c29bacbd9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -227,9 +227,6 @@ valgrind: - bash -x ./.gitlab-ci/run-tests.sh --setup valgrind --no-suite slow - # FIXME: Remove this when we have zero valgrind leaks. - # https://gitlab.gnome.org/GNOME/glib/issues/333 - allow_failure: true artifacts: reports: junit: "_build/meson-logs/testlog-valgrind.junit.xml"