{"record":{"id":"356a7f0b8c9c40ca","repo":"go-delve/delve","slug":"too-many-transmit-attempts","errorCode":null,"errorMessage":"too many transmit attempts","messagePattern":"too many transmit attempts","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/gdbserial/gdbserver_conn.go","lineNumber":56,"sourceCode":"\n\tpid int // cache process id\n\n\tack                   bool // when ack is true acknowledgment packets are enabled\n\tmultiprocess          bool // multiprocess extensions are active\n\tmaxTransmitAttempts   int  // maximum number of transmit or receive attempts when bad checksums are read\n\tthreadSuffixSupported bool // thread suffix supported by stub\n\tisDebugserver         bool // true if the stub is debugserver\n\txcmdok                bool // x command can be used to transfer memory\n\tgoarch                string\n\tgoos                  string\n\n\tuseXcmd       bool // forces writeMemory to use the 'X' command\n\tnewRRCmdStyle bool // forces qRRCmd to use the post-5.8.0 style always\n\n\tlog logflags.Logger\n}\n\nvar ErrTooManyAttempts = errors.New(\"too many transmit attempts\")\n\n// GdbProtocolError is an error response (Exx) of Gdb Remote Serial Protocol\n// or an \"unsupported command\" response (empty packet).\ntype GdbProtocolError struct {\n\tcontext string\n\tcmd     string\n\tcode    string\n}\n\nfunc (err *GdbProtocolError) Error() string {\n\tcmd := err.cmd\n\tif len(cmd) > 20 {\n\t\tcmd = cmd[:20] + \"...\"\n\t}\n\tif err.code == \"\" {\n\t\treturn fmt.Sprintf(\"unsupported packet %s during %s\", cmd, err.context)\n\t}\n\treturn fmt.Sprintf(\"protocol error %s during %s for packet %s\", err.code, err.context, cmd)","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/gdbserial/gdbserver_conn.go#L38-L74","documentation":"ErrTooManyAttempts is returned by the gdbserial connection layer when sending a packet (or an acknowledgement sequence) repeatedly fails after the maximum number of retries. The GDB Remote Serial Protocol transmit path retries on checksum/no-ack failures; exhausting retries means the remote stub is not reliably acknowledging packets.","triggerScenarios":"Any gdbserial operation (continue, step, breakpoint set, memory read) that calls conn.sendPacket when the remote target repeatedly fails to ACK or respond, hitting the retry limit in the connection send loop.","commonSituations":"Flaky serial/TCP link to a remote device (embedded board, qemu); target resets or wedges mid-packet; debugserver crashes while processing a command; baud/latency issues on real serial lines.","solutions":["Check that the remote stub (debugserver/gdbserver/qemu) is still alive and the connection is not half-closed","Reconnect: restart the debug session or re-dial the remote target","Inspect network/serial reliability (latency, packet loss, baud rate) between Delve and the stub","Update the remote stub; some versions mishandle ACK mode or large packets"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// probe the link before long sessions\nconn, err := net.DialTimeout(\"tcp\", addr, 5*time.Second)\nif err != nil { return err }\nif err := conn.SetDeadline(time.Now().Add(10 * time.Second)); err != nil { return err }","typeGuard":null,"tryCatchPattern":"err := doDebugOp()\nfor attempt := 0; attempt < 3 && err != nil; attempt++ {\n    if !errors.Is(err, gdbserial.ErrTooManyAttempts) { break }\n    time.Sleep(time.Duration(attempt+1) * 500 * time.Millisecond)\n    err = doDebugOp() // or re-dial the connection first\n}","preventionTips":["Keep the link to the stub stable (wired TCP, correct baud on serial)","Monitor stub health and restart the session after stub crashes","Keep packet sizes modest and stub firmware current"],"tags":["gdbserial","network","protocol","retry"],"backgroundTag":"remote-protocol-transmit-failure","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}