[PR #4150] [CLOSED] fix(gdb): ignore quoted groups=[ when reading inferior lists #6090

Closed
opened 2026-10-31 01:11:46 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4150
Author: @viniciusdsandrade
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: fix/gdb-quoted-groups-marker


📝 Commits (2)

  • c2cc5f9 fix(gdb): ignore quoted groups=[ when reading inferior lists
  • ce428a7 test(gdb): parse quoted paths that contain groups=[

📊 Changes

2 files changed (+22 additions, -5 deletions)

View changed files

📝 src/gdb/GdbSessionManager.ts (+6 -4)
📝 tests/boundary/providers/GdbSessionManagerCoverage.test.ts (+16 -1)

📄 Description

Summary

Fixes #3993

Treat a quoted GDB MI field whose text contains groups=[ as inventory data, not as a nested thread-group list, so session close can verify an empty inferior inventory and send -gdb-exit. Unquoted nested groups=[...] still fails closed.

Problem and expected behavior

Closing a GDB session fails when the complete inferior inventory contains groups=[ inside a quoted executable pathname, even when no inferior has a live PID. Close returns cleanup_incomplete with cleanup_reason "Owned GDB inferior detach could not be verified: GDB returned an unknown recursive inferior list.", leaves the owned session ready, and does not send the normal exit command.

gdbThreadGroupPids already skipped brackets while quoted, then rejected the record if the raw body contained the substring groups=[. A path such as fixture/groups=[.out therefore looked recursive. fixture/plain.out, fixture/groups=.out, and fixture/bracket[.out closed successfully.

Expected behavior: a quoted groups=[ substring does not make the inferior list unknown. With no live PID, close reports none_observed and sends -gdb-exit. An unquoted nested groups=[ field remains unknown.

Change and scope

  • In src/gdb/GdbSessionManager.ts, fail closed only when an unquoted groups=[ marker appears while scanning the list.
  • In tests/boundary/providers/GdbSessionManagerCoverage.test.ts, cover quoted extra/executable markers, a live pid with that path, and unquoted nested groups.

Contract and boundary impact

  • Semantic owner and earliest changed stage: GDB MI thread-group parsing in src/gdb/GdbSessionManager.ts.
  • Contribution scope fit and linked maintainer decision: not applicable (bug fix within existing GDB session close).
  • CLI and MCP/tool-catalog contract: unchanged schemas. Retains cleanup_incomplete when the list is genuinely unknown.
  • Provider, bridge, target-format, or platform compatibility: GDB MI -list-thread-groups --recurse 1.
  • Evidence, artifact, provenance, or reconstruction contract: unmodified.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): close still refuses to signal unverified inferiors; quoted path bytes are no longer treated as nested lists.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects:

  • 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

  • Tests added or updated:
    • tests/boundary/providers/GdbSessionManagerCoverage.test.ts: quoted extra="groups=[" and executable="fixture/groups=[.out" parse; a live pid in that group counts as 1; unquoted nested groups=[ remains undefined.
  • Base reproduction or other evidence: on the base revision, body.includes("groups=[") returns undefined for a quoted executable path containing that substring, so close cannot verify detach.
  • User-visible CLI/MCP output (if applicable): close_gdb_session completes for an inventory whose only groups=[ text is inside quotes.
  • Remaining proof gaps: tests were verified by source inspection; CI executes the deterministic suite. Real GDB output generation was not run.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • No local test commands were run: verification is source-derived; CI executes the deterministic suite.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: none run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: fail-closed nested lists remain; quoted path bytes are not treated as recursive inferior structure.

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4150 **Author:** [@viniciusdsandrade](https://github.com/viniciusdsandrade) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/gdb-quoted-groups-marker` --- ### 📝 Commits (2) - [`c2cc5f9`](https://github.com/morluto/rea/commit/c2cc5f971d8dc36eb5f7eb38dcde9ecc2ce10944) fix(gdb): ignore quoted groups=[ when reading inferior lists - [`ce428a7`](https://github.com/morluto/rea/commit/ce428a788e321a68a7134b7fa8ec54380ce00a73) test(gdb): parse quoted paths that contain groups=[ ### 📊 Changes **2 files changed** (+22 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/gdb/GdbSessionManager.ts` (+6 -4) 📝 `tests/boundary/providers/GdbSessionManagerCoverage.test.ts` (+16 -1) </details> ### 📄 Description ## Summary Fixes #3993 Treat a quoted GDB MI field whose text contains `groups=[` as inventory data, not as a nested thread-group list, so session close can verify an empty inferior inventory and send `-gdb-exit`. Unquoted nested `groups=[...]` still fails closed. ## Problem and expected behavior Closing a GDB session fails when the complete inferior inventory contains `groups=[` inside a quoted executable pathname, even when no inferior has a live PID. Close returns `cleanup_incomplete` with `cleanup_reason` "Owned GDB inferior detach could not be verified: GDB returned an unknown recursive inferior list.", leaves the owned session `ready`, and does not send the normal exit command. `gdbThreadGroupPids` already skipped brackets while quoted, then rejected the record if the raw body contained the substring `groups=[`. A path such as `fixture/groups=[.out` therefore looked recursive. `fixture/plain.out`, `fixture/groups=.out`, and `fixture/bracket[.out` closed successfully. Expected behavior: a quoted `groups=[` substring does not make the inferior list unknown. With no live PID, close reports `none_observed` and sends `-gdb-exit`. An unquoted nested `groups=[` field remains unknown. ## Change and scope - In `src/gdb/GdbSessionManager.ts`, fail closed only when an unquoted `groups=[` marker appears while scanning the list. - In `tests/boundary/providers/GdbSessionManagerCoverage.test.ts`, cover quoted extra/executable markers, a live pid with that path, and unquoted nested groups. ## Contract and boundary impact - Semantic owner and earliest changed stage: GDB MI thread-group parsing in `src/gdb/GdbSessionManager.ts`. - Contribution scope fit and linked maintainer decision: not applicable (bug fix within existing GDB session close). - CLI and MCP/tool-catalog contract: unchanged schemas. Retains `cleanup_incomplete` when the list is genuinely unknown. - Provider, bridge, target-format, or platform compatibility: GDB MI `-list-thread-groups --recurse 1`. - Evidence, artifact, provenance, or reconstruction contract: unmodified. - Target selection, authority, upstream behavior, and cleanup details (if applicable): close still refuses to signal unverified inferiors; quoted path bytes are no longer treated as nested lists. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. Expected effects: - [ ] Read existing files or captured data. - [x] 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 - Tests added or updated: - `tests/boundary/providers/GdbSessionManagerCoverage.test.ts`: quoted `extra="groups=["` and `executable="fixture/groups=[.out"` parse; a live pid in that group counts as 1; unquoted nested `groups=[` remains undefined. - Base reproduction or other evidence: on the base revision, `body.includes("groups=[")` returns undefined for a quoted executable path containing that substring, so close cannot verify detach. - User-visible CLI/MCP output (if applicable): `close_gdb_session` completes for an inventory whose only `groups=[` text is inside quotes. - Remaining proof gaps: tests were verified by source inspection; CI executes the deterministic suite. Real GDB output generation was not run. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - No local test commands were run: verification is source-derived; CI executes the deterministic suite. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: none run. - Package or release metadata impact: none. - Security, privacy, process, or containment review: fail-closed nested lists remain; quoted path bytes are not treated as recursive inferior structure. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:11:46 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6090
No description provided.