From ede363261277c68c189ce3e6bd35c64e5ee78cd9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 12 Oct 2022 12:18:18 +0100 Subject: [PATCH] valgrind: Update suppression for PCRE2 transition OCaml PCRE.compile doesn't free up regexps if they are stored in globals. However the valgrind suppression for this matched the old function name, not the new PCRE2 name. Valgrind errors looked like: ==1799651== 145 bytes in 1 blocks are possibly lost in loss record 2,927 of 4,168 ==1799651== at 0x484186F: malloc (vg_replace_malloc.c:381) ==1799651== by 0x4D5F2E5: pcre2_compile_8 (pcre2_compile.c:10250) ==1799651== by 0x29E077: guestfs_int_pcre_compile (pcre-c.c:196) ==1799651== by 0x2B725F: camlOVA__entry (OVA.ml:392) ==1799651== by 0x2859A8: caml_program (in /home/rjones/d/virt-v2v/v2v/virt-v2v) ==1799651== by 0x40F9D8: caml_start_program (in /home/rjones/d/virt-v2v/v2v/virt-v2v) ==1799651== by 0x40FD86: caml_startup_common (in /home/rjones/d/virt-v2v/v2v/virt-v2v) ==1799651== by 0x40FDDC: caml_startup (in /home/rjones/d/virt-v2v/v2v/virt-v2v) ==1799651== by 0x28523F: main (in /home/rjones/d/virt-v2v/v2v/virt-v2v) (cherry picked from virt-v2v commit 2949109ff9f7a081b1a4b475b9f7bcbef5b45ee0) --- valgrind-suppressions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/valgrind-suppressions b/valgrind-suppressions index 4c8e37886..7331455dd 100644 --- a/valgrind-suppressions +++ b/valgrind-suppressions @@ -190,14 +190,14 @@ fun:caml_stop_stack_overflow_detection } -# The OCaml PCRE.compile function calls pcre_compile2 which allocates +# The OCaml PCRE.compile function calls pcre2_compile_8 which allocates # memory. If these regexps are stored in a global variable then they # can never be freed. This is not really a bug, so ignore it. { ocaml_pcre_globals Memcheck:Leak fun:malloc - fun:pcre_compile2 + fun:pcre2_compile_8 ... }