Skip to content

stage1 audit:all fails on hello world: mode-provenance sizeof/alignof disagreement in the in-unit pcre2 corpus (match_) #2636

Closed

Description

@ehartford

A :dev stage1 (empty bundle slots, so the pcre2 corpus compiles in-unit) fails audit:all on a one-line program with a mode-provenance violation inside the corpus. The installed release compiler, which links the corpus as a .wo bundle, audits the same program clean. Either the audit is wrong about the in-unit corpus, or Sema and the AST disagree on four sizeof/alignof type arguments in pcre2's match_; in both cases a check is red on valid code.

Repro (main a261b65, macOS arm64)

$ cat main.w
fn main: print("ok")
$ out/bootstrap/bin/with-stage1 analyze main.w audit:all   # stage1 from `with build :dev` at a261b6598
violation: mode-provenance: sizeof/alignof type argument: Sema's type argument and the AST type node disagree in 4 of 466 decisions; first: match_ subject 411326: owner=llvm-kind-8 derived=none node 411326
compiler-analysis-audit: facts=939942 violations=1 FAILED
rc=1
$ ~/.local/bin/with analyze main.w audit:all             # installed, same commit
compiler-analysis-audit: facts=20477 violations=0 ok

Route: with-stage1 analyze main.w 'select:kind=…,name~match_' to name the four sizeof sites, then compare Sema's recorded type argument with the node's.

Found during the 2026-10-25 issue triage (#1173).

Activity

  1. added
    bug
    on Oct 25, 2026
  2. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): reproduced; the runs are in the body.

    post-release: only an unbundled :dev stage1 compiles the corpus in-unit, and the release compiler audits clean; it does matter for the emit-C lane (#955), which also compiles the corpus in-unit.

  3. added this to the post-v0.16.0 milestone on Oct 28, 2026
  4. added a commit that references this issue on Nov 7, 2026
  5. ehartford commented on Nov 7, 2026

    @ehartford
    ContributorAuthor

    Fixed in #3064 (173ef04): T.zeroed() lowered to the same const zst(T) the reset-on-move blank uses, so the use-after-kill validator read the in-unit stc corpus's end() as a read after a kill and the drop-state tracker read the value as Reset. It is its own constant now (ConstKind.CK_ZEROED), materialized as before by both backends. with-stage1 analyze main.w audit:all on hello world: violations=0. Pinned by test/behavior/behav_2636_zeroed_value_read_back.w.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreproduced

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions