Re-enable leak detection in the AddressSanitizer test script - #38
Merged
Merged
Conversation
The suppression was added for a leak in the throw-by-pointer exception pattern, which no longer exists: every throw site now constructs the exception by value, and the library's only heap allocation (Environment::grid) is paired with a delete in ~Environment. Closes #33 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
Self-review rubric
Findings
Merge recommendationMerge is not recommended from this session. The static evidence that the previously suppressed leak is gone is strong and is laid out in the PR description, but the confirmation step #33 explicitly asks for is an executed clean run, and that could not be produced under the sandbox's execution restrictions. A maintainer running This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_tests_asan.sh(ASAN_OPTIONS=detect_leaks=1, stated explicitly rather than relying on the platform default).Evidence the suppressed leak is gone
throwsite insrc/shows all four construct the exception by value (src/grid.cpp:30,src/grid.cpp:116,src/environment.cpp:67,src/environment.cpp:86). Nothrow newremains anywhere in the tree.Environment::grid(src/environment.cpp:10), which is paired withdelete gridin~Environment(src/environment.cpp:14).new,malloc, orfreeappears insrc/tests.cpp; everyEntity,Grid, andEnvironmentused by the suite is stack-allocated, so eachEnvironmentdestructor runs and releases its grid.Test plan
make— clean compile.bash run_tests_asan.sh— NOT RUN. See the verification gap below.bash run_tests.sh— NOT RUN. See the verification gap below.Verification gap — this PR is UNVERIFIED and is not proposed for automatic merge
The change was authored in a sandbox where binary execution is denied.
./tests_executable,bash run_tests.sh,bash run_tests_asan.sh, and a directg++ -fsanitize=address ...invocation were each attempted and each was refused; onlymakeis permitted, and it succeeded. The evidence above is therefore static analysis of every allocation and throw site in the tree, not an observed clean AddressSanitizer run.The confirmation step requested by #33 — running the script and observing a clean pass — has consequently not been performed. Merging is asked to be gated on a maintainer running
bash run_tests_asan.shon a machine with an unrestricted toolchain and confirming a clean, leak-free pass. Should a leak surface that this static review did not predict (LeakSanitizer occasionally attributes allocations to runtime internals), the correct response would be to suppress that specific allocation rather than to restore the blanketdetect_leaks=0.Deferred backlog
#33was the only issue open at triage time, so nothing was deferred for this cycle.Closes #33
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson