Repository navigation
fix(process): relay a start abort missed during listener registration and expect owner-closed Rizin starts - #11200
Conversation
… validation with a real signal
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryUpdates 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
Reviews (2) · Last reviewed commit: "fix(process): relay a caller abort dispa..." · Reviewed by Greptile |
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.tsstill expected Rizin's behaviour before #11020, which intentionally madeOwnedDebuggerSessionRegistryabort in-flight starts as owner-closed on close and relay the caller's abort through a listener.Problem and expected behavior
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.abortOnCheck(2), a fake signal that flips itsabortedgetter on the second read and never dispatchesabort. The registry now reads the caller's signal once at admission and then relays itsabortevent to the start's own signal, so the fake never reached the start. A realAbortSignaldoes dispatchabort, 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-checksignal.abortedafteraddEventListener(if (signal?.aborted) relayAbort();). When #11020 moved the relay intoOwnedDebuggerSessionRegistry.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
AnalysisCancelledErrorcaused byOwnerCancellation.ownerClosed, still asserts thatcloseAll()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 interceptsopenon the TTY path. It now aborts a realAbortControlleronce the TTY descriptor opens, and asserts a cancellation with the caller's reason and no spawn.OwnedDebuggerSessionRegistry.startre-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.
abortOnCheckstays for theexecutetests 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.startowns the caller-abort relay for GDB and Rizin starts; the re-check is restored there.closeStartsis 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
expected true to be false, line 2114) and passes with the registry re-check.RizinDebugSessionCoverage.part1.test.ts(closeAll test updated, TTY test removed),RizinTtyCleanup.test.ts(TTY-validation cancellation test with a real signal).origin/main(104b1a3),npm run test:focused -- RizinDebugSessionCoverage.part1/2/3gave 2 failed, 52 passed, the two failures being the tests named above.open, sowithOwnedFileHandle'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.tson origin/main — 2 failed, 52 passed (reproduced).npm run test:focused -- tests/boundary/providers/RizinDebugSessionCoverage.part1.test.ts tests/boundary/providers/RizinTtyCleanup.test.tswith 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.npm run check:fast— passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.