misson20000 / twili

Homebrew debug monitor for the Nintendo Switch.
GNU General Public License v3.0
184 stars 23 forks source link

gdb: vAttach crash on 7.0.1 #68

Closed misson20000 closed 5 years ago

misson20000 commented 5 years ago

Thanks to @leoetlino

Steps to reproduce:

  1. Connect the Switch to the PC
  2. Open twili-gdb
  3. Enter target extended-remote | twib -vv gdb
  4. Enter attach 0x<pid>

Result:

(gdb) attach 0x8c
Attaching to Remote target
[0][2019-03-31 14:13] tool/GdbConnection.cpp:177: gdb connection got 0xe bytes in
[0][2019-03-31 14:13] tool/GdbStub.cpp:858: got message (0xa bytes)
[0][2019-03-31 14:13] tool/GdbStub.cpp:865: got packet, ident: v
[0][2019-03-31 14:13] tool/GdbStub.cpp:180: got v'Attach'
[0][2019-03-31 14:13] tool/GdbStub.cpp:370: decoded PID: 0x8c
[0][2019-03-31 14:13] tool/SocketClient.cpp:49: sent request
[0][2019-03-31 14:13] platform/unix/platform/EventLoop.cpp:105: event thread notified: '.'
[0][2019-03-31 14:13] common/SocketMessageConnection.cpp:56: pumping out 0x28 bytes
Ignoring packet error, continuing...

At this point, a fatal error shows up on the console (crash_report.txt is the associated crash report)

Second attempt with set debug remote 1:

(gdb) set debug remote 1
(gdb) attach 0x83
Attaching to Remote target
Sending packet: $vAttach;83#71...[0][2019-03-31 14:18] tool/GdbConnection.cpp:177: gdb connection got 0xe bytes in
[0][2019-03-31 14:18] tool/GdbStub.cpp:858: got message (0xa bytes)
[0][2019-03-31 14:18] tool/GdbStub.cpp:865: got packet, ident: v
[0][2019-03-31 14:18] tool/GdbStub.cpp:180: got v'Attach'
[0][2019-03-31 14:18] tool/GdbStub.cpp:370: decoded PID: 0x83
[0][2019-03-31 14:18] tool/SocketClient.cpp:49: sent request
[0][2019-03-31 14:18] platform/unix/platform/EventLoop.cpp:105: event thread notified: '.'
[0][2019-03-31 14:18] common/SocketMessageConnection.cpp:56: pumping out 0x28 bytes
Timed out.
Timed out.
Timed out.
Ignoring packet error, continuing...
Packet vAttach (attach) is supported
Sending packet: $qC#b4...Timed out.
Timed out.

Console crashes with the same fatal error.

https://gist.githubusercontent.com/leoetlino/b75267ecd0eb4b749ee55aa051274a3a/raw/cfbe12d5699092311545e545e1d818ff0d2ad8f3/1_crash_report.txt