Repository navigation
cpu_guard test: probe a libc symbol no sanitizer interposes (fixes cargo-careful on master) - #362
Merged
Merged
Conversation
cargo-careful has been red on every master merge since #355. Under -Zcareful-sanitizer (ASan) `malloc` is ASan's interceptor, linked into the executable, so the can-stay-silent test's premise (`malloc` lives in libc) is false there. The guard code is unchanged; the test now probes glibc's `gnu_get_libc_version`, which no sanitizer replaces. Verified: plain build 14/14 cpu_guard tests; `cargo +nightly careful test -Zcareful-sanitizer` passes; reverting to `malloc` fails there exactly as CI does (cpu_guard.rs:712). Scratch reproduction with -Zsanitizer=address: malloc in main image true, gnu_get_libc_version false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
AdaWorldAPI
marked this pull request as ready for review
October 13, 2026 12:28
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
cargo-carefulhas failed on everymastermerge since #355 (#355–#361; green at #354). The failing test iscpu_guard::tests::an_address_in_libc_is_not_in_the_main_executable, atcpu_guard.rs:712.Cause. The test used
mallocas its example of an address in libc. The CI job runscargo careful … -Zcareful-sanitizer(AddressSanitizer), and ASan replacesmallocwith its own interceptor linked into the executable. Under that buildmallocreally is in the main image, so the test's assumption is false there. The guard code is correct and unchanged.Change. The test now uses glibc's
gnu_get_libc_versioninstead. No sanitizer replaces it. The doc comment says whymallocwas dropped.Verified here:
-Zsanitizer=address:mallocin the main image istrue,gnu_get_libc_versionisfalse, and the program's own function istrue. A plain build givesfalse/false/true.cargo +nightly careful test -Zcareful-sanitizer --lib cpu_guard::tests::an_address: passes. Withmallocrestored it fails atcpu_guard.rs:712, exactly as in CI.cpu_guardtests pass.🤖 Generated with Claude Code
https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Generated by Claude Code