Skip to content

cpu_guard test: probe a libc symbol no sanitizer interposes (fixes cargo-careful on master) - #362

Merged
AdaWorldAPI merged 1 commit into
masterfrom
ccr-9f3b8075-74u47l-careful-libc
Oct 13, 2026
Merged

AdaWorldAPI merged 1 commit into
masterfrom
ccr-9f3b8075-74u47l-careful-libc

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

cargo-careful has failed on every master merge since #355 (#355–#361; green at #354). The failing test is cpu_guard::tests::an_address_in_libc_is_not_in_the_main_executable, at cpu_guard.rs:712.

Cause. The test used malloc as its example of an address in libc. The CI job runs cargo careful … -Zcareful-sanitizer (AddressSanitizer), and ASan replaces malloc with its own interceptor linked into the executable. Under that build malloc really 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_version instead. No sanitizer replaces it. The doc comment says why malloc was dropped.

Verified here:

  • Scratch crate using the same lookup with -Zsanitizer=address: malloc in the main image is true, gnu_get_libc_version is false, and the program's own function is true. A plain build gives false / false / true.
  • cargo +nightly careful test -Zcareful-sanitizer --lib cpu_guard::tests::an_address: passes. With malloc restored it fails at cpu_guard.rs:712, exactly as in CI.
  • Plain build: 14/14 cpu_guard tests pass.
  • The blackboard entry is in the same commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh


Generated by Claude Code

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
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 @coderabbitai help to get the list of available commands.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 13, 2026 12:28
@AdaWorldAPI
AdaWorldAPI merged commit 3842ed6 into master Oct 13, 2026
21 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T12:29:22.209528Z c2ec608 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants