镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

No-GIL debugger: make script and statement registries race-free #314

Closed

Description

@chrisbbreuer

CI: https://github.com/zig-utils/zig-js/actions/runs/29674163787/job/88158274698
Roadmap: #143
Related: #293

Root cause

The no-GIL PR-249 case jit/int-gate-stop-budget.js produced a
suppression-free TSan race between:

  • registerParsedDebugScript mutating the shared
    Context.debug_statement_locations AutoHashMap while a child constructs a
    dynamic Function; and
  • serviceDebugStatement reading the same map from another child.

The same transaction also mutates debug_scripts and
next_debug_script_id unsafely, so fixing only the reported map access would
leave duplicate IDs/list corruption latent.

Acceptance

  • Serialize script ID assignment, script-list publication, notify-hook
    installation/removal, location-map mutation, and all concurrent reads.
  • Keep single-threaded and GIL execution on the lock-free path.
  • Never expose a partially registered script/location record.
  • Add a deterministic multi-thread dynamic-Function witness with exact
    script-ID uniqueness and result checks.
  • Pass focused normal and suppression-free TSan tests.
  • Re-run the exact jit/int-gate-stop-budget.js TSan witness.
  • Observe a green replacement full CI shard before closing.

Local evidence

  • zig build test -Dtest-filter="debug registry": 3/3 passed.
  • zig build test -Dtest-filter="debug registry" -Dtsan=true: 3/3 passed,
    suppression-free.
  • zig build threads-test -Dthreads-parallel-js=true -Dthreads-case=jit/int-gate-stop-budget.js -Dtsan=true: 1/1 passed in
    26.3 seconds.
  • zig build test -Dtest-filter=inspector: 20/20 passed.

Activity

  1. chrisbbreuer commented on Jul 19, 2026

    @chrisbbreuer
    MemberAuthor

    Landed on main as c0ea1fa.

    Validation:

    • zig build test -Dtest-filter="debug registry": 3/3 passed
    • zig build test -Dtest-filter="debug registry" -Dtsan=true: 3/3 passed, suppression-free
    • exact no-GIL TSan corpus witness: jit/int-gate-stop-budget.js passed 1/1 in 26.3s
    • zig build test -Dtest-filter=inspector: 20/20 passed

    The replacement full-CI result remains the only open acceptance item.

  2. chrisbbreuer commented on Jul 19, 2026

    @chrisbbreuer
    MemberAuthor

    Replacement run 29697559754 passed all four normal unit shards and the suppression-free tsan-parallel-js job on 7650986f. The shared script/location registry race is no longer present.

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