Skip to content

gdb: Let binary replies reach their query - #1

Merged
oleavr merged 1 commit into
mainfrom
fix-binary-replies
Nov 12, 2026
Merged

oleavr merged 1 commit into
mainfrom
fix-binary-replies

Conversation

@mrmacete

Copy link
Copy Markdown
Member

Replies are told apart from asynchronous notifications by their first byte, so a binary reply starting with S, T, W, X or O, such as the result of an x memory read, was taken for a stop, exit or console output notification. The query then never got its reply and timed out after 30 seconds, and an O could even close the connection.

Add query_with_ordered_predicate(), whose predicate is consulted ahead of notifications, but only while its request is the oldest one awaiting a reply. Replies arrive in request order, so the packet can only be for that request, which keeps the predicate from claiming replies meant for pipelined requests ahead of it. Existing queries are unaffected.

The oldest request is found by iterating the queue, like the rest of the dispatch logic does, as ArrayQueue.peek() was observed to disagree with iteration after many removals.

Replies are told apart from asynchronous notifications by their first
byte, so a binary reply starting with `S`, `T`, `W`, `X` or `O`, such as
the result of an `x` memory read, was taken for a stop, exit or console
output notification. The query then never got its reply and timed out
after 30 seconds, and an `O` could even close the connection.

Add `query_with_ordered_predicate()`, whose predicate is consulted ahead
of notifications, but only while its request is the oldest one awaiting
a reply. Replies arrive in request order, so the packet can only be for
that request, which keeps the predicate from claiming replies meant for
pipelined requests ahead of it. Existing queries are unaffected.

The oldest request is found by iterating the queue, like the rest of
the dispatch logic does, as `ArrayQueue.peek()` was observed to
disagree with iteration after many removals.
@mrmacete
mrmacete requested a review from oleavr November 12, 2026 16:45
@oleavr
oleavr merged commit 4d4c8fd into main Nov 12, 2026
6 of 7 checks passed
@oleavr

oleavr commented Nov 12, 2026

Copy link
Copy Markdown
Member

Whoah, great catch!! Thanks! 🙌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants