From 9690ecf21f61d5929f22ea23e145861d56847941 Mon Sep 17 00:00:00 2001 From: Anachronaut Date: Fri, 21 Aug 2026 16:51:03 -0400 Subject: [PATCH] make sanitize runs the whole suite, not half of it It built all three tools with the sanitizers and then ran run.sh and terminal.sh only. So SplitDisk was compiled sanitized and never once exercised, and native.sh - which drives the assembler and the emulator harder than anything else here, through two self-hosting builds and a fixed point - was skipped entirely. Those are precisely the places worth watching: block and tail arithmetic on disk images, and buffer indexing in two assemblers, one of which was written this week. disk.sh, native.sh and docs.sh now run under the sanitizers with the rest. Timed first rather than guessed at: 0.41s, 6.05s and 0.14s, against a whole sanitize run of 33 seconds. All three pass, which is worth knowing given none of them had ever been run this way. The README said sanitize ran "the suite", which was generous. Now it does. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW --- CosmOS.png => Media/CosmOS.png | Bin README.md | 2 +- makefile | 13 +++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) rename CosmOS.png => Media/CosmOS.png (100%) diff --git a/CosmOS.png b/Media/CosmOS.png similarity index 100% rename from CosmOS.png rename to Media/CosmOS.png diff --git a/README.md b/README.md index c8f7fe5..bd2e468 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ To rebuild all three tools with the address and undefined behaviour sanitizers a make sanitize ``` -This catches reads and writes past the end of an array, use after free, leaks, and undefined arithmetic. It also fills fresh allocations with a junk pattern, which turns a read of uninitialised memory from something that quietly works into something the tests notice. It takes about twice as long as `make test`, and puts the ordinary binaries back when it finishes. +This catches reads and writes past the end of an array, use after free, leaks, and undefined arithmetic. It also fills fresh allocations with a junk pattern, which turns a read of uninitialised memory from something that quietly works into something the tests notice. It runs everything `make test` runs, takes about twice as long, and puts the ordinary binaries back when it finishes. ## Documentation: diff --git a/makefile b/makefile index ed206e1..59d24df 100644 --- a/makefile +++ b/makefile @@ -109,6 +109,13 @@ test: $(EMU_TARGET) $(ASM_TARGET) $(DSK_TARGET) strict # the test suite under them. Slower than 'make test', and worth running before a # release or after anything that touches memory handling. # +# THE WHOLE SUITE, which it did not used to be: it built all three tools sanitized and +# then ran only run.sh and terminal.sh, so SplitDisk was compiled with the sanitizers and +# never exercised, and native.sh - which drives the assembler and the emulator harder than +# anything else here - was skipped. Those are the parts where block arithmetic on disk +# images and buffer indexing in two assemblers live, which is exactly what the sanitizers +# are for. Adding the three of them costs about six seconds. +# # The sanitizers catch reads and writes off the end of an array, use after free, # leaks, and undefined arithmetic. They also fill fresh allocations with a junk # pattern, which is what turns a read of uninitialised memory from something that @@ -124,7 +131,13 @@ sanitize: @echo "Running the test suite under AddressSanitizer and UndefinedBehaviorSanitizer." @./Tests/run.sh @echo + @./Tests/disk.sh + @echo @./Tests/terminal.sh + @echo + @./Tests/native.sh + @echo + @./Tests/docs.sh @$(MAKE) --no-print-directory clean @$(MAKE) --no-print-directory @echo "Sanitizer run finished cleanly. Normal binaries rebuilt."