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

xds resolver nil pointer panic #4345

Closed
sky91 opened this issue Apr 19, 2021 · 1 comment
Closed

xds resolver nil pointer panic #4345

sky91 opened this issue Apr 19, 2021 · 1 comment

Comments

@sky91
Copy link

sky91 commented Apr 19, 2021

grpc-go version: v1.37.0

With the code below:

ctx, cancel := context.WithCancel(context.Background())
go func() {
	<-ctx.Done()
	_, _ = grpc.Dial("xds:///foo.com", grpc.WithInsecure())
}()
go func() {
	<-ctx.Done()
	_, _ = grpc.Dial("xds:///bar.com", grpc.WithInsecure())
}()
time.Sleep(time.Second)
cancel()

Error output:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x1bc11a9]

goroutine 50 [running]:
google.golang.org/grpc/xds/internal/resolver.(*xdsResolver).newConfigSelector(0xc0003bc100, 0x0, 0x0, 0xc00011c6c0, 0x1, 0x1, 0x0, 0x1, 0x0)
	C:/Users/sky91/.go/pkg/mod/google.golang.org/grpc@v1.37.0/xds/internal/resolver/serviceconfig.go:259 +0x49
google.golang.org/grpc/xds/internal/resolver.(*xdsResolver).run(0xc0003bc100)
	C:/Users/sky91/.go/pkg/mod/google.golang.org/grpc@v1.37.0/xds/internal/resolver/xds_resolver.go:219 +0x188
created by google.golang.org/grpc/xds/internal/resolver.(*xdsResolverBuilder).Build
	C:/Users/sky91/.go/pkg/mod/google.golang.org/grpc@v1.37.0/xds/internal/resolver/xds_resolver.go:94 +0x5c9

Is it a bug?

@menghanl
Copy link
Contributor

Can you paste the client logs when the panic happens?
And can you try from master branch? This might be fixed by #4327

@menghanl menghanl added the stale label Apr 29, 2021
@dfawley dfawley closed this as completed May 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants