{"record":{"id":"7458ea04d5600cca","repo":"go-delve/delve","slug":"malformed-stop-packet-s-wrong-jstopinfo","errorCode":null,"errorMessage":"malformed stop packet: %s (wrong jstopinfo)","messagePattern":"malformed stop packet: (.+?) \\(wrong jstopinfo\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/gdbserial/gdbserver_conn.go","lineNumber":845,"sourceCode":"\t\t\t\t}\n\t\t\tcase \"reason\":\n\t\t\t\tsp.reason = string(value)\n\t\t\tcase \"watch\", \"awatch\", \"rwatch\":\n\t\t\t\tsp.watchAddr, err = strconv.ParseUint(string(value), 16, 64)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn false, stopPacket{}, fmt.Errorf(\"malformed stop packet: %s (wrong watch address)\", string(resp))\n\t\t\t\t}\n\t\t\tcase \"metype\":\n\t\t\t\t// mach exception type (debugserver extension)\n\t\t\t\tmetype, _ = strconv.Atoi(string(value))\n\t\t\tcase \"medata\":\n\t\t\t\t// mach exception data (debugserver extension)\n\t\t\t\td, _ := strconv.ParseUint(string(value), 16, 64)\n\t\t\t\tmedata = append(medata, d)\n\t\t\tcase \"jstopinfo\":\n\t\t\t\tjstopinfo, err := hex.DecodeString(string(value))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn false, stopPacket{}, fmt.Errorf(\"malformed stop packet: %s (wrong jstopinfo)\", string(resp))\n\t\t\t\t}\n\t\t\t\tparsedJstopInfo := []jsonStopPacket{}\n\t\t\t\tif err := json.Unmarshal(jstopinfo, &parsedJstopInfo); err != nil {\n\t\t\t\t\treturn false, stopPacket{}, fmt.Errorf(\"malformed stop packet: %s (wrong jstopinfo)\", string(resp))\n\t\t\t\t}\n\t\t\t\tsp.jstopInfo = make(map[int]stopPacket)\n\t\t\t\tfor _, jsp := range parsedJstopInfo {\n\t\t\t\t\tthreadID := fmt.Sprintf(\"%d\", jsp.Tid)\n\t\t\t\t\tnewStopPacket := stopPacket{\n\t\t\t\t\t\tthreadID: threadID,\n\t\t\t\t\t\treason:   jsp.Reason,\n\t\t\t\t\t\tsig:      uint8(jsp.Signal),\n\t\t\t\t\t}\n\t\t\t\t\tparseMachException(&newStopPacket, jsp.Metype, jsp.Medata)\n\t\t\t\t\tsp.jstopInfo[jsp.Tid] = newStopPacket\n\t\t\t\t}\n\t\t\t}\n\t\t}","sourceCodeStart":827,"sourceCodeEnd":863,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/gdbserial/gdbserver_conn.go#L827-L863","documentation":"Thrown by parseStopPacket when a stop packet carries a 'jstopinfo' extension (debugserver / multiprocess stop info) whose value is not valid hex, so hex.DecodeString fails before JSON parsing. jstopinfo is a hex-encoded JSON array describing per-thread stop reasons; a corrupt encoding means Delve cannot read multi-thread stop state.","triggerScenarios":"A vCont stop reply (typically from Apple debugserver or with multiprocess extensions enabled) contains 'jstopinfo:<value>' where value is not hex — e.g. truncated or corrupted payload.","commonSituations":"iOS/macOS debugging with debugserver over a flaky USB/Wi-Fi link; stubs that partially implement the jstopinfo extension; packet fragmentation on unreliable transports.","solutions":["Reconnect to the target — the packet was likely truncated in transit","Inspect raw traffic with gdbwire logging to confirm corruption source","Update debugserver / the target OS to a version with stable jstopinfo support","Upgrade Delve; handling of debugserver stop-packet extensions improves over releases"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"wrong jstopinfo\") {\n    // retry once; jstopinfo failures are often transient packet corruption\n    if retryErr := reconnect(); retryErr == nil {\n        return continueAndCollect()\n    }\n    // fall back to per-thread stop-info queries\n    return queryStopInfoPerThread()\n}","preventionTips":["Use wired, low-loss transports for iOS/device debugging","Keep debugserver and Delve versions matched","Enable gdbwire logging to distinguish transient corruption from schema drift","Have a per-thread qThreadStopInfo fallback path in tooling built on Delve"],"tags":["gdb-serial-protocol","go","debugserver","hex-decode"],"backgroundTag":"malformed-gdb-stop-packet","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}