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

FLBPluginSetContext violates Go 1.14's checkptr validation, fails under -race #26

Closed
cosmo0920 opened this issue Dec 12, 2019 · 12 comments
Assignees

Comments

@cosmo0920
Copy link
Contributor

I've noticed it with my fluent-bit-go-s3 plugin testing.

With Go tip (now Go 1.14 dev) and its new checkptr mode (enabled by default in -race mode):
full log is: https://travis-ci.org/cosmo0920/fluent-bit-go-s3/jobs/624006851#L246

--- FAIL: TestPluginInitializationWithSharedCredentials (0.00s)
panic: runtime error: unsafe pointer arithmetic [recovered]
	panic: runtime error: unsafe pointer arithmetic
goroutine 10 [running]:
testing.tRunner.func1(0xc0002dd320)
	/home/travis/.gimme/versions/go/src/testing/testing.go:916 +0xaeb
panic(0x10730e0, 0xc00000f9c0)
	/home/travis/.gimme/versions/go/src/runtime/panic.go:967 +0x396
github.com/cosmo0920/fluent-bit-go-s3/vendor/github.com/fluent/fluent-bit-go/output.FLBPluginSetContext(...)
	/home/travis/gopath/src/github.com/cosmo0920/fluent-bit-go-s3/vendor/github.com/fluent/fluent-bit-go/output/output.go:76
github.com/cosmo0920/fluent-bit-go-s3.addS3Output(0x1c02bf0, 0x1, 0xc000000002)
	/home/travis/gopath/src/github.com/cosmo0920/fluent-bit-go-s3/out_s3.go:236 +0x271
github.com/cosmo0920/fluent-bit-go-s3.FLBPluginInit(0x1c02bf0, 0xd8)
	/home/travis/gopath/src/github.com/cosmo0920/fluent-bit-go-s3/out_s3.go:255 +0x55
github.com/cosmo0920/fluent-bit-go-s3.TestPluginInitializationWithSharedCredentials(0xc0002dd320)
	/home/travis/gopath/src/github.com/cosmo0920/fluent-bit-go-s3/out_s3_test.go:287 +0x480
testing.tRunner(0xc0002dd320, 0x1127ab0)
	/home/travis/.gimme/versions/go/src/testing/testing.go:954 +0x1ec
created by testing.(*T).Run
	/home/travis/.gimme/versions/go/src/testing/testing.go:1005 +0x661
exit status 2
FAIL	github.com/cosmo0920/fluent-bit-go-s3	0.039s
Makefile:26: recipe for target 'test' failed
make: *** [test] Error 1
The command "make" exited with 2.
@edsiper
Copy link
Member

edsiper commented Dec 12, 2019

@cosmo0920 is this a breaking change on that Golang version ?, is there any workaround ?

cc: @wfernandes

@cosmo0920
Copy link
Contributor Author

cosmo0920 commented Dec 13, 2019

Yep. This is Go 1.14 testing module breaking changes.

@wfernandes
Copy link
Member

@cosmo0920 Thanks for filing this issue. Apologies it took me so long to get to it. I'll take a look at this as soon as I can.

@wfernandes
Copy link
Member

Also PRs are welcome if you'd like to contribute 😉

@wfernandes
Copy link
Member

This issue seems to have some context what can be done to avoid this failure
google/go-cmp#167

@l2dy
Copy link
Contributor

l2dy commented Mar 9, 2020

Is this related to #18 (comment)?

@l2dy
Copy link
Contributor

l2dy commented Mar 28, 2020

I have proposed a proper fix in #28, please help review and test it.

@l2dy
Copy link
Contributor

l2dy commented Apr 20, 2020

@cosmo0920 Could you help check if the panic is fixed on master?

@cosmo0920
Copy link
Contributor Author

Yes, will do.

@cosmo0920
Copy link
Contributor Author

@wfernandes
Copy link
Member

Seems like this is working. Thanks for your contributions. Apologies that it took so long.

@cosmo0920
Copy link
Contributor Author

cosmo0920 commented Apr 22, 2020

Yeah. We can close this.
Thanks for fixing, guys! 🤩

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

Successfully merging a pull request may close this issue.

4 participants