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

Segfault when doing role assignment #3259

Closed
JAORMX opened this issue May 7, 2024 · 2 comments · Fixed by #3275
Closed

Segfault when doing role assignment #3259

JAORMX opened this issue May 7, 2024 · 2 comments · Fixed by #3275
Labels
bug Something isn't working

Comments

@JAORMX
Copy link
Contributor

JAORMX commented May 7, 2024

Describe the issue

When attempting to do a role assigment we get a segfault as follows:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x123fde0]

goroutine 2533 [running]:
github.com/open-feature/go-sdk-contrib/providers/go-feature-flag/pkg.genericEvaluation[...](0x0, {0x1c47918, 0x40009af950}, {0x186c40a, 0xc}, 0x0, 0x26384)
	github.com/open-feature/go-sdk-contrib/providers/go-feature-flag@v0.1.36/pkg/provider.go:206 +0x70
github.com/open-feature/go-sdk-contrib/providers/go-feature-flag/pkg.(*Provider).BooleanEvaluation(0x1567380?, {0x1c47918?, 0x40009af950?}, {0x186c40a?, 0x24?}, 0x70?, 0x0?)
	github.com/open-feature/go-sdk-contrib/providers/go-feature-flag@v0.1.36/pkg/provider.go:147 +0x6c
github.com/open-feature/go-sdk/openfeature.(*Client).evaluate(0x4000776120, {0x1c47918, 0x40009af950}, {0x186c40a, 0xc}, 0x0, {0x144a7a0, 0x2aba420}, {{0x40005c0a20, 0x24}, ...}, ...)
	github.com/open-feature/go-sdk@v1.11.0/openfeature/client.go:727 +0xbd4
github.com/open-feature/go-sdk/openfeature.(*Client).BooleanValueDetails(0x4000776120, {0x1c47918, 0x40009af950}, {0x186c40a, 0xc}, 0x0, {{0x40005c0a20?, 0x0?}, 0x40009dc240?}, {0x0, ...})
	github.com/open-feature/go-sdk@v1.11.0/openfeature/client.go:397 +0x1a8
github.com/open-feature/go-sdk/openfeature.(*Client).BooleanValue(0x0?, {0x1c47918?, 0x40009af950?}, {0x186c40a?, 0x4000ca6c08?}, 0x0, {{0x40005c0a20?, 0x0?}, 0x40009dc240?}, {0x0?, ...})
	github.com/open-feature/go-sdk@v1.11.0/openfeature/client.go:304 +0x40
github.com/open-feature/go-sdk/openfeature.(*Client).Boolean(0x1c47918?, {0x1c47918?, 0x40009af950?}, {0x186c40a?, 0x150e660?}, 0xc0?, {{0x40005c0a20?, 0x5?}, 0x40009dc240?}, {0x0?, ...})
	github.com/open-feature/go-sdk@v1.11.0/openfeature/client.go:603 +0x34
github.com/stacklok/minder/internal/flags.Bool({0x1c47918, 0x40009af950}, {0x1c64f40, 0x4000776120}, {0x186c40a, 0xc})
	github.com/stacklok/minder/internal/flags/flags.go:52 +0x74
github.com/stacklok/minder/internal/controlplane.(*Server).AssignRole(0x40005a0000, {0x1c47918, 0x40009af950}, 0x1c5f0f8?)
	github.com/stacklok/minder/internal/controlplane/handlers_authz.go:263 +0x138
github.com/stacklok/minder/pkg/api/protobuf/go/minder/v1._PermissionsService_AssignRole_Handler.func1({0x1c47918?, 0x40009af950?}, {0x16d9a00?, 0x400095bb40?})
	github.com/stacklok/minder/pkg/api/protobuf/go/minder/v1/minder_grpc.pb.go:1785 +0xd0
github.com/stacklok/minder/internal/controlplane.ProjectAuthorizationInterceptor({0x1c47918, 0x40009af950}, {0x16d9a00, 0x400095bb40}, 0x400048baa0, 0x40006fd668)
	github.com/stacklok/minder/internal/controlplane/handlers_authz.go:113 +0x324
google.golang.org/grpc.getChainUnaryHandler.func1({0x1c47918, 0x40009af950}, {0x16d9a00, 0x400095bb40})
	google.golang.org/grpc@v1.63.2/server.go:1186 +0xa0
github.com/stacklok/minder/internal/controlplane.EntityContextProjectInterceptor({0x1c47918, 0x40009aee10}, {0x16d9a00, 0x400095bb40}, 0x400048baa0, 0x400095be00)
	github.com/stacklok/minder/internal/controlplane/handlers_authz.go:75 +0x274
google.golang.org/grpc.getChainUnaryHandler.func1({0x1c47918, 0x40009aee10}, {0x16d9a00, 0x400095bb40})
	google.golang.org/grpc@v1.63.2/server.go:1186 +0xa0
github.com/stacklok/minder/internal/controlplane.TokenValidationInterceptor({0x1c47918, 0x40009ae8d0}, {0x16d9a00, 0x400095bb40}, 0x400048baa0, 0x400095bcc0)
	github.com/stacklok/minder/internal/controlplane/handlers_token.go:80 +0x494
google.golang.org/grpc.getChainUnaryHandler.func1({0x1c47918, 0x40009ae8d0}, {0x16d9a00, 0x400095bb40})
	google.golang.org/grpc@v1.63.2/server.go:1186 +0xa0
github.com/stacklok/minder/internal/controlplane.(*Server).StartGRPCServer.Interceptor.func3({0x1c47918, 0x40009ae0f0}, {0x16d9a00, 0x400095bb40}, 0x400048baa0, 0x400095bc80)
	github.com/stacklok/minder/internal/logger/logging_interceptor.go:81 +0x330
google.golang.org/grpc.getChainUnaryHandler.func1({0x1c47918, 0x40009ae0f0}, {0x16d9a00, 0x400095bb40})
	google.golang.org/grpc@v1.63.2/server.go:1186 +0xa0
github.com/stacklok/minder/internal/controlplane.(*Server).StartGRPCServer.SanitizingInterceptor.func2({0x1c47918?, 0x40009ae0f0?}, {0x16d9a00?, 0x400095bb40?}, 0x400048baa0?, 0x40006fd668?)
	github.com/stacklok/minder/internal/util/statuses.go:183 +0x34
google.golang.org/grpc.NewServer.chainUnaryServerInterceptors.chainUnaryInterceptors.func1({0x1c47918, 0x40009ae0f0}, {0x16d9a00, 0x400095bb40}, 0x400048baa0, 0x17bc360?)
	google.golang.org/grpc@v1.63.2/server.go:1177 +0x88
github.com/stacklok/minder/pkg/api/protobuf/go/minder/v1._PermissionsService_AssignRole_Handler({0x184c220, 0x40005a0000}, {0x1c47918, 0x40009ae0f0}, 0x40007ce280, 0x400037f180)
	github.com/stacklok/minder/pkg/api/protobuf/go/minder/v1/minder_grpc.pb.go:1787 +0x148
google.golang.org/grpc.(*Server).processUnaryRPC(0x400074c800, {0x1c47918, 0x40009ae000}, {0x1c543a0, 0x40006d0600}, 0x400098e240, 0x40008baea0, 0x2c3f290, 0x0)
	google.golang.org/grpc@v1.63.2/server.go:1369 +0xb58
google.golang.org/grpc.(*Server).handleStream(0x400074c800, {0x1c543a0, 0x40006d0600}, 0x400098e240)
	google.golang.org/grpc@v1.63.2/server.go:1780 +0xb20
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/grpc@v1.63.2/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 2532
	google.golang.org/grpc@v1.63.2/server.go:1030 +0x13c

Seems to be an issue with the recently included feature flags.

To Reproduce

minder project role grant -r editor -s <some subject>

this happens if no feature flags configuration is present.

What version are you using?

No response

@JAORMX JAORMX added the bug Something isn't working label May 7, 2024
JAORMX added a commit that referenced this issue May 7, 2024
…rom helm deployment

This, without a feature flag file causes minder to crash.

Relates-to: #3259

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
JAORMX added a commit that referenced this issue May 7, 2024
…rom helm deployment

This, without a feature flag file causes minder to crash.

Relates-to: #3259

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
Co-Authored-By: Michelangelo Mori <mmori@stacklok.com>
JAORMX added a commit that referenced this issue May 7, 2024
…rom helm deployment (#3260)

This, without a feature flag file causes minder to crash.

Relates-to: #3259

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
Co-authored-by: Michelangelo Mori <mmori@stacklok.com>
@JAORMX
Copy link
Contributor Author

JAORMX commented May 7, 2024

We mitigated this by not setting the environment variable that enables the feature flag functionality.

@blkt
Copy link
Contributor

blkt commented May 7, 2024

Issue lies in this line not doing what's intended.
Specifically, flagProvider variable declared here is an interface (see here), so checking for null values gets weird in Go.

@evankanderson evankanderson linked a pull request May 7, 2024 that will close this issue
10 tasks
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