Skip to content

x/sys/unix: ptrace API assumes GOARCH(target) == GOARCH(host) #9739

@4ad

Description

@4ad

syscall.PtraceGetRegs uses syscall.PtraceRegs. syscall.PtraceRegs depends on the host, e.g. if your binary is linux/386 syscall.PtraceRegs has 16 registers. But it's possible to run that linux/386 on an amd64 kernel, and attach to an amd64 process. In that case, syscall.PtraceRegs is not good anymore because the amd64 variant has 26 registers.

I have found this while trying to debug an arm64 Go process using an arm Go debugger.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions