From 4a17c065ed83f9d84b16b1a4dd56352e03342436 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Wed, 4 Dec 2024 10:58:45 -0800 Subject: [PATCH] valgrind: suppress libuuid TLS leak Problem: valgrind test fails after modifying linkage arguments for macos portability. ==1220291== 704 bytes in 1 blocks are possibly lost in loss record 6 of 13 ==1220291== at 0x4C39185: malloc (vg_replace_malloc.c:442) ==1220291== by 0x40155B0: UnknownInlinedFun (rtld-malloc.h:56) ==1220291== by 0x40155B0: _dl_resize_dtv (dl-tls.c:494) ==1220291== by 0x40160F1: _dl_update_slotinfo (dl-tls.c:810) ==1220291== by 0x40161FB: update_get_addr (dl-tls.c:917) ==1220291== by 0x4001E9B: __tls_get_addr (tls_get_addr.S:55) ==1220291== by 0x57D6418: ??? (in /usr/lib64/libuuid.so.1.3.0) ==1220291== by 0x57D6608: ??? (in /usr/lib64/libuuid.so.1.3.0) ==1220291== by 0x57D5B48: __uuid_generate_random (in /usr/lib64/libuuid.so.1.3.0) ==1220291== by 0x57D5BE9: uuid_generate_random (in /usr/lib64/libuuid.so.1.3.0) ==1220291== by 0x410157: module_create (module.c:379) ==1220291== by 0x410F97: modhash_load (modhash.c:284) ==1220291== by 0x4112D6: load_cb (modhash.c:347) ==1220291== by 0x4E6F819: call_handler (msg_handler.c:339) ==1220291== by 0x4E6FDFA: dispatch_message (msg_handler.c:375) ==1220291== by 0x4E6FDFA: handle_cb (msg_handler.c:476) ==1220291== by 0x4EA0F92: ev_invoke_pending (ev.c:3776) ==1220291== by 0x4EA4E87: ev_run (ev.c:4196) ==1220291== by 0x4EA4E87: ev_run (ev.c:4027) ==1220291== by 0x4E6EB3A: flux_reactor_run (reactor.c:97) ==1220291== by 0x40D3ED: main (broker.c:532) ==1220291== It looks like libuuid is allocating memory in thread-local storage, though it is unclear why we didn't see this before. Suppress this error. --- t/valgrind/valgrind.supp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/t/valgrind/valgrind.supp b/t/valgrind/valgrind.supp index c772aa859e31..f164a525ee87 100644 --- a/t/valgrind/valgrind.supp +++ b/t/valgrind/valgrind.supp @@ -150,3 +150,12 @@ fun:hwloc_topology_load ... } +{ + + Memcheck:Leak + match-leak-kinds: possible + fun:malloc + ... + fun:uuid_generate* + ... +}