GDB Server gets EOF from Cutter
Environment information
- Operating System: windows 10
- Cutter version: 2.0.3
- File format:
- Arch: x64
- Type: exe
Describe the bug Communication with gdb server fails(due to protocol error?) and cutter tries to proceed with debugging but runs into segfault.
Gdb server from winbuilds(arch x64) ran with command
gdbserver --remote-debug 127.0.0.1:53535 file.exe (target executable arch is x32)
outputs following:
Listening on port 53535
Remote debugging from host 127.0.0.1
readchar: Got EOF
[getpkt: discarding char ' ']
Remote side has terminated connection. GDBserver will reopen the connection.
To Reproduce Steps to reproduce the behavior:
- Setup cutter project(with analyzed binary)
- Setup gdb server (run with elevation)
- Connect to gdb server from cutter
Expected behavior Debugger should successfuly connect and proceed with debugging.
Additional context Dump: crash.zip
@rgnter could you please retry with the 2.0.4-rc2 prerelease? There were some important GDB fixes in it. There is a chance it is fixed. https://github.com/rizinorg/cutter/releases/tag/v2.0.4-rc2
Does not work with version you have provided me with.
I have compiled cutter and found the issue:
The DebugActions::onAttachedRemoteDebugger is for some unknown reason to me, being called twice.
- When called the first time
DebugActions::remoteDialogis nullptr(and the destructor has not been called), causing crash. - When called second time the
remoteDialogis not nullptr, as expected.
A simple null check in the function fixes everything.

Fixed in PR #2830
The issue still occurs for me:
Remote debugging from host 127.0.0.1
[remote] readchar: readchar: Got EOF
[remote] getpkt: [getpkt: discarding char '�']
Remote side has terminated connection. GDBserver will reopen the connection.