Skip to content

[Bug] After a Rizin debug session is stopped by its frame limit, later commands return a generic invalid-input error and status gives no reason #8024

Closed

Description

@Rinkia

Before submitting

Area

Debugging (Rizin debug sessions)

Observed behavior

In a persistent Rizin debug session, a command whose output is one NUL frame over 16 MiB stops the session, as documented. With a large enough REA_MCP_MAX_RESPONSE_BYTES, the command's Evidence says so: output_truncated: true, completion_status: "unknown" and the limitation "The Rizin command exceeded the 16777216 byte frame limit. ... The owned debugger session was stopped."

After that:

  • Every later rizin_debug_command on the same session_id returns invalid_request / invalid_input: "Analysis input is invalid. Check the arguments and try again." Its remediation says to read the input schema and "Do not repeat the unchanged call". There is no details field. The same error comes back for a session ID that never existed, so a caller can't tell a stopped session from a typo.
  • rizin_debug_session_status reports state: "closed", but no field says why or when it closed.
  • close_rizin_debug_session succeeds with target_state: "unknown", and the inferior and Rizin process are gone. That part works.

At the default REA_MCP_MAX_RESPONSE_BYTES (10 MiB), the caller never sees that limitation. The capped 16 MiB output makes a response of about 34 MB, because the output appears in both raw_result and normalized_result. The command therefore returns resource_constraint, which says "The operation completed ... The analysis result was not truncated." The next call is the first sign of trouble, and it reads as an argument error. At 64 MiB the response still didn't fit. I had to set 256 MiB to see the Evidence.

A command whose output stays under the frame limit but over the response budget (px 2500000, about 10.7 MB) also returns resource_constraint, but the session stays usable, so the two cases look the same to the caller until the next call.

Code reference: RizinDebugSessionManager.execute returns new AnalysisInputError("rizin_debug_command") when the session is missing, not ready, exited, has a protocolError, or is closing.

Reproduction

I used a self-written probe in a Linux x64 container (--network none, --cap-add SYS_PTRACE) on Ubuntu 24.04 with the Rizin 0.9.1 static release. I ran it on [email protected] and on main at 45cc93596. The results were the same.

/* utf8.c */
#include <stdio.h>
unsigned char bad[] = { 'o', 'k', 0xff, 0 };
int big[4000000];
__attribute__((noinline)) void stop_here(void) { puts("probe"); }
int main(void) { for (int i = 0; i < 4000000; i++) big[i] = i; stop_here(); return 0; }

Build with gcc -g -O0 -o /p/utf8 utf8.c, then run over MCP:

start_rizin_debug_session {"path":"/p/utf8","inferior_tty":"/dev/pts/0"}
rizin_debug_command "db @ sym.stop_here"
rizin_debug_command "dc"
rizin_debug_command "px 4000000 @ obj.big"   -> resource_constraint at 10 MiB; Evidence with the frame-limit limitation at 256 MiB
rizin_debug_command "dr rip"                 -> invalid_request, no details
rizin_debug_session_status                   -> state "closed", no reason
close_rizin_debug_session                    -> target_state "unknown"

Expected behavior

  • A command on a session that REA stopped should return an error that says the session was stopped and why (for example the retained protocol error), with recovery pointing to close_rizin_debug_session and a new session. It shouldn't be an argument error that tells the caller to fix their input.
  • rizin_debug_session_status could carry that reason next to state: "closed".
  • When a resource_constraint hides a result that itself reports a stopped session or partial output, the error could say so, or at least not state that the result was not truncated.

Impact and scope

This affects persistent Rizin debug sessions over MCP when one command prints more than 16 MiB, for example px of a large buffer. The cleanup itself works. The issue is that at the default settings the caller gets a misleading error sequence. I didn't check the other session-stopping paths (total output cap, 4096-frame cap, command deadline). They take the same protocolError branch in execute, so they likely behave the same way.

Activity

  1. jy9y4wds8z-alt commented on Oct 29, 2026

    @jy9y4wds8z-alt

    I am trying to find out who is the administrator or the organization that has control over this account and if I can find out what exactly is the issue that I have been trying to find out about and what I should be doing to help you resolve this issue so I can make sure that I can help with my business I am trying to get started

  2. jy9y4wds8z-alt commented on Oct 29, 2026

    @jy9y4wds8z-alt

    And I just want to make sure that you know that I don't have a employer or any other organization that has contacted me about this and I have not received any information by mail from a court decision that I was not aware of except that I have received two different medical data breaches and I have to start the identity monitoring service that is being provided for two years

  3. added
    bug
    on Nov 5, 2026
  4. added 2 commits that reference this issue on Nov 13, 2026
    662f5e2
    21e974c
  5. added a commit that references this issue on Nov 14, 2026
    ee339e5
  6. added
    area: cli
    provider: rizin
    area: providers
    and removed on Nov 22, 2026
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

    area: cliarea: providersbugprovider: rizin

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions