From 5560edf41020115826b582d4ba68365c55d3fa76 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sun, 2 Aug 2026 15:12:39 -0400 Subject: [PATCH] Exclude the two shell-script tests from the memcheck run The memory job's first-ever complete valgrind pass on the runner reported every real suite and all three example games clean -- and 414 findings in docs_examples and docs_screenshots. Those two tests are bash scripts that drive gcc and run the compiled snippets as children; valgrind wraps the test command and does not trace children, so all 414 were /bin/bash's own by-design leaks and not one byte of libakgl. Memchecking them proves nothing the suites and example games do not already prove as real binaries under the same valgrind run. memcheck.sh now excludes exactly those two by name, with the reasoning in a comment beside the exclusion -- per the suppressions file's own rule that nothing gets quieted without a stated reason. Verified locally: full run over the RelWithDebInfo tree, every suite and example under valgrind, zero findings, exit 0. Co-Authored-By: Claude Code (Claude Fable 5, claude-fable-5) Claude-Session: https://claude.ai/code/session_01KzBDV2fqgnUAcqCKqKvc71 --- scripts/memcheck.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/memcheck.sh b/scripts/memcheck.sh index df8c9d9..bcb050e 100755 --- a/scripts/memcheck.sh +++ b/scripts/memcheck.sh @@ -49,8 +49,20 @@ rm -f "$AKGL_MEMCHECK_LOG"/MemoryChecker.*.log # The run itself is allowed to fail: a suite that valgrind makes slow enough to # trip an assertion still produced a log worth reading, and the log is what # decides the exit status below. +# +# docs_examples and docs_screenshots are excluded, and the exclusion deserves +# its reasons stated: those two tests are *shell scripts* that drive gcc and +# run the compiled snippets as child processes. Valgrind wraps the test +# command, does not trace children, and so spends the whole test memchecking +# /bin/bash -- 413 of bash's own by-design leaks on the first CI run that got +# this far, and not one byte of libakgl. The snippet programs themselves are +# ordinary akgl consumers whose code paths the suites and example games +# already cover below, under valgrind, as real binaries. A caller's own -E +# overrides this one (ctest takes the last), which is fine: a narrowed run +# chose its scope on purpose. set +e -ctest --test-dir "$AKGL_BUILD_DIR" -T memcheck --output-on-failure "$@" +ctest --test-dir "$AKGL_BUILD_DIR" -T memcheck --output-on-failure \ + -E '^(docs_examples|docs_screenshots)$' "$@" AKGL_CTEST_STATUS=$? set -e