Skip to content

syscall: slice bounds out of range crash on openbsd 5.6 #9102

@mikioh

Description

@mikioh
a program using net.Interfaces of any version of go (including tip) crashes on openbsd
5.6.

e.g., go test -v -run=Interface
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
syscall.(*anyMessage).toRoutingMessage(0xc208058000, 0xc208058000, 0x458, 0x4c7, 0x0,
0x0)
        /home/mikioh/go/src/syscall/route_openbsd.go:18 +0x4d1
syscall.ParseRoutingMessage(0xc208058000, 0x458, 0x4c7, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/mikioh/go/src/syscall/route_bsd.go:210 +0x1c5
net.interfaceTable(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/mikioh/go/src/net/interface_bsd.go:23 +0x23b
net.Interfaces(0x0, 0x0, 0x0, 0x0, 0x0)
        /home/mikioh/go/src/net/interface.go:81 +0x54
net.loopbackInterface(0xc20802b3d0)
        /home/mikioh/go/src/net/interface_test.go:16 +0x27
net.init·2()
        /home/mikioh/go/src/net/ipraw_test.go:46 +0x39
net.init()
        /home/mikioh/go/src/net/cgo_unix.go:164 +0x8ef5
net_test.init()
        /home/mikioh/go/src/net/example_test.go:36 +0x42
main.init()
        net/_test/_testmain.go:370 +0x4a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions