Skip to content

audit:all reports 'drop of _5 after ... moved it out' on behav_callable_alias_field_call.w; debug-alloc is clean #1858

Closed

Description

@ehartford

Repro

with analyze test/behavior/behav_callable_alias_field_call.w audit:all (main 355c20b, and fix-misc 983cceb2):

violation: ownership MIR: fn sym837 stmt4 span=0: drop of _5 after a path reaching it moved it out and before its reset (Moved): this frees the value its new owner holds (§2.5.1)
compiler-analysis-audit: ... violations=1 FAILED

The test itself passes, and with run --debug-alloc (also with WITH_ALLOC_NO_REUSE=1) reports no double free, leak count=0.

Expected

Either the validator is right and a callable value (let run = c.run; run(21), D63) is dropped after being moved — a real defect the allocator misses because the environment is empty — or the validator is wrong about a callable's drop. One of the two is a bug; the audit and the allocator cannot both be right.

Route

Debug allocator first (done: clean), then --dump-drop-state / --trace-ownership main:_5 on the reduced repro, then the validator's verdict for _5 (mir_whole_drop_verdict). Found while running audit:all over loop/closure programs for the D65 changes; independent of them.

Activity

  1. ehartford commented on Oct 3, 2026

    @ehartford
    ContributorAuthor

    Fixed on main by 792351b (stack #2007, battery green on 0f13a62). The audit was right: a callable temporary was moved then dropped; it is now read in place (OK_COPY); audit:all 1 → 0.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions