Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

adding -race flag fails tests #73

Closed
andorsk opened this issue Jul 28, 2022 · 2 comments
Closed

adding -race flag fails tests #73

andorsk opened this issue Jul 28, 2022 · 2 comments

Comments

@andorsk
Copy link
Contributor

andorsk commented Jul 28, 2022

Note: https://github.com/TBD54566975/ssi-service/blob/main/magefile.go#L67 does not use the -race flag and when -race is applied, allocation errors are seen.

Is there a good reason that the race flag is not included in these tests?

go test -race  ./...  -v

fatal error: checkptr: converted pointer straddles multiple allocations

goroutine 11 [running]:
runtime.throw({0x10554e405?, 0x1053dc478?})
	/usr/local/go/src/runtime/panic.go:992 +0x50 fp=0xc00061eda0 sp=0xc00061ed70 pc=0x104d38880
runtime.checkptrAlignment(0xc00061ee08?, 0x104d55e20?, 0xc00006eb18?)
	/usr/local/go/src/runtime/checkptr.go:26 +0x80 fp=0xc00061edc0 sp=0xc00061eda0 pc=0x104d09c20
github.com/boltdb/bolt.(*Bucket).write(0xc00061ef68)
	/Users/akmb2/go/pkg/mod/github.com/boltdb/[email protected]/bucket.go:626 +0x1b4 fp=0xc00061ee50 sp=0xc00061edc0 pc=0x1053dc604
github.com/boltdb/bolt.(*Bucket).CreateBucket(0xc000537358, {0xc00006eb18, 0x7, 0x8})
	/Users/akmb2/go/pkg/mod/github.com/boltdb/[email protected]/bucket.go:188 +0x260 fp=0xc00061f010 sp=0xc00061ee50 pc=0x1053d95c0
github.com/boltdb/bolt.(*Bucket).CreateBucketIfNotExists(0xc000537340?, {0xc00006eb18, 0x7, 0x8})
	/Users/akmb2/go/pkg/mod/github.com/boltdb/[email protected]/bucket.go:206 +0x48 fp=0xc00061f060 sp=0xc00061f010 pc=0x1053d97e8
github.com/boltdb/bolt.(*Tx).CreateBucketIfNotExists(...)
	/Users/akmb2/go/pkg/mod/github.com/boltdb/[email protected]/tx.go:115
github.com/tbd54566975/ssi-service/pkg/storage.(*BoltDB).Write.func1(0xc000537340)
	/Users/akmb2/workspace/github.com/andorsk/ssi-service/pkg/storage/bolt.go:45 +0x9c fp=0xc00061f110 sp=0xc00061f060 pc=0x1053f3c0c
github.com/boltdb/bolt.(*DB).Update(0xc00061f228?, 0xc00061f1e8)
	/Users/akmb2/go/pkg/mod/github.com/boltdb/[email protected]/db.go:598 +0x9c fp=0xc00061f1c0 sp=0xc00061f110 pc=0x1053e33ec
github.com/tbd54566975/ssi-service/pkg/storage.(*BoltDB).Write(0xc0000106d0, {0xc000533eb9, 0x7}, {0xc00037b480, 0x38}, {0xc00018e000, 0x32c, 0x32c})
	/Users/akmb2/workspace/github.com/andorsk/ssi-service/pkg/storage/bolt.go:44 +0xb4 fp=0xc00061f230 sp=0xc00061f1c0 pc=0x1053f3b04
github.com/tbd54566975/ssi-service/pkg/service/did/storage.BoltDIDStorage.StoreDID({_}, {{{0x10581bcc0, 0x1058dc020}, {0xc00037b480, 0x38}, {0x0, 0x0}, {0x0, 0x0}, {0xc00007d4a0, ...}, ...}, ...})
	/Users/akmb2/workspace/github.com/andorsk/ssi-service/pkg/service/did/storage/bolt.go:43 +0x130 fp=0xc00061f3c0 sp=0xc00061f230 pc=0x105462100
github.com/tbd54566975/ssi-service/pkg/service/did/storage.(*BoltDIDStorage).StoreDID(_, {{{0x10581bcc0, 0x1058dc020}, {0xc00037b480, 0x38}, {0x0, 0x0}, {0x0, 0x0}, {0xc00007d4a0, ...}, ...}, ...})
	<autogenerated>:1 +0x6c fp=0xc00061f4e0 sp=0xc00061f3c0 pc=0x1054631fc
github.com/tbd54566975/ssi-service/pkg/service/did.(*keyDIDHandler).CreateDID(0xc0004bfb70, {{0x105522d2f?, 0xc0000106e0?}, {0xc000034c0c?, 0x0?}})
	/Users/akmb2/workspace/github.com/andorsk/ssi-service/pkg/service/did/key.go:48 +0x1b4 fp=0xc00061f860 sp=0xc00061f4e0 pc=0x105464024
github.com/tbd54566975/ssi-service/pkg/service/did.Service.CreateDIDByMethod({0xc0000a9200, {0x1058e2b00, 0xc0000106e0}, {0x0, {0x0, 0x0, 0x0}}}, {{0x105522d2f?, 0x10?}, {0xc000034c0c?, ...}})
	/Users/akmb2/workspace/github.com/andorsk/ssi-service/pkg/service/did/did.go:59 +0x138 fp=0xc00061f940 sp=0xc00061f860 pc=0x1054636b8
github.com/tbd54566975/ssi-service/pkg/server/router.DIDRouter.CreateDIDByMethod({0xc0000a92f0?}, {0x1058e29e8, 0xc0000a9ad0}, {0x1058e24f0, 0xc00017be40}, 0xc0000a9980?)
	/Users/akmb2/workspace/github.com/andorsk/ssi-service/pkg/server/router/did.go:98 +0x34c fp=0xc00061fd30 sp=0xc00061f940 pc=0x1054ab0dc
github.com/tbd54566975/ssi-service/pkg/server.TestDIDAPI.func2(0xc0004baea0)
	/Users/akmb2/workspace/github.com/andorsk/ssi-service/pkg/server/server_test.go:158 +0x694 fp=0xc00061fe90 sp=0xc00061fd30 pc=0x105513e04
testing.tRunner(0xc0004baea0, 0x1058daa38)
	/usr/local/go/src/testing/testing.go:1439 +0x190 fp=0xc00061ffa0 sp=0xc00061fe90 pc=0x104e46230
testing.(*T).Run.func1()
	/usr/local/go/src/testing/testing.go:1486 +0x48 fp=0xc00061ffd0 sp=0xc00061ffa0 pc=0x104e473c8
runtime.goexit()
	/usr/local/go/src/runtime/asm_arm64.s:1263 +0x4 fp=0xc00061ffd0 sp=0xc00061ffd0 pc=0x104d6d7e4
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1486 +0x564

goroutine 1 [chan receive]:
testing.(*T).Run(0xc00008b520, {0x10552c1e7, 0xa}, 0x1058daa48)
	/usr/local/go/src/testing/testing.go:1487 +0x580
testing.runTests.func1(0x0?)
	/usr/local/go/src/testing/testing.go:1839 +0x98
testing.tRunner(0xc00008b520, 0xc00041fb68)
	/usr/local/go/src/testing/testing.go:1439 +0x190
testing.runTests(0xc000399400?, {0x105ce6b00, 0x6, 0x6}, {0xc00052c540?, 0x104e26d00?, 0x105cf4520?})
	/usr/local/go/src/testing/testing.go:1837 +0x6cc
testing.(*M).Run(0xc000399400)
	/usr/local/go/src/testing/testing.go:1719 +0x87c
main.main()
	_testmain.go:105 +0x3b8

goroutine 9 [chan receive]:
testing.(*T).Run(0xc00008bba0, {0x10553bc2c, 0x1e}, 0x1058daa38)
	/usr/local/go/src/testing/testing.go:1487 +0x580
github.com/tbd54566975/ssi-service/pkg/server.TestDIDAPI(0x0?)
	/Users/akmb2/workspace/github.com/andorsk/ssi-service/pkg/server/server_test.go:120 +0x60
testing.tRunner(0xc00008bba0, 0x1058daa48)
	/usr/local/go/src/testing/testing.go:1439 +0x190
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1486 +0x564```
@andorsk andorsk changed the title -race flag fails tests adding -race flag fails tests Jul 28, 2022
@andorsk andorsk added bug Something isn't working and removed bug Something isn't working labels Jul 28, 2022
@andorsk
Copy link
Contributor Author

andorsk commented Jul 28, 2022

Looks like boltdb is not longer maintained but bbolt is:

Comcast/sheens#58
Comcast/sheens#60
https://github.com/etcd-io/bbolt

Maybe a upgrade will fix things. I will send a PR With the update.

decentralgabe pushed a commit that referenced this issue Jul 28, 2022
* updated bolt dependency

* added -race flag to magefile
@decentralgabe
Copy link
Member

Fixed in #74

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants