code-debug icon indicating copy to clipboard operation
code-debug copied to clipboard

ssh: debugging session ends with ECONNRESET

Open GitMensch opened this issue 3 years ago • 2 comments

Last lines from debugging pane with full logging:

scenario 1: program exits because of clicking "stop" in the debugger toolbar:

-gdb-exit
GDB -> App: {"outOfBandRecord":[],"resultRecords":{"resultClass":"exit","results":[]}}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-exited","output":[["id","1"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-exited","output":[["id","2"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-exited","output":[["id","3"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-exited","output":[["id","4"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-exited","output":[["id","i1"]]}]}
Error running [gdb-multiarch.exe]() over ssh!
Error: read ECONNRESET

scenario 2: program exits on its own:

GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"[Thread 15732.0x8664 exited with code 0]\n"}]}
[Thread 15732.0x8664 exited with code 0]
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-exited","output":[["id","3"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-exited","output":[["id","1"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"[Inferior 1 (process 15732) exited normally]\n"}]}
[Inferior 1 (process 15732) exited normally]
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-exited","output":[["id","i1"],["exit-code","0"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"exec","asyncClass":"stopped","output":[["reason","exited-normally"]]}]}
-gdb-exit
GDB -> App: {"outOfBandRecord":[],"resultRecords":{"resultClass":"exit","results":[]}}
Error running [gdb-multiarch.exe]() over ssh!
Error: read ECONNRESET

I guess there is some teardown order issue. In any case it is good that gdb is cleanly exited.

GitMensch avatar Mar 08 '22 13:03 GitMensch

Seems to only happen when ssh to Windows... here are the same scenarios with ssh to WSL:

scenario 1:

-gdb-exit
GDB -> App: {"outOfBandRecord":[],"resultRecords":{"resultClass":"exit","results":[]}}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-exited","output":[["id","1"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-exited","output":[["id","i1"]]}]}

scenario 2:

GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"[Inferior 1 (process 10240) exited normally]\n"}]}
[Inferior 1 (process 10240) exited normally]
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-exited","output":[["id","1"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-exited","output":[["id","i1"],["exit-code","0"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"exec","asyncClass":"stopped","output":[["reason","exited-normally"]]}]}
-gdb-exit
GDB -> App: {"outOfBandRecord":[],"resultRecords":{"resultClass":"exit","results":[]}}

GitMensch avatar Mar 08 '22 20:03 GitMensch

I see this as well and agree that it seems to only happen with an SSH to Windows. This might be an issue with the Windows version of OpenSSH, as discussed here.

brownts avatar Apr 02 '22 15:04 brownts