{"record":{"id":"b96180ce12be3d3c","repo":"go-delve/delve","slug":"unsupported-operating-system-attempting-to-find-go","errorCode":null,"errorMessage":"unsupported operating system attempting to find Goroutine on Thread","messagePattern":"unsupported operating system attempting to find Goroutine on Thread","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/gdbserial/gdbserver.go","lineNumber":1623,"sourceCode":"\tdefault:\n\t\treturn strings.HasPrefix(fn.Name, \"syscall.Syscall\") || strings.HasPrefix(fn.Name, \"syscall.RawSyscall\")\n\t}\n}\n\n// loadGInstr returns the correct MOV instruction for the current\n// OS/architecture that can be executed to load the address of G from an\n// inferior's thread.\nfunc (p *gdbProcess) loadGInstr() ([]byte, error) {\n\tvar op []byte\n\tswitch p.bi.GOOS {\n\tcase \"windows\", \"darwin\", \"freebsd\":\n\t\t// mov rcx, QWORD PTR gs:{uint32(off)}\n\t\top = []byte{0x65, 0x48, 0x8b, 0x0c, 0x25}\n\tcase \"linux\":\n\t\t// mov rcx,QWORD PTR fs:{uint32(off)}\n\t\top = []byte{0x64, 0x48, 0x8B, 0x0C, 0x25}\n\tdefault:\n\t\tpanic(\"unsupported operating system attempting to find Goroutine on Thread\")\n\t}\n\toffset, err := p.bi.GStructOffset(p.Memory())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbuf := &bytes.Buffer{}\n\tbuf.Write(op)\n\tbinary.Write(buf, binary.LittleEndian, uint32(offset))\n\treturn buf.Bytes(), nil\n}\n\nfunc (p *gdbProcess) MemoryMap() ([]proc.MemoryMapEntry, error) {\n\tr := []proc.MemoryMapEntry{}\n\taddr := uint64(0)\n\tfor addr != ^uint64(0) {\n\t\tmri, err := p.conn.memoryRegionInfo(addr)\n\t\tif err != nil {\n\t\t\treturn nil, err","sourceCodeStart":1605,"sourceCodeEnd":1641,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/gdbserial/gdbserver.go#L1605-L1641","documentation":"Delve's gdbserial backend reads the goroutine (G) pointer from thread-local storage by emitting an arch-specific 'mov rcx, gs:/fs:offset' instruction and executing it in the debuggee. This panic fires when the host OS is not one of the supported cases (windows, linux) for which the TLB segment-register encoding is known. It is a hard programming/configuration guard, not a recoverable error.","triggerScenarios":"Calling the goroutine-lookup code on a thread while running on an OS other than windows or linux (e.g. freebsd with the gdbserial backend, since amd64 the switch only handles those two).","commonSituations":"Porting Delve to an unsupported OS, running the gdbserial backend (lldb/rr/macos debugserver) on a platform where GStructOffset/segment-register access was never implemented.","solutions":["Run on a supported OS (linux or windows) for amd64, or use the native backend instead of gdbserial","Check go-delve delve version; newer releases may have added your OS to this switch","If porting, add a case for your OS emitting the correct mov rcx, seg:{off} opcode bytes","File/track an upstream issue for OS support"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if runtime.GOOS != \"linux\" && runtime.GOOS != \"windows\" {\n    return fmt.Errorf(\"gdbserial goroutine lookup unsupported on %s\", runtime.GOOS)\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        err = fmt.Errorf(\"goroutine lookup failed: %v\", r)\n    }\n}()","preventionTips":["Verify OS support before using the gdbserial backend","Prefer the native backend on supported platforms","Check delve release notes for your OS"],"tags":["gdbserial","os-compatibility","panic"],"backgroundTag":"unsupported-os-panic","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}