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

Fix OCI test bucket panic #160

Merged
merged 1 commit into from
Dec 26, 2024
Merged

Fix OCI test bucket panic #160

merged 1 commit into from
Dec 26, 2024

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Dec 26, 2024

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

We are trying to wrap an error which is nil so it ended up return nil.

errors.Wrapf(err, fmt.Sprintf("unsupported OCI provider: %s", provider))

This caused a panic in Thanos E2E test because oci.NewTestBucket tries to reference bkt but both bkt and error is nil.

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x105c6b138]

goroutine 1705 [running]:
testing.tRunner.func1.2({0x1068c3ce0, 0x107a4c160})
	/Users/benye/sdk/go1.23.1/src/testing/testing.go:1632 +0x3c0
testing.tRunner.func1()
	/Users/benye/sdk/go1.23.1/src/testing/testing.go:1635 +0x57c
panic({0x1068c3ce0?, 0x107a4c160?})
	/Users/benye/sdk/go1.23.1/src/runtime/panic.go:785 +0xf0
github.com/thanos-io/objstore/providers/oci.NewTestBucket({0x106c2d258, 0x14000035380})
	/Users/benye/go/pkg/mod/github.com/thanos-io/[email protected]/providers/oci/oci.go:417 +0x2c8
github.com/thanos-io/objstore/objtesting.ForeachStore.func10(0x14000035380)
	/Users/benye/go/pkg/mod/github.com/thanos-io/[email protected]/objtesting/foreach.go:178 +0x48
testing.tRunner(0x14000035380, 0x140036e2da0)
	/Users/benye/sdk/go1.23.1/src/testing/testing.go:1690 +0x1a8
created by testing.(*T).Run in goroutine 24
	/Users/benye/sdk/go1.23.1/src/testing/testing.go:1743 +0x668
=== RUN   TestBucketStore_e2e/filesystem

Verification

@yeya24 yeya24 merged commit a14268e into main Dec 26, 2024
7 checks passed
@yeya24 yeya24 deleted the fix-oci-test-bucket branch December 26, 2024 23:30
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 this pull request may close these issues.

2 participants