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

panic: net/rpc: add recover handle goroutine call?it's too easy cause app crash #27777

Closed
chslink opened this issue Sep 20, 2018 · 2 comments
Closed

Comments

@chslink
Copy link

chslink commented Sep 20, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.11 windows/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOHOSTARCH=amd64
GOHOSTOS=windows
GOOS=windows

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
https://play.golang.org/p/h_dtcgMxj8M

What did you expect to see?

because nil pointer it's very easy pass compile check,or any other panic,and it'will cause server application crash.

What did you see instead?

add recover function handle go/src/net/rpc/server.go:481 or go/src/net/rpc/server.go:384 goroutine call

@bcmills
Copy link
Contributor

bcmills commented Sep 22, 2018

Per https://golang.org/pkg/net/rpc/:

The net/rpc package is frozen and is not accepting new features.

(but I'll CC @robpike just in case he thinks this one is trivial enough.)

In general, I would recommend fuzz-testing your server (e.g. using go-fuzz) to root out these sorts of issues. Unexpected recovers can leave a binary deadlocked or otherwise compromised, so they're not a panacea.

@bcmills bcmills closed this as completed Sep 22, 2018
@robpike
Copy link
Contributor

robpike commented Sep 22, 2018

Would rather not make such a substantive change to this frozen package. Leaving closed.

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

4 participants