Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail when using Go 1.14 #182

Closed
nkryuchkov opened this issue Mar 3, 2020 · 2 comments · Fixed by #240
Closed

Tests fail when using Go 1.14 #182

nkryuchkov opened this issue Mar 3, 2020 · 2 comments · Fixed by #240
Assignees
Labels
bug Something isn't working

Comments

@nkryuchkov
Copy link
Contributor

Describe the bug

fatal error: checkptr: unsafe pointer conversion

goroutine 10272 [running]:
runtime.throw(0xbcf2ac, 0x23)
	/usr/lib/go/src/runtime/panic.go:1112 +0x72 fp=0xc00072a868 sp=0xc00072a838 pc=0x463282
runtime.checkptrAlignment(0xc000027570, 0xb7f700, 0x1)
	/usr/lib/go/src/runtime/checkptr.go:18 +0xb7 fp=0xc00072a898 sp=0xc00072a868 pc=0x434747
go.etcd.io/bbolt.(*Bucket).write(0xc00072aa10, 0x0, 0x0, 0x0)
	/home/evanlinjin/go/pkg/mod/go.etcd.io/bbolt@v1.3.3/bucket.go:624 +0x15c fp=0xc00072a900 sp=0xc00072a898 pc=0xa5f81c
go.etcd.io/bbolt.(*Bucket).CreateBucket(0xc00009a7f8, 0xc0002382b8, 0x3, 0x8, 0xc00072aac8, 0xa685a4, 0x0)
	/home/evanlinjin/go/pkg/mod/go.etcd.io/bbolt@v1.3.3/bucket.go:181 +0x465 fp=0xc00072aac0 sp=0xc00072a900 pc=0xa5bc65
go.etcd.io/bbolt.(*Bucket).CreateBucketIfNotExists(0xc00009a7f8, 0xc0002382b8, 0x3, 0x8, 0xc00072ab90, 0xa68009, 0xc000374000)
	/home/evanlinjin/go/pkg/mod/go.etcd.io/bbolt@v1.3.3/bucket.go:199 +0x5e fp=0xc00072ab28 sp=0xc00072aac0 pc=0xa5c00e
go.etcd.io/bbolt.(*Tx).CreateBucketIfNotExists(...)
	/home/evanlinjin/go/pkg/mod/go.etcd.io/bbolt@v1.3.3/tx.go:115
github.com/SkycoinProject/skywire-mainnet/pkg/app.newBoltDB.func2(0xc00009a7e0, 0xc000374101, 0xc00009a7e0)
	/home/evanlinjin/git/skywire-mainnet/pkg/app/log_store.go:55 +0x80 fp=0xc00072aba0 sp=0xc00072ab28 pc=0xa9f500
go.etcd.io/bbolt.(*DB).Update(0xc000374000, 0xc00072ad18, 0x0, 0x0)
	/home/evanlinjin/go/pkg/mod/go.etcd.io/bbolt@v1.3.3/db.go:694 +0xec fp=0xc00072ac48 sp=0xc00072aba0 pc=0xa6988c
github.com/SkycoinProject/skywire-mainnet/pkg/app.newBoltDB(0xc000027500, 0x15, 0xbbbddb, 0x3, 0x0, 0x0, 0x0, 0x0)
	/home/evanlinjin/git/skywire-mainnet/pkg/app/log_store.go:54 +0x1e4 fp=0xc00072ad48 sp=0xc00072ac48 pc=0xa8e474
github.com/SkycoinProject/skywire-mainnet/pkg/app.TestLogStore(0xc000262000)
	/home/evanlinjin/git/skywire-mainnet/pkg/app/log_store_test.go:19 +0x179 fp=0xc00072aed0 sp=0xc00072ad48 pc=0xa99a29
testing.tRunner(0xc000262000, 0xbe1c10)
	/usr/lib/go/src/testing/testing.go:992 +0x1ec fp=0xc00072afd0 sp=0xc00072aed0 pc=0x5aad4c
runtime.goexit()
	/usr/lib/go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00072afd8 sp=0xc00072afd0 pc=0x496c31
created by testing.(*T).Run
	/usr/lib/go/src/testing/testing.go:1043 +0x661

Environment information:

  • OS: Mac OS X
  • Go: 1.14

Steps to Reproduce
Steps to reproduce the behavior:

  1. Update Go to 1.14
  2. Run make check

Actual behavior
Tests fail.

Expected behavior
Tests pass.

@nkryuchkov nkryuchkov added the bug Something isn't working label Mar 3, 2020
@nkryuchkov nkryuchkov self-assigned this Mar 3, 2020
@nkryuchkov
Copy link
Contributor Author

The failure happens inside bbolt (https://github.com/etcd-io/bbolt/blob/v1.3.3/bucket.go#L624). Go 1.14 compiler adds a new checkptr debug flag which is enabled by default when using the -race flag (https://golang.org/doc/go1.14#compiler), which breaks bbolt.

There's a pull request in bbolt with a fix: etcd-io/bbolt#201. Until it's merged we can use a temporary workaround and pass the -gcflags=all=-d=checkptr=0 flag to tests along with the -race flag.

After the PR in bbolt is merged, the workaround should be removed and the bbolt version should be updated.

@nkryuchkov nkryuchkov added the on hold Put on hold until a specific event label Mar 3, 2020
@nkryuchkov nkryuchkov removed the on hold Put on hold until a specific event label Mar 23, 2020
@nkryuchkov nkryuchkov linked a pull request Mar 23, 2020 that will close this issue
@jdknives
Copy link
Member

Fixed by above PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants