Repository navigation
fix(runtime): header reads the address-classification audit flags go through the checked probes - #14760
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…through the checked probes The addr-class audit has failed on main since 0b2c663 (PerryTS#14430) gave layout_slot.rs its own copy of array_gc_header, with a hand-rolled GC_HEADER_SIZE + 0x1000 floor that does not reject the handle bands. Later instrumented-only code added unvalidated GcHeader casts. - layout_slot uses array::array_gc_header (now pub(crate)), the one grandfathered probe, instead of a second copy with its own floor. - fill_birth's test reads the header through array_gc_header. - The LIFE census (instr builds only) reads a birth or region address through try_read_gc_header / is_plausible_heap_addr: a POINTER_TAG payload there can be a handle-band id, which has no header. - The allocator-owned header walks in alloc_life (the inline slow call's header, the inline burst walk) and the snapshot census's inventory and holder walk get allowlist entries naming where each address comes from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Main added snap_image.rs (PerryTS#14765, PerryTS#14775) and a census reachability walk in snap_census/inventory.rs. Their GcHeader casts read headers from arena_walk_objects / MALLOC_STATE at a cut that collects nothing; the tls_window unit test uses a synthetic thread pointer. Each gets a narrow allowlist entry naming the source.
28f364b to
ba09c7f
Compare
Summary
addr_class_inventory.py(lint step "Address-classification audit") has failed onmainsince 0b2c663 (#14430). That commit gavelayout_slot.rsits own copy ofarray::header::array_gc_header, with a hand-rolledGC_HEADER_SIZE + 0x1000floor. Such a floor does not reject the fetch, zlib or proxy handle bands, and the ratchet holdslayout_slot.rsat 0 handle-floor sites. Later commits added unvalidatedas *const/mut GcHeadercasts in instrumented-only code (the LIFE census and the snapshot census) and in one test.This PR removes the debt sites where a checked probe exists. Where the address is the allocator's own record, it adds allowlist entries naming the source. No baseline is raised.
Seen in main's CI run 43639432681 (
addr-class RATCHET FAILED). Part of the lint cleanup tracked alongside #14595.Changes
layout_slot.rsgc_header(handle-floor + cast)crate::array::array_gc_header(nowpub(crate)), the identical grandfathered probe already counted inarray/header.rs, so that file's count is unchangedarray/fill_birth.rstestimagearray_gc_headerwpfacts_check/life_measure.rsperry_life_birthtry_read_gc_header. A POINTER_TAG payload that is a handle id counts asunborninstead of being dereferencedwpfacts_check/life.rsfull_alive,engine_metadatatry_read_gc_header(..).is_some_and(..)arena/alloc_life.rsbirthis_plausible_heap_addr(wasaddr < GC_HEADER_SIZE). The claim-outside size read usestry_read_gc_headerarena/alloc_life.rsflush,walk_inline[from, to)and each header's sizesnap_census/inventory.rsarena_walk_objectsandMALLOC_STATE's tracked listsnap_census/runner.rsholder_words(as *mut)as *constentryThe "introduced by" column for rows other than
layout_slot.rscomes fromgit log -Gon the cast; I probed the gate at commit and parent only forlayout_slot.rs. The LIFE and snapshot-census modules compile only undercfg(perry_gc_instruments).Related issue
Refs #14595, #14604. Main CI run 43639432681.
Test plan
The gate also reports 19 stale (too-high) ratchet counts that
main's fixes already earned. This PR leaves them alone; lowering them is a separate--write-baselinechange.BASE_SHA=upstream/main scripts/run_lint_gates.sh(macOS arm64): 21 FAIL lines on the branch vs 22 onmain64257c3; the only difference is the gate this PR fixes ([Address-classification audit] python3 scripts/addr_class_inventory.py); no new FAIL.Checklist
feat:/fix:/docs:/chore:prefix convention🤖 Generated with Claude Code
https://claude.ai/code/session_01CUQanVsnitcrmYLAWWPc3p
Summary by CodeRabbit