genuinetools / netns

Runc hook (OCI compatible) for setting up default bridge networking for containers.
MIT License
222 stars 37 forks source link

netns crashes on armv5 board #18

Open johntoomey opened 4 years ago

johntoomey commented 4 years ago

netns appears to crash on an armv5 board when run on the command line or as a runc prehook with the following error (hostname and path replaced in the error):

root@<host>:~# netns ls
panic: runtime error: index out of range

goroutine 1 [running]:
go.etcd.io/bbolt.(*DB).page(...)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/vendor/pkg/mod/go.etcd.io/bbolt@v1.3.0/db.go:793
go.etcd.io/bbolt.(*Tx).page(...)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/vendor/pkg/mod/go.etcd.io/bbolt@v1.3.0/tx.go:576
go.etcd.io/bbolt.(*Bucket).pageNode(0x80a940, 0x726f7400, 0x0, 0xb, 0xb)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/vendor/pkg/mod/go.etcd.io/bbolt@v1.3.0/bucket.go:697 +0x1a8
go.etcd.io/bbolt.(*Cursor).First(0x85cd5c, 0x0, 0x0, 0x4b40dc, 0x0, 0x862100, 0x0)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/vendor/pkg/mod/go.etcd.io/bbolt@v1.3.0/cursor.go:34 +0x58
go.etcd.io/bbolt.(*Bucket).ForEach(0x80a940, 0x85cd90, 0xb, 0xb)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/vendor/pkg/mod/go.etcd.io/bbolt@v1.3.0/bucket.go:360 +0x8c
github.com/genuinetools/netns/network.(*Client).List.func1(0x862100, 0x2b65b0, 0x862100)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/network/list.go:42 +0xb8
go.etcd.io/bbolt.(*DB).View(0x868120, 0x85ce10, 0x0, 0x0)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/vendor/pkg/mod/go.etcd.io/bbolt@v1.3.0/db.go:626 +0x84
github.com/genuinetools/netns/network.(*Client).List(0x83a2c0, 0x0, 0x0, 0x0, 0x0, 0x0)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/network/list.go:38 +0x1f4
main.(*listCommand).Run(0x4b40dc, 0x302470, 0x80a880, 0x80c040, 0x0, 0x0, 0x0, 0x6)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/list.go:24 +0x24
github.com/genuinetools/pkg/cli.(*Program).run(0x83a280, 0x302470, 0x80a880, 0x80c040, 0x2, 0x2, 0x11e01, 0x80e3e8)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/vendor/pkg/mod/github.com/genuinetools/pkg@v0.0.0-20180910213200-1c141f661797/cli/cli.go:212 +0x39c
github.com/genuinetools/pkg/cli.(*Program).Run(0x83a280)
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/vendor/pkg/mod/github.com/genuinetools/pkg@v0.0.0-20180910213200-1c141f661797/cli/cli.go:89 +0x4c
main.main()
    <path>/build/tmp/work/armv5ehf-vfp-oe-linux-gnueabi/netns/0.5.3-r0/git/src/import/main.go:103 +0x574

this appears to be the section causing the error but it is unclear why:


func (db *DB) page(id pgid) *page {
    pos := id * pgid(db.pageSize)
    return (*page)(unsafe.Pointer(&db.data[pos]))
}```
issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.99. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

johntoomey commented 4 years ago

Issue fixed by updating bbolt to v1.3.3

Pull request open here https://github.com/genuinetools/netns/pull/19