From 901376ba49f671e211981627910be51008475616 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Thu, 17 Sep 2026 22:02:38 +0700 Subject: [PATCH] The three new programs join the two memory sweeps Both corpora are explicit lists and not globs, so a program added to test/programs is covered by dune test and by @x86 and by nothing else until somebody types its name here. files.flan, math3.flan and time.flan are typed. time.flan is the one with something to say. getenv hands back a slice viewing the process environment and never a copy, which is the exact shape a use-after-free or an off-by-one length would be, and neither ASan nor memcheck had ever seen it. files.flan brings three more path buffers through flan_path_cstr. math3.flan is the cheap one and is here for completeness. files.flan makes and removes its own tree, so the sweeps' two runs of it see the same directory both times. @sanitize is clean with all three in. @valgrind is not run here -- it is tens of minutes and opt-in -- so those three entries are checked by the next person who runs the alias. --- test/test_sanitize.ml | 9 +++++++++ test/test_valgrind.ml | 3 +++ 2 files changed, 12 insertions(+) diff --git a/test/test_sanitize.ml b/test/test_sanitize.ml index 12090cd..971d768 100644 --- a/test/test_sanitize.ml +++ b/test/test_sanitize.ml @@ -128,9 +128,14 @@ let corpus = "programs/edn.flan", []; "programs/enum-compare.flan", []; "programs/error.flan", []; + (* Makes and removes its own tree, so the two runs of the sweep see the + same directory; the new C here is three more path buffers, which is + exactly what this tool is for. *) + "programs/files.flan", []; "programs/handles.flan", []; "programs/machine.flan", []; "programs/math.flan", []; + "programs/math3.flan", []; "programs/pkg-diamond.flan", []; "programs/pkg-return.flan", []; "programs/pkg-shared.flan", []; @@ -143,6 +148,10 @@ let corpus = "programs/slices.flan", []; "programs/string-of-bytes.flan", []; "programs/text.flan", []; + (* The clock and getenv. getenv hands back a slice viewing the process + environment and never a copy, so a report here would be the one that + matters. *) + "programs/time.flan", []; "programs/unit-main.flan", []; "programs/utf8.flan", []; "programs/values.flan", []; diff --git a/test/test_valgrind.ml b/test/test_valgrind.ml index e58a06e..3577948 100644 --- a/test/test_valgrind.ml +++ b/test/test_valgrind.ml @@ -215,6 +215,7 @@ let corpus = "programs/error.flan", []; "programs/exhausted.flan", []; "programs/exhausted-unhandled.flan", []; + "programs/files.flan", []; "programs/free-all-refused.flan", []; "programs/handles.flan", []; "programs/machine.flan", []; @@ -222,6 +223,7 @@ let corpus = "programs/map-stale-region.flan", []; "programs/maps.flan", []; "programs/math.flan", []; + "programs/math3.flan", []; "programs/pool-stale-region.flan", []; "programs/pkg-macro.flan", []; "programs/pkg-diamond.flan", []; @@ -241,6 +243,7 @@ let corpus = "programs/stale-region.flan", []; "programs/string-of-bytes.flan", []; "programs/text.flan", []; + "programs/time.flan", []; "programs/datas.flan", []; "programs/unit-main.flan", []; "programs/utf8.flan", [];