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

build: update travis to build against go 1.14 #4033

Merged
merged 3 commits into from
Jun 16, 2020

Conversation

Roasbeef
Copy link
Member

No description provided.

@guggero
Copy link
Collaborator

guggero commented Feb 26, 2020

Panic in the channeldb tests.
Seems we might need to wait for bbolt to be go 1.14.x compliant.
The problem is this line: https://github.com/etcd-io/bbolt/blob/v1.3.3/bucket.go#L624

Seems to be a new compiler feature that is turned on by default in the race detector: https://golang.org/doc/go1.14#compiler

Can be turned off by adding -gcflags=all=-d=checkptr=0

fatal error: checkptr: unsafe pointer conversion

goroutine 4 [running]:
runtime.throw(0xb08ed5, 0x23)
	/home/travis/.gimme/versions/go1.14.linux.amd64/src/runtime/panic.go:1112 +0x72 fp=0xc0000b35d0 sp=0xc0000b35a0 pc=0x462da2
runtime.checkptrAlignment(0xc000027590, 0xabba60, 0x1)
	/home/travis/.gimme/versions/go1.14.linux.amd64/src/runtime/checkptr.go:18 +0xb7 fp=0xc0000b3600 sp=0xc0000b35d0 pc=0x434477
github.com/coreos/bbolt.(*Bucket).write(0xc0000b3778, 0x0, 0x0, 0x0)
	/home/travis/gopath/pkg/mod/github.com/coreos/[email protected]/bucket.go:624 +0x15c fp=0xc0000b3668 sp=0xc0000b3600 pc=0x8b8d1c
github.com/coreos/bbolt.(*Bucket).CreateBucket(0xc00019c0f8, 0xfe5c40, 0x10, 0x10, 0xc0001b01b8, 0x0, 0x0)
	/home/travis/gopath/pkg/mod/github.com/coreos/[email protected]/bucket.go:181 +0x465 fp=0xc0000b3828 sp=0xc0000b3668 pc=0x8b57a5
github.com/coreos/bbolt.(*Tx).CreateBucket(...)
	/home/travis/gopath/pkg/mod/github.com/coreos/[email protected]/tx.go:108
github.com/lightningnetwork/lnd/channeldb.createChannelDB.func1(0xc00019c0e0, 0xc0001b0101, 0xc00019c0e0)
	/home/travis/gopath/src/github.com/lightningnetwork/lnd/channeldb/db.go:259 +0x96 fp=0xc0000b3998 sp=0xc0000b3828 pc=0x9faab6
github.com/coreos/bbolt.(*DB).Update(0xc0001b0000, 0xc3dbd0, 0x0, 0x0)
	/home/travis/gopath/pkg/mod/github.com/coreos/[email protected]/db.go:694 +0xec fp=0xc0000b3a40 sp=0xc0000b3998 pc=0x8c28fc
github.com/lightningnetwork/lnd/channeldb.createChannelDB(0xc000027520, 0x17, 0x0, 0xc000028960)
	/home/travis/gopath/src/github.com/lightningnetwork/lnd/channeldb/db.go:258 +0x129 fp=0xc0000b3ae0 sp=0xc0000b3a40 pc=0x9f9519
github.com/lightningnetwork/lnd/channeldb.Open(0xc000027520, 0x17, 0x0, 0x0, 0x0, 0x17, 0x0, 0x0)
	/home/travis/gopath/src/github.com/lightningnetwork/lnd/channeldb/db.go:150 +0x96f fp=0xc0000b3cc0 sp=0xc0000b3ae0 pc=0x9f937f
github.com/lightningnetwork/lnd/channeldb/migtest.MakeDB(0x9ff7f6, 0xc00004f568, 0xdf0588, 0xc58b74)
	/home/travis/gopath/src/github.com/lightningnetwork/lnd/channeldb/migtest/migtest.go:25 +0xa7 fp=0xc0000b3d50 sp=0xc0000b3cc0 pc=0x9fe467
github.com/lightningnetwork/lnd/channeldb/migtest.ApplyMigration(0xc000153440, 0xc3dbe8, 0xc3dbf0, 0xc3dbd8, 0x0)
	/home/travis/gopath/src/github.com/lightningnetwork/lnd/channeldb/migtest/migtest.go:44 +0x48 fp=0xc0000b3e90 sp=0xc0000b3d50 pc=0x9fe678
github.com/lightningnetwork/lnd/channeldb/migration12_test.TestTLVInvoiceMigration.func1(0xc000153440)
	/home/travis/gopath/src/github.com/lightningnetwork/lnd/channeldb/migration12/migration_test.go:197 +0x66 fp=0xc0000b3ed0 sp=0xc0000b3e90 pc=0x9ff7f6
testing.tRunner(0xc000153440, 0xc0000ff4d0)
	/home/travis/.gimme/versions/go1.14.linux.amd64/src/testing/testing.go:992 +0x1ec fp=0xc0000b3fd0 sp=0xc0000b3ed0 pc=0x58216c
runtime.goexit()
	/home/travis/.gimme/versions/go1.14.linux.amd64/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0000b3fd8 sp=0xc0000b3fd0 pc=0x496681
created by testing.(*T).Run
	/home/travis/.gimme/versions/go1.14.linux.amd64/src/testing/testing.go:1043 +0x661

@cfromknecht cfromknecht self-requested a review February 27, 2020 19:19
@Roasbeef
Copy link
Member Author

Roasbeef commented Mar 1, 2020

Current candidate PR for the fix in bbolt: etcd-io/bbolt#201

@Roasbeef
Copy link
Member Author

Updated to the latest version of bolt and walletdb, which now have the 1.14 fix.

@Roasbeef
Copy link
Member Author

As mentioned offline, everything seems ok, but we have new this error when running the tests without the race condition detector on:

runtime: pointer 0xc0002ee000 to unallocated span span.base()=0xc0002ee000 span.limit=0xc0002effe0 span.state=0
fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?)
runtime stack:
runtime.throw(0xa262de, 0x3e)
	/home/travis/.gimme/versions/go1.14.1.linux.amd64/src/runtime/panic.go:1114 +0x72 fp=0x7f5f504afde8 sp=0x7f5f504afdb8 pc=0x436202
runtime.badPointer(0x7f5f77f866d0, 0xc0002ee000, 0x0, 0x0)
	/home/travis/.gimme/versions/go1.14.1.linux.amd64/src/runtime/mbitmap.go:380 +0x230 fp=0x7f5f504afe30 sp=0x7f5f504afde8 pc=0x416140
runtime.findObject(0xc0002ee000, 0x0, 0x0, 0xc0002edfc0, 0x7f5f77e08450, 0x7f)
	/home/travis/.gimme/versions/go1.14.1.linux.amd64/src/runtime/mbitmap.go:416 +0x9b fp=0x7f5f504afe68 sp=0x7f5f504afe30 pc=0x4161eb
runtime.wbBufFlush1(0xc000044800)
	/home/travis/.gimme/versions/go1.14.1.linux.amd64/src/runtime/mwbbuf.go:288 +0xa5 fp=0x7f5f504afec0 sp=0x7f5f504afe68 pc=0x430675
runtime.wbBufFlush.func1()
	/home/travis/.gimme/versions/go1.14.1.linux.amd64/src/runtime/mwbbuf.go:218 +0x3a fp=0x7f5f504afed8 sp=0x7f5f504afec0 pc=0x463f4a
runtime.systemstack(0x7ffe80ab5890)
	/home/travis/.gimme/versions/go1.14.1.linux.amd64/src/runtime/asm_amd64.s:370 +0x66 fp=0x7f5f504afee0 sp=0x7f5f504afed8 pc=0x465e36
runtime.mstart()
	/home/travis/.gimme/versions/go1.14.1.linux.amd64/src/runtime/proc.go:1041 fp=0x7f5f504afee8 sp=0x7f5f504afee0 pc=0x43b010

Not sure what to attribute this to yet. Either the bbolt fix uncovered another underlying issue, or there's an issue with our access patterns as is (possibly using read bytes without copying them first).

@matheusd
Copy link
Contributor

Wish I had seen this sooner. We've been tracking this for the past few days as well.

Here's a minimal reproducer for bbolt: https://github.com/matheusd/bbolt-sweep-bug

And here's something that seems to be fixing the tests in dcrlnd: etcd-io/bbolt@master...matheusd:bad-arith-error

@Roasbeef
Copy link
Member Author

@matheusd allegedly that issue above was fixed in Go 1.14.2. However, we're still running into this issue on top of that: etcd-io/bbolt#214

@Roasbeef Roasbeef added this to the 0.11.0 milestone Apr 14, 2020
@Roasbeef Roasbeef added golang/build system Related to the go language and compiler v0.11 labels Apr 14, 2020
@matheusd
Copy link
Contributor

@Roasbeef go 1.4.2 by itself doesn't seem to solve the issue for me but the most recent recent commit on https://github.com/jrick/bbolt/tree/memfix does.

@Roasbeef
Copy link
Member Author

Pushed up a new version that points to my fork (Roasbeef/btcwallet@fdbd494) which uses jrick's bbolt fix branch. Will monitor the build (restarting over n over) to see if the issue pops up again.

@Roasbeef
Copy link
Member Author

Updated now that the bbolt patch has landed. Also updated Github Actions (I think...).

@cfromknecht
Copy link
Contributor

fatal error: checkptr: unsafe pointer conversion

@Roasbeef
Copy link
Member Author

Should all be resolved now, it was still using the old version of bbolt since btcwallet hadn't been fully switched over.

Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It lives!! LGTM 🌵

@Roasbeef Roasbeef merged commit ed93c16 into lightningnetwork:master Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
golang/build system Related to the go language and compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants