Skip to content

Worker inspector: make detach publication and queued client ownership race-free #293

Description

@chrisbbreuer

CI run 29647981277 exposed a Linux unit-shard UAF in finishInspectorClient while the module-worker inspector target was closing.

Root cause:

  • runtime_detached is published before the final event-queue pushes/close, so the owner can wake and destroy InspectorClient.events while the worker still uses it.
  • queued inspector commands retain raw InspectorClient pointers without ownership, so commands already behind a terminal detach/failure can outlive the owner reference.

Acceptance:

  • Publish runtime detach only after every worker-side event access is complete, with a final wake.
  • Give every queued command explicit client ownership and release it on every drain/error path.
  • Keep owner-thread queue destruction after runtime detach without leaks or deadlock.
  • Re-run the exact failing module-worker inspector test repeatedly and under TSan.
  • Confirm the normal/TSan CI shards are green.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions