delve/pkg/proc
Alessandro Arzilli 2827145f1e
proc/gdbserver: ignore spurious stop packet from debugserver (#3021)
When we send an interrupt request to debugserver we, sometimes, get one
extra spurious stop packet back.
This stop packet gets interpreted as a response to a qThreadStopInfo request
we make causing the protocol to become desynchronized for a while, until
eventually some kind of error appears.

Here's an example of this problem, distilled from issue #3013:

     1 <- $vCont;c#a8
     2 <- interrupt
     3 -> $T05thread:12efb47;threads:12efb47,12efb8d,12efb8e,12efb8f,12efb90,12efb91;thread-pcs:10abe83,7ff81b20e2be,7ff81b20e3ea,...
     4 <- $qThreadStopInfo12efb8e#28
     5 -> $T05thread:12efb47;threads:12efb47,12efb8d,12efb8e,12efb8f,12efb90,12efb91;thread-pcs:10abe83,7ff81b20e2be,7ff81b20e3ea,...
     6 <- $qThreadStopInfo12efb8f#29
     7 -> $T00thread:12efb8e;threads:12efb47,12efb8d,12efb8e,12efb8f,12efb90,12efb91;thread-pcs:10abe83,7ff81b20e2be,7ff81b20e3ea,...
     8 <- $qThreadStopInfo12efb90#f4
     9 -> $T00thread:12efb8f;threads:12efb47,12efb8d,12efb8e,12efb8f,12efb90,12efb91;thread-pcs:10abe83,7ff81b20e2be,7ff81b20e3ea,...
    10 <- $qThreadStopInfo12efb91#f5
    11 -> $T00thread:12efb90;threads:12efb47,12efb8d,12efb8e,12efb8f,12efb90,12efb91;thread-pcs:10abe83,7ff81b20e2be,7ff81b20e3ea,...
    12 <- $qThreadStopInfo12efb47#f6
    13 -> $T00thread:12efb91;threads:12efb47,12efb8d,12efb8e,12efb8f,12efb90,12efb91;thread-pcs:10abe83,7ff81b20e2be,7ff81b20e3ea,...
    14 <- $qThreadStopInfo12efb8d#27
    15 -> $T05thread:12efb47;threads:12efb47,12efb8d,12efb8e,12efb8f,12efb90,12efb91;thread-pcs:10abe83,7ff81b20e2be,7ff81b20e3ea,...
    16 <- $p0;thread:12efb8e;#f5
    17 -> $T00thread:12efb8d;threads:12efb47,12efb8d,12efb8e,12efb8f,12efb90,12efb91;thread-pcs:10abe83,7ff81b20e2be,7ff81b20e3ea,...

response (3) is interpreted as the response to the vCont request at (1). We
then make a qThreadStopInfo request (4) and receive a stop packet in
response (5). Packet (5) is interpreted as the response to (4) but it
actually isn't, note how the thread ID is different, packet (5) is actually
a spurious stop packet sent by debug server. From response (5) onward the
protocol is desynchronized, none of the response we process are actually the
response to the preceding request.
This eventually causes a failure at packet (17) which debugserver sent as
the response to request (14) but we interpret as the response to (16).

Fixes #3013
2022-06-08 10:56:50 -07:00
..
amd64util fmt code (#2826) 2021-12-13 10:25:23 -08:00
core proc/core: return true for calls to Recorded (#2979) 2022-05-04 10:56:41 -07:00
debuginfod Implement source listing from debuginfo (#2885) 2022-01-30 13:39:30 -08:00
fbsdutil pkg/proc: fix and improve freebsd register handling (#3019) 2022-05-31 16:04:36 -07:00
gdbserial proc/gdbserver: ignore spurious stop packet from debugserver (#3021) 2022-06-08 10:56:50 -07:00
internal/ebpf pkg/proc: switch to Dual MIT/GPL license for ebpf (#2849) 2021-12-30 20:14:37 +01:00
linutil proc: fix RFLAGS corruption after call injection on amd64 (#3002) 2022-05-05 08:41:40 -07:00
macutil fmt code (#2826) 2021-12-13 10:25:23 -08:00
native pkg/proc: fix and improve freebsd register handling (#3019) 2022-05-31 16:04:36 -07:00
test pkg/proc: fix and improve freebsd register handling (#3019) 2022-05-31 16:04:36 -07:00
winutil proc: support function call injection on arm64 (#2996) 2022-05-03 10:46:24 -07:00
amd64_arch.go proc: support function call injection on arm64 (#2996) 2022-05-03 10:46:24 -07:00
amd64_disasm.go proc: remove duplicate Registers.Get implementations (#2415) 2021-04-28 10:00:26 -07:00
arch.go proc: support function call injection on arm64 (#2996) 2022-05-03 10:46:24 -07:00
arm64_arch.go proc: support function call injection on arm64 (#2996) 2022-05-03 10:46:24 -07:00
arm64_disasm.go proc: remove duplicate Registers.Get implementations (#2415) 2021-04-28 10:00:26 -07:00
bininfo.go *: fix some typos 2022-03-23 16:10:00 +01:00
breakpoints.go proc,service: represent logical breakpoints explicitly (#2946) 2022-05-25 13:58:26 -07:00
disasm.go proc: remove duplicate Registers.Get implementations (#2415) 2021-04-28 10:00:26 -07:00
doc.go Move top-level packages into pkg 2017-02-08 12:17:19 -08:00
dump.go *: fix some typos 2022-03-23 16:10:00 +01:00
dwarf_export_test.go proc: fix RFLAGS corruption after call injection on amd64 (#3002) 2022-05-05 08:41:40 -07:00
dwarf_expr_test.go pkg/proc: merge register data before writing to register (#2699) 2021-09-24 15:27:44 -07:00
eval_go117.go proc: better error messages for ambiguous function calls/type casts (#2903) 2022-02-22 09:55:59 -08:00
eval_go118.go proc: better error messages for ambiguous function calls/type casts (#2903) 2022-02-22 09:55:59 -08:00
eval.go proc: allow low index == len in reslice (#2951) 2022-03-29 09:57:11 -07:00
fncall.go proc: fix RFLAGS corruption after call injection on amd64 (#3002) 2022-05-05 08:41:40 -07:00
goroutine_cache.go proc/*,service: replace uses of uintptr with uint64 (#2163) 2020-09-09 10:36:15 -07:00
i386_arch.go Misc fixes for test problems (#2751) 2021-10-18 13:17:47 -07:00
i386_disasm.go proc: remove duplicate Registers.Get implementations (#2415) 2021-04-28 10:00:26 -07:00
interface.go proc: move resume notify and manual stop handling to Target (#2921) 2022-03-21 12:42:37 -07:00
mem.go pkg/proc: merge register data before writing to register (#2699) 2021-09-24 15:27:44 -07:00
moduledata.go _scripts: auto check that pkg/proc and runtime are synchronized (#2557) 2021-08-23 11:32:02 -07:00
pe.go proc: fix typo 'unkown' => 'unknown' (#2473) 2021-05-10 11:36:03 -07:00
proc_general_test.go proc,locspec: support setting breakpoints by func name on generic funcs (#2745) 2021-10-30 11:52:26 -07:00
proc_linux_test.go proc/*: add launch option to disable ASLR (#2202) 2020-10-21 12:50:52 -07:00
proc_test.go proc,service: represent logical breakpoints explicitly (#2946) 2022-05-25 13:58:26 -07:00
proc_unexported_test.go proc: correctly truncate the result of binary ops on integers (#2463) 2021-05-17 10:31:05 -07:00
proc_unix_test.go tests: fix TestIssue419 (#2682) 2021-08-31 10:44:57 -07:00
registers.go proc: support function call injection on arm64 (#2996) 2022-05-03 10:46:24 -07:00
scope_test.go proc/*: minor miscellaneous code cleanups (#2790) 2021-11-26 08:06:23 -08:00
stack.go Updates for go1.18beta1 (#2831) 2021-12-22 10:26:21 -08:00
stackwatch.go proc,service: represent logical breakpoints explicitly (#2946) 2022-05-25 13:58:26 -07:00
target_exec.go proc,service: represent logical breakpoints explicitly (#2946) 2022-05-25 13:58:26 -07:00
target.go pkg/proc: fix and improve freebsd register handling (#3019) 2022-05-31 16:04:36 -07:00
threads.go proc: support function call injection on arm64 (#2996) 2022-05-03 10:46:24 -07:00
types.go proc,dwarf/godwarf: support parametric types with dictionaries 2021-10-02 15:44:30 +02:00
variable_test.go pkg/proc: Move proc exec funcs to Target methods 2020-03-25 17:45:12 +01:00
variables_test.go service/test,proc: move variable evaluation test to pkg/proc (#3024) 2022-06-08 08:59:42 -07:00
variables.go proc: fix prettyprint for register components with large values (#3022) 2022-06-02 10:16:32 -07:00
x86_disasm.go proc: remove duplicate Registers.Get implementations (#2415) 2021-04-28 10:00:26 -07:00