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

net/rpc: sendresponse panic:call of reflect.Value.Int on ptr #21553

Closed
PrinnyQ opened this issue Aug 22, 2017 · 5 comments
Closed

net/rpc: sendresponse panic:call of reflect.Value.Int on ptr #21553

PrinnyQ opened this issue Aug 22, 2017 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@PrinnyQ
Copy link

PrinnyQ commented Aug 22, 2017

Please answer these questions before submitting your issue. Thanks!

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

1.8

Does this issue reproduce with the latest release?

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

GOARCH="amd64"
GOBIN="/root/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/projects/U4/trunkMobile_FPS_0825/Server"
GORACE=""
GOROOT="/root/go"
GOTOOLDIR="/root/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build084345451=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

panic: reflect: call of reflect.Value.Int on ptr Value [recovered]
    panic: reflect: call of reflect.Value.Int on ptr Value
goroutine 52598456 [running]:
encoding/gob.catchError(0xc4209e10d0)
	/root/go/src/encoding/gob/error.go:38 +0x95
panic(0xc40860, 0xc42606ad00)
	/root/go/src/runtime/panic.go:489 +0x2cf
reflect.Value.Int(0xbcdec0, 0xc4251fe520, 0x196, 0x196)
	/root/go/src/reflect/value.go:902 +0xb5
encoding/gob.encInt(0xc423ab4ae0, 0xc422da1e40, 0xbcdec0, 0xc4251fe520, 0x196)
	/root/go/src/encoding/gob/encode.go:188 +0x43
encoding/gob.(*Encoder).encodeStruct(0xc4209e1040, 0xc4209e1078, 0xc421a28a20, 0xcc1be0, 0xc4251fe510, 0x199)
	/root/go/src/encoding/gob/encode.go:334 +0x256
encoding/gob.(*Encoder).encode(0xc4209e1040, 0xc4209e1078, 0xcc1be0, 0xc4251fe510, 0x199, 0xc4209c3480)
	/root/go/src/encoding/gob/encode.go:707 +0x1d3
encoding/gob.(*Encoder).EncodeValue(0xc4209e1040, 0xc95bc0, 0xc4251fe510, 0x16, 0x0, 0x0)
	/root/go/src/encoding/gob/encoder.go:250 +0x3ab
encoding/gob.(*Encoder).Encode(0xc4209e1040, 0xc95bc0, 0xc4251fe510, 0x0, 0x0)
	/root/go/src/encoding/gob/encoder.go:175 +0x61
net/rpc.(*gobServerCodec).WriteResponse(0xc422b51ec0, 0xc422d737d0, 0xc95bc0, 0xc4251fe510, 0xc422b43a40, 0xc422b4a350)
	/root/go/src/net/rpc/server.go:424 +0x1dd
net/rpc.(*Server).sendResponse(0xc420055680, 0xc422b45aa0, 0xc421c4ff00, 0xc95bc0, 0xc4251fe510, 0x1334ac0, 0xc422b51ec0, 0x0, 0x0)
	/root/go/src/net/rpc/server.go:366 +0x130
net/rpc.(*service).call(0xc422afe900, 0xc420055680, 0xc422b45aa0, 0xc422b4ec00, 0xc421c4ff00, 0xbc3800, 0xc427ab07e0, 0x16, 0xc95bc0, 0xc4251fe510, ...)
	/root/go/src/net/rpc/server.go:394 +0x22e
created by net/rpc.(*Server).ServeCodec
	/root/go/src/net/rpc/server.go:481 +0x404

The server is runing well in the product environment when it panic the day before yesterday.I post an issue in the go Forum, someone told me to do race detection. while i see net/rpc.(*Server).sendResponse is thread safe.
Is there anything wrong with sendResponse in rpc package?But in my code ,reply is only a *int and did't do anything in function.So i have no idead with this panic.

What did you expect to see?

What did you see instead?

@ALTree
Copy link
Member

ALTree commented Aug 22, 2017

Please post an auto-contained reproducer, if it's possible. It'll make debugging easier.

@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 22, 2017
@odeke-em odeke-em changed the title rpc sendresponse panic:call of reflect.Value.Int on ptr net/rpc: sendresponse panic:call of reflect.Value.Int on ptr Aug 22, 2017
@PrinnyQ
Copy link
Author

PrinnyQ commented Aug 23, 2017

@ALTree sorry, may i ask a question?So what's an auto-contained reproducer, is there any examples ?I will try my best to do this.

@ALTree
Copy link
Member

ALTree commented Aug 23, 2017

It's a piece of code with (ideally) no external dependencies that can be pasted in a file and when run will trigger the crash you're reporting.

@PrinnyQ
Copy link
Author

PrinnyQ commented Aug 24, 2017

Ah, ok, thanks a lot!

@ianlancetaylor
Copy link
Contributor

Timed out.

@golang golang locked and limited conversation to collaborators Mar 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants