go-delve/delve · error
malformed stop packet: %s (wrong watch address)
Error message
malformed stop packet: %s (wrong watch address)
What it means
Thrown by parseStopPacket when a stop packet contains a 'watch', 'awatch', or 'rwatch' key-value pair whose value — the watchpoint address — is not valid hexadecimal. Delve uses this field to identify which watchpoint fired; a non-hex address makes the packet unusable.
Source
Thrown at pkg/proc/gdbserial/gdbserver_conn.go:833
return false, stopPacket{}, fmt.Errorf("malformed stop packet: %s", string(resp))
}
sp.regs[reg] = v
}
switch string(key) {
case "thread":
sp.threadID = string(value)
case "threads":
if tu != nil {
tu.Add(strings.Split(string(value), ","))
tu.Finish()
}
case "reason":
sp.reason = string(value)
case "watch", "awatch", "rwatch":
sp.watchAddr, err = strconv.ParseUint(string(value), 16, 64)
if err != nil {
return false, stopPacket{}, fmt.Errorf("malformed stop packet: %s (wrong watch address)", string(resp))
}
case "metype":
// mach exception type (debugserver extension)
metype, _ = strconv.Atoi(string(value))
case "medata":
// mach exception data (debugserver extension)
d, _ := strconv.ParseUint(string(value), 16, 64)
medata = append(medata, d)
case "jstopinfo":
jstopinfo, err := hex.DecodeString(string(value))
if err != nil {
return false, stopPacket{}, fmt.Errorf("malformed stop packet: %s (wrong jstopinfo)", string(resp))
}
parsedJstopInfo := []jsonStopPacket{}
if err := json.Unmarshal(jstopinfo, &parsedJstopInfo); err != nil {
return false, stopPacket{}, fmt.Errorf("malformed stop packet: %s (wrong jstopinfo)", string(resp))
}
sp.jstopInfo = make(map[int]stopPacket)View on GitHub (pinned to a23773e6c3)
Solutions
- Check the raw packet with gdbwire logging to see the malformed watch value
- Update the target stub firmware/driver to a version with correct watchpoint reporting
- Remove or avoid watchpoints on this target, or stop at breakpoints instead
- Reconnect and retry the watch operation
Defensive patterns
Strategy: validation
Validate before calling
// Before relying on watchpoints over gdbserial, verify the stub reports // watch hits with a hex address by setting a test watchpoint and hitting it once.
Try / catch
if err != nil && strings.Contains(err.Error(), "wrong watch address") {
// disable watchpoints on this stub and use breakpoint-based inspection
return debugWithoutWatchpoints()
} Prevention
- Test watchpoint reporting on your stub before relying on it
- Update openocd/JLink/debugserver to versions with fixed watch reporting
- Prefer hardware breakpoints over watchpoints on flaky stubs
- Log raw packets when adding watchpoint support to a custom stub
When it happens
Trigger: Execution stops on a data watchpoint and the stub sends 'watch:<value>' where value fails strconv.ParseUint(..., 16) — e.g. truncated or garbage address bytes.
Common situations: Using hardware watchpoints against buggy third-party stubs (openocd/JLink/custom) that mis-encode the watch address; packet truncation on flaky serial links; stubs where watchpoint reporting is experimental.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- malformed stop packet: %s (wrong jstopinfo)
- wrong response length, expected %d got %d
- malformed response for vCont %s
- malformed stop packet: %s
- unexpected response for vCont %c
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/33dae2b4146e15f0.
Report an issue: GitHub.