Open qdm12 opened 2 years ago
Hmm, this method is using the same serialization that we do for all other netlink messages. Do you get the same error in any of the other tests?
FYI I'm also seeing this:
fatal error: checkptr: converted pointer straddles multiple allocations
goroutine 237 [running]:
runtime.throw({0x442eafe, 0x1f38610})
/usr/local/go-cgo/src/runtime/panic.go:1198 +0x71 fp=0xc000e3f428 sp=0xc000e3f3f8 pc=0x4533f1
runtime.checkptrAlignment(0xc0009161c0, 0x8, 0x18)
/usr/local/go-cgo/src/runtime/checkptr.go:26 +0x6c fp=0xc000e3f448 sp=0xc000e3f428 pc=0x42450c
github.com/vishvananda/netlink/nl.DeserializeRtNexthop(...)
/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20210703095558-21f2c55a7727/nl/route_linux.go:51
github.com/vishvananda/netlink.deserializeRoute.func1({0xc0009161c8, 0x10, 0x10})
/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20210703095558-21f2c55a7727/route_linux.go:1137 +0x86 fp=0xc000e3f580 sp=0xc000e3f448 pc=0x1f38a26
github.com/vishvananda/netlink.deserializeRoute({_, _, _})
/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20210703095558-21f2c55a7727/route_linux.go:1195 +0x18d0 fp=0xc000e3f908 sp=0xc000e3f580 pc=0x1f38610
github.com/vishvananda/netlink.routeSubscribeAt.func2()
/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20210703095558-21f2c55a7727/route_linux.go:1484 +0x45b fp=0xc000e3ffe0 sp=0xc000e3f908 pc=0x1f3b8bb
runtime.goexit()
/usr/local/go-cgo/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000e3ffe8 sp=0xc000e3ffe0 pc=0x4867a1
created by github.com/vishvananda/netlink.routeSubscribeAt
/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20210703095558-21f2c55a7727/route_linux.go:1452 +0x436
Actually I wonder if both of these cases are just reflecting general data corruption, as the values in the checkptrAlignment
calls don't look sensible for what https://go.dev/src/runtime/checkptr.go says.
I have faced the same using the netlink.RouteSubscribe
method but depending on the kernel it not happens
RHEL 8 kernel 4.18 . Here for some routes it works well but after some ip route add
, ip route del
it happens (I think is when routes has mpls encap)
fatal error: checkptr: converted pointer straddles multiple allocations
OpenSuse Tumbleweed . I though that it don't happen but cannot confirm.
The RHEL's bt.
goroutine 6 [running]:
runtime.throw({0x55a5cf, 0x51a390})
/home/jg/ibm/go-1.17.3/go/src/runtime/panic.go:1198 +0x71 fp=0xc00021f400 sp=0xc00021f3d0 pc=0x4634f1
runtime.checkptrAlignment(0xc00006e460, 0x8, 0x18)
/home/jg/ibm/go-1.17.3/go/src/runtime/checkptr.go:26 +0x6c fp=0xc00021f420 sp=0xc00021f400 pc=0x43840c
github.com/vishvananda/netlink/nl.DeserializeRtNexthop(...)
/home/jg/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20220125195016-0639e7e787ba/nl/route_linux.go:51
github.com/vishvananda/netlink.deserializeRoute.func1({0xc00006e468, 0x10, 0x10})
/home/jg/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20220125195016-0639e7e787ba/route_linux.go:1147 +0x86 fp=0xc00021f558 sp=0xc00021f420 pc=0x51af26
github.com/vishvananda/netlink.deserializeRoute({_, _, _})
/home/jg/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20220125195016-0639e7e787ba/route_linux.go:1205 +0x12d0 fp=0xc00021f8e8 sp=0xc00021f558 pc=0x51a390
github.com/vishvananda/netlink.routeSubscribeAt.func2()
/home/jg/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20220125195016-0639e7e787ba/route_linux.go:1507 +0x470 fp=0xc00021ffe0 sp=0xc00021f8e8 pc=0x51c270
runtime.goexit()
/home/jg/ibm/go-1.17.3/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc00021ffe8 sp=0xc00021ffe0 pc=0x492b61
created by github.com/vishvananda/netlink.routeSubscribeAt
/home/jg/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20220125195016-0639e7e787ba/route_linux.go:1475 +0x436
I saw this with lib tags v1.1.0 , v1.0 and 1.2-beta
There is a race issue in the
GenlFamilyList()
function.Reproduction:
And run the test with the race detector enabled:
(this is running on an Alpine host)
Gives logs