nbdkit/0002-ocaml-Fix-valgrinding-by-only-ignoring-caml_stat_all.patch

40 lines
1.2 KiB
Diff
Raw Normal View History

From 397b7b245aee178b2683de8a34847843f658b43d Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 5 Jul 2021 18:00:28 +0100
Subject: [PATCH 2/7] ocaml: Fix valgrinding by only ignoring caml_stat_alloc*
functions
These are meant to be "static" so are not freed by design. Other
allocations should all be freed, especially now that we are calling
caml_shutdown.
(cherry picked from commit 875a5056758dca754225f49516a0f4c8e788ac94)
---
valgrind/ocaml.suppressions | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/valgrind/ocaml.suppressions b/valgrind/ocaml.suppressions
index f74b0943..a2b7fc60 100644
--- a/valgrind/ocaml.suppressions
+++ b/valgrind/ocaml.suppressions
@@ -29,11 +29,12 @@
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
-# OCaml, by design, doesn't bother to free the major heap before
-# calling exit. Ignore that leak.
+# OCaml caml_stat_* allocations are meant to be "static" so OCaml will
+# never free them by design. See the OCaml manual, chapter
+# "Interfacing C with OCaml".
{
- ocaml_heap_leak
+ ocaml_stat_allocations
Memcheck:Leak
...
- fun:caml_alloc_for_heap
+ fun:caml_stat_alloc*
}
--
2.32.0