Skip to content

fix(process): relay a start abort missed during listener registration and expect owner-closed Rizin starts - #11200

Merged
morluto merged 2 commits into
mainfrom
test/rizin-closeall-aborts
Nov 15, 2026
Merged

morluto merged 2 commits into
mainfrom
test/rizin-closeall-aborts

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #11147. Thanks @SandstromPL for the report, the bisect, and the hypothesis about the fake signal (it was right).

Two tests in RizinDebugSessionCoverage.part1.test.ts still expected Rizin's behaviour before #11020, which intentionally made OwnedDebuggerSessionRegistry abort in-flight starts as owner-closed on close and relay the caller's abort through a listener.

Problem and expected behavior

  • "closeAll drains concurrent startups": expected two starts in flight during closeAll() to succeed. Since fix(rizin): abort in-flight debug session starts when the manager closes #11020 they are aborted as owner-closed; closeAll() still waits for them.
  • "does not spawn Rizin when cancellation arrives during TTY validation": used abortOnCheck(2), a fake signal that flips its aborted getter on the second read and never dispatches abort. The registry now reads the caller's signal once at admission and then relays its abort event to the start's own signal, so the fake never reached the start. A real AbortSignal does dispatch abort, so the product behaviour holds.

The product behaviour from #11020 is correct for both; those test expectations were stale.

While sweeping the same root cause, tests/boundary/providers/GdbSessionManagerCoverage.test.ts > "handles a start signal that becomes aborted during listener registration" also fails on main since #11020, and that one is a product regression. GDB's private start relay used to re-check signal.aborted after addEventListener (if (signal?.aborted) relayAbort();). When #11020 moved the relay into OwnedDebuggerSessionRegistry.start, that re-check was dropped, so an abort dispatched while the listener was being added never reached the start, and the start succeeded.

Change and scope

  • The closeAll test now expects both in-flight starts to fail with AnalysisCancelledError caused by OwnerCancellation.ownerClosed, still asserts that closeAll() waits for starts that ignore the abort, asserts both processes spawned before the abort was observed are stopped, and keeps the later-admission and missing-session checks.

  • The TTY-validation test moves to RizinTtyCleanup.test.ts, which already intercepts open on the TTY path. It now aborts a real AbortController once the TTY descriptor opens, and asserts a cancellation with the caller's reason and no spawn.

  • OwnedDebuggerSessionRegistry.start re-checks the caller's signal after registering the relay, restoring GDB's previous behaviour for both GDB and Rizin. This is one line in the shared owner; no per-adapter copy.

Not included: no other product change. abortOnCheck stays for the execute tests in parts 2 and 3, which read the caller's signal directly and pass.

Contribution scope: not applicable (regression fix within existing boundaries).

Contract and boundary impact

  • Semantic owner and earliest changed stage: OwnedDebuggerSessionRegistry.start owns the caller-abort relay for GDB and Rizin starts; the re-check is restored there. closeStarts is unchanged, and the Rizin tests now follow it.

  • Contribution scope fit and linked maintainer decision: not applicable.

  • CLI and MCP/tool-catalog contract: none.

  • Provider, bridge, target-format, or platform compatibility: none.

  • Evidence, artifact, provenance, or reconstruction contract: none.

  • Target selection, authority, upstream behavior, and cleanup details (if applicable): tests only; injected Rizin process.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

  • Launch or attach to a process.

  • Inject instrumentation or run scripts/code.

  • Change process memory, registers, files, or configuration.

  • Contact network services.

  • Recover protected code or work around protections.

  • Documentation or usability only; no target interaction.

  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Product regression: the existing GDB test "handles a start signal that becomes aborted during listener registration" fails on origin/main (expected true to be false, line 2114) and passes with the registry re-check.
  • Tests added or updated: RizinDebugSessionCoverage.part1.test.ts (closeAll test updated, TTY test removed), RizinTtyCleanup.test.ts (TTY-validation cancellation test with a real signal).
  • Base reproduction: on origin/main (104b1a3), npm run test:focused -- RizinDebugSessionCoverage.part1/2/3 gave 2 failed, 52 passed, the two failures being the tests named above.
  • Lifecycle regressions covered: cancellation during startup before spawn, close during in-flight starts (including starts that ignore the abort), and admission after close.
  • Remaining proof gaps: the new TTY test aborts after open, so withOwnedFileHandle's cancellation check catches it. The manager's own post-validation check only matters for an abort between that return and the check (a microtask gap), and this test does not reach it separately. Real Rizin was not run.

Validation performed

  • npm run test:focused -- tests/boundary/providers/RizinDebugSessionCoverage.part1.test.ts tests/boundary/providers/RizinDebugSessionCoverage.part2.test.ts tests/boundary/providers/RizinDebugSessionCoverage.part3.test.ts on origin/main — 2 failed, 52 passed (reproduced).
  • npm run test:focused -- tests/boundary/providers/RizinDebugSessionCoverage.part1.test.ts tests/boundary/providers/RizinTtyCleanup.test.ts with the change — 17 passed.
  • npm run test:focused -- tests/boundary/providers/{Gdb,Rizin}*.test.ts (12 files) with the registry fix — 386 passed, 38 skipped.
  • Pre-push npm run check:fast — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS host only; real Rizin not exercised.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T14:14:21.059803Z
We couldn’t complete this review. Comment @codex review to try again.
e3ce635 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no new blocking issue was found.

Summary

Updates Rizin tests to expect cancellation during shutdown and to use a real caller signal during TTY opening. Also adds a second caller-signal check after registering the abort listener in OwnedDebuggerSessionRegistry.start.

  • Debugger starts now catch aborts that arrive while the listener is being set up.
  • Rizin close tests now expect shutdown to cancel and stop in-flight starts.
  • Rizin's TTY test now uses a real caller abort before process launch.

Reviews (2) · Last reviewed commit: "fix(process): relay a caller abort dispa..." · Reviewed by Greptile

@morluto morluto changed the title test(rizin): expect closeAll to abort in-flight starts and cancel TTY validation with a real signal fix(process): relay a start abort missed during listener registration and expect owner-closed Rizin starts Nov 15, 2026
@morluto morluto added the main-fix Fixes a failure on main; may merge while main CI is red label Nov 15, 2026
@morluto
morluto merged commit 4c5f5a3 into main Nov 15, 2026
8 of 10 checks passed
@morluto
morluto deleted the test/rizin-closeall-aborts branch November 15, 2026 15:12
@morluto morluto added area: runtime Process capture and runtime observation bug Something isn't working provider: rizin Analysis provider / engine: rizin labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working main-fix Fixes a failure on main; may merge while main CI is red provider: rizin Analysis provider / engine: rizin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] RizinDebugSessionCoverage.part1.test.ts fails on main since #11020: closeAll now aborts in-flight starts

1 participant