Skip to content

Facade: audit:all flags sqlite3_errmsg's rendered call as invalidating a parameter that holds no modeled resource (#1674 class) #1834

Closed

Description

@ehartford

Spec: §16.2b.14 / #1674 (the effect names the parameter its projection presents). with analyze <prog> audit:all fails on every program that uses the SQLite facade (lib/facades/sqlite3.w):

with analyze test/behavior/behav_sqlite_facade_exec_no_callback.w audit:all
violation: contract: the rendered call of 'sqlite3_errmsg' invalidates views of its parameter 0, which holds no modeled resource; the effect names the wrong parameter (#1674, §16.2b.14)
compiler-analysis-audit: ... violations=1 FAILED

Same on behav_sqlite_facade_failed_open_errmsg.w and behav_sqlite_facade_end_to_end.w. Verified on 355c20b with its own stage1 (not introduced by D76). sqlite3_errmsg is returns borrow CStr from param 0 + valid on failed (#1612): the failed-state rendering FailedDatabase.errmsg is the likely site whose call effect is registered against a parameter that holds no modeled resource.

Expected: audit:all clean. The battery does not run audit:all over behavior fixtures (contract-view-tests runs it over test/contract ok_ fixtures only), so nothing caught it — a tool that stayed silent; consider adding a SQLite-shaped valid on failed fixture to test/contract.

Activity

  1. added a commit that references this issue on Oct 3, 2026
  2. ehartford commented on Oct 3, 2026

    @ehartford
    ContributorAuthor

    Fixed on main by 7b56d3f (stack #1979, battery green on 029574d). The audit was wrong: a failed-state facade type holds the modeled resource (facade_type_holds_resource); audit:all 1 → 0 violations; test/contract/ok_valid_on_failed.w. The borrowed-handle sibling is #1977.

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