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

Invalid HTTP requests to Election Proclaim,Resign segfaults etcd server #9375

Closed
therve opened this issue Feb 28, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@therve
Copy link

therve commented Feb 28, 2018

I tried to test election mechanisms over the gRPC interface, and got a segmentation. Using curl seems to make it fairly reliably:

curl -X POST -H "Content-Type: application/json" -d '{}' http://localhost:2379/v3beta/election/proclaim

curl: (52) Empty reply from server

This is the traceback:

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

goroutine 127 [running]:
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/api/v3election.(*electionServer).Proclaim(0xc42000d5a0, 0x160d8a0, 0xc420294360, 0xc4201a20c0, 0xc42000d5a0, 0x1006e51, 0x8)
	/home/gyuho/go/src/github.com/coreos/etcd/release/etcd/gopath/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/api/v3election/election.go:54 +0x3a
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb._Election_Proclaim_Handler.func1(0x160d8a0, 0xc420294360, 0xf438e0, 0xc4201a20c0, 0x1f, 0xc42026a050, 0x10358d0, 0xc4200718c8)
	/home/gyuho/go/src/github.com/coreos/etcd/release/etcd/gopath/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb/v3election.pb.go:452 +0x86
github.com/coreos/etcd/cmd/vendor/github.com/grpc-ecosystem/go-grpc-prometheus.(*ServerMetrics).UnaryServerInterceptor.func1(0x160d8a0, 0xc420294360, 0xf438e0, 0xc4201a20c0, 0xc4201a2100, 0xc4201a2140, 0x411648, 0x20, 0xebefa0, 0xc42026a001)
	/home/gyuho/go/src/github.com/coreos/etcd/release/etcd/gopath/src/github.com/coreos/etcd/cmd/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go:112 +0xdb
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc.newUnaryInterceptor.func1(0x160d8a0, 0xc420294360, 0xf438e0, 0xc4201a20c0, 0xc4201a2100, 0xc4201a2140, 0x0, 0xc4200719e0, 0x411648, 0x50)
	/home/gyuho/go/src/github.com/coreos/etcd/release/etcd/gopath/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/interceptor.go:57 +0xca
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb._Election_Proclaim_Handler(0xeee080, 0xc42000d5a0, 0x160d8a0, 0xc420294360, 0xc42026a000, 0xc420239d00, 0x0, 0x0, 0x0, 0x0)
	/home/gyuho/go/src/github.com/coreos/etcd/release/etcd/gopath/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb/v3election.pb.go:454 +0x16d
github.com/coreos/etcd/cmd/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc4206c4000, 0x1612d80, 0xc42012e6e0, 0xc42020c200, 0xc4201e2f30, 0x1659c38, 0x0, 0x0, 0x0)
	/home/gyuho/go/src/github.com/coreos/etcd/release/etcd/gopath/src/github.com/coreos/etcd/cmd/vendor/google.golang.org/grpc/server.go:843 +0xab4
github.com/coreos/etcd/cmd/vendor/google.golang.org/grpc.(*Server).handleStream(0xc4206c4000, 0x1612d80, 0xc42012e6e0, 0xc42020c200, 0x0)
	/home/gyuho/go/src/github.com/coreos/etcd/release/etcd/gopath/src/github.com/coreos/etcd/cmd/vendor/google.golang.org/grpc/server.go:1040 +0x1528
github.com/coreos/etcd/cmd/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc4202fd430, 0xc4206c4000, 0x1612d80, 0xc42012e6e0, 0xc42020c200)
	/home/gyuho/go/src/github.com/coreos/etcd/release/etcd/gopath/src/github.com/coreos/etcd/cmd/vendor/google.golang.org/grpc/server.go:589 +0x9f
created by github.com/coreos/etcd/cmd/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
	/home/gyuho/go/src/github.com/coreos/etcd/release/etcd/gopath/src/github.com/coreos/etcd/cmd/vendor/google.golang.org/grpc/server.go:587 +0xa1

I use 3.3.1 on Fedora.

@gyuho
Copy link
Contributor

gyuho commented Mar 1, 2018

I can reproduce. Will fix. Thanks for report!

@gyuho gyuho self-assigned this Mar 1, 2018
@gyuho gyuho changed the title Segmentation fault when trying to use proclaim Invalid HTTP requests to Election Proclaim,Resign segfaults etcd server Mar 1, 2018
@gyuho
Copy link
Contributor

gyuho commented Mar 1, 2018

@therve Thanks for report. Should be fixed via #9379.
Wonder why nobody had reported this before :0

@gyuho gyuho closed this as completed Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants