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

got an error when try to start grpc server in shared library #2052

Closed
PeerXu opened this issue May 7, 2018 · 1 comment
Closed

got an error when try to start grpc server in shared library #2052

PeerXu opened this issue May 7, 2018 · 1 comment

Comments

@PeerXu
Copy link

PeerXu commented May 7, 2018

What version of gRPC are you using?

d11072e7ca9811b1100b80ca0269ac831f06d024

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

go version go1.10.1 darwin/amd64

What operating system (Linux, Windows, …) and version?

macOS 10.13.4

What did you do?

Hi, everyone.

I try to write a grpc server(greet service) with plugin.

And then, compile the server to shared library(plugin.so).

At lasest, load shared library in main function.

But got an error. I will paste the error below.

I write a demo to reproducing the error.

git clone https://github.com/PeerXu/error-grpc-with-plugin.git
cd error-grpc-with-plugin
make

Wait a minutes, the grpc server should be panic.

Thanks.

What did you expect to see?

I expect the grpc server work fine, no panic.

What did you see instead?

Got an error:

runtime: bad pointer in frame runtime.selectgo at 0xc420253d08: 0x4
fatal error: invalid pointer found on stack

runtime stack:
runtime.throw(0x5cb95be, 0x1e)
	/usr/local/opt/go/libexec/src/runtime/panic.go:616 +0x81 fp=0x70000bd67708 sp=0x70000bd676e8 pc=0x582b561
runtime.adjustpointers(0xc420253c88, 0x70000bd67800, 0x70000bd67bc0, 0x5d6b1d8, 0x5f00840)
	/usr/local/opt/go/libexec/src/runtime/stack.go:592 +0x23e fp=0x70000bd67778 sp=0x70000bd67708 pc=0x584108e
runtime.adjustframe(0x70000bd67ad0, 0x70000bd67bc0, 0x5f00840)
	/usr/local/opt/go/libexec/src/runtime/stack.go:663 +0x325 fp=0x70000bd67830 sp=0x70000bd67778 pc=0x58413d5
runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc4201fe900, 0x0, 0x0, 0x7fffffff, 0x5ccc970, 0x70000bd67bc0, 0x0, ...)
	/usr/local/opt/go/libexec/src/runtime/traceback.go:310 +0x12d3 fp=0x70000bd67b38 sp=0x70000bd67830 pc=0x584a523
runtime.copystack(0xc4201fe900, 0x1000, 0x70000bd67d01)
	/usr/local/opt/go/libexec/src/runtime/stack.go:891 +0x26e fp=0x70000bd67cf0 sp=0x70000bd67b38 pc=0x5841ebe
runtime.newstack()
	/usr/local/opt/go/libexec/src/runtime/stack.go:1063 +0x310 fp=0x70000bd67e80 sp=0x70000bd67cf0 pc=0x58422d0
runtime.morestack()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:480 +0x89 fp=0x70000bd67e88 sp=0x70000bd67e80 pc=0x5850639

goroutine 37 [copystack]:
runtime.mallocgc(0x60, 0x4491280, 0x201, 0x0)
	/usr/local/opt/go/libexec/src/runtime/malloc.go:580 +0xa14 fp=0xc420253b50 sp=0xc420253b48 pc=0x5812da4
runtime.newobject(0x4491280, 0x4a7d390)
	/usr/local/opt/go/libexec/src/runtime/malloc.go:839 +0x38 fp=0xc420253b80 sp=0xc420253b50 pc=0x5812f28
runtime.acquireSudog(0xc42027e108)
	/usr/local/opt/go/libexec/src/runtime/proc.go:330 +0x2b4 fp=0xc420253bf0 sp=0xc420253b80 pc=0x582d2e4
runtime.selectgo(0xc4202056e0, 0xc42002e480)
	/usr/local/opt/go/libexec/src/runtime/select.go:366 +0xb22 fp=0xc420253dc8 sp=0xc420253bf0 pc=0x583ab32
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.(*http2Server).keepalive(0xc4201fe600)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/http2_server.go:948 +0x239 fp=0xc420253fd8 sp=0xc420253dc8 pc=0x5b699e9
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420253fe0 sp=0xc420253fd8 pc=0x5853001
created by github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.newHTTP2Server
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/http2_server.go:264 +0xe71

goroutine 1 [IO wait]:
runtime.gopark(0x44cd1a0, 0x4a7fdb0, 0x44adc2c, 0x7, 0x1b, 0x5)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420075ad0 sp=0xc420075ab0 pc=0x402e92a
runtime.netpollblock(0x4a7fd88, 0x72, 0xc4200b0040)
	/usr/local/opt/go/libexec/src/runtime/netpoll.go:366 +0xaa fp=0xc420075b18 sp=0xc420075ad0 pc=0x4028bfa
internal/poll.runtime_pollWait(0x4a7fd88, 0x72, 0x0)
	/usr/local/opt/go/libexec/src/runtime/netpoll.go:173 +0x57 fp=0xc420075b40 sp=0xc420075b18 pc=0x4028277
internal/poll.(*pollDesc).wait(0xc420208018, 0x72, 0x0, 0x0, 0x0)
	/usr/local/opt/go/libexec/src/internal/poll/fd_poll_runtime.go:85 +0x9b fp=0xc420075b70 sp=0xc420075b40 pc=0x408ac1b
internal/poll.(*pollDesc).waitRead(0xc420208018, 0xffffffffffffff00, 0x0, 0x0)
	/usr/local/opt/go/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x3d fp=0xc420075ba8 sp=0xc420075b70 pc=0x408ac9d
internal/poll.(*FD).Accept(0xc420208000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/opt/go/libexec/src/internal/poll/fd_unix.go:372 +0x1a8 fp=0xc420075c10 sp=0xc420075ba8 pc=0x408d0e8
net.(*netFD).accept(0xc420208000, 0xc4201fc008, 0x0, 0x0)
	/usr/local/opt/go/libexec/src/net/fd_unix.go:238 +0x42 fp=0xc420075ce0 sp=0xc420075c10 pc=0x41188a2
net.(*TCPListener).accept(0xc4201d5478, 0x584ff50, 0xc420075d58, 0xc420075d60)
	/usr/local/opt/go/libexec/src/net/tcpsock_posix.go:136 +0x2e fp=0xc420075d10 sp=0xc420075ce0 pc=0x4130c9e
net.(*TCPListener).Accept(0xc4201d5478, 0x5ccc168, 0xc4200da840, 0x450a800, 0xc4201fc008)
	/usr/local/opt/go/libexec/src/net/tcpsock.go:259 +0x49 fp=0xc420075d50 sp=0xc420075d10 pc=0x412f4e9
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*Server).Serve(0xc4200da840, 0x45087a0, 0xc4201d5478, 0x0, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/server.go:503 +0x1d5 fp=0xc420075e88 sp=0xc420075d50 pc=0x5b8b425
plugin/unnamed-1ff22f96c4cc425e35a2a116310b052feda99342.Serve()
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/plugin/main.go:23 +0xdd fp=0xc420075ef8 sp=0xc420075e88 pc=0x5b9d95d
main.main()
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/main.go:37 +0xf2 fp=0xc420075f88 sp=0xc420075ef8 pc=0x439fe42
runtime.main()
	/usr/local/opt/go/libexec/src/runtime/proc.go:198 +0x212 fp=0xc420075fe0 sp=0xc420075f88 pc=0x402e4d2
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420075fe8 sp=0xc420075fe0 pc=0x4057c01

goroutine 2 [force gc (idle)]:
runtime.gopark(0x44cd1d0, 0x47447f0, 0x44b2275, 0xf, 0x44cd014, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420052768 sp=0xc420052748 pc=0x402e92a
runtime.goparkunlock(0x47447f0, 0x44b2275, 0xf, 0x14, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:297 +0x5e fp=0xc4200527a8 sp=0xc420052768 pc=0x402e9de
runtime.forcegchelper()
	/usr/local/opt/go/libexec/src/runtime/proc.go:248 +0xcc fp=0xc4200527e0 sp=0xc4200527a8 pc=0x402e76c
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200527e8 sp=0xc4200527e0 pc=0x4057c01
created by runtime.init.4
	/usr/local/opt/go/libexec/src/runtime/proc.go:237 +0x35

goroutine 3 [GC sweep wait]:
runtime.gopark(0x44cd1d0, 0x47449a0, 0x44b11a5, 0xd, 0x4020914, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420052f60 sp=0xc420052f40 pc=0x402e92a
runtime.goparkunlock(0x47449a0, 0x44b11a5, 0xd, 0x14, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:297 +0x5e fp=0xc420052fa0 sp=0xc420052f60 pc=0x402e9de
runtime.bgsweep(0xc420080000)
	/usr/local/opt/go/libexec/src/runtime/mgcsweep.go:52 +0xa3 fp=0xc420052fd8 sp=0xc420052fa0 pc=0x4020933
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420052fe0 sp=0xc420052fd8 pc=0x4057c01
created by runtime.gcenable
	/usr/local/opt/go/libexec/src/runtime/mgc.go:216 +0x58

goroutine 18 [finalizer wait]:
runtime.gopark(0x44cd1d0, 0x4762718, 0x44b1ae0, 0xe, 0x14, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc42004e718 sp=0xc42004e6f8 pc=0x402e92a
runtime.goparkunlock(0x4762718, 0x44b1ae0, 0xe, 0x14, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:297 +0x5e fp=0xc42004e758 sp=0xc42004e718 pc=0x402e9de
runtime.runfinq()
	/usr/local/opt/go/libexec/src/runtime/mfinal.go:175 +0xad fp=0xc42004e7e0 sp=0xc42004e758 pc=0x40179dd
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42004e7e8 sp=0xc42004e7e0 pc=0x4057c01
created by runtime.createfing
	/usr/local/opt/go/libexec/src/runtime/mfinal.go:156 +0x62

goroutine 19 [select]:
runtime.gopark(0x44cd210, 0x0, 0x44ad79d, 0x6, 0x18, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc4200718b8 sp=0xc420071898 pc=0x402e92a
runtime.selectgo(0xc420071b18, 0xc42002e420)
	/usr/local/opt/go/libexec/src/runtime/select.go:392 +0xe50 fp=0xc420071a90 sp=0xc4200718b8 pc=0x403d830
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.(*Stream).waitOnHeader(0xc420268000, 0x10, 0xc420071c10)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/transport.go:262 +0x172 fp=0xc420071be0 sp=0xc420071a90 pc=0x43730a2
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.(*Stream).RecvCompress(0xc420268000, 0x44cc7d8, 0xc420071cd0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/transport.go:275 +0x2b fp=0xc420071c08 sp=0xc420071be0 pc=0x43731fb
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*csAttempt).recvMsg(0xc420282000, 0x4458c40, 0xc4200a55b0, 0x0, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/stream.go:494 +0x5ff fp=0xc420071cb8 sp=0xc420071c08 pc=0x439819f
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*clientStream).RecvMsg(0xc42021e080, 0x4458c40, 0xc4200a55b0, 0x0, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/stream.go:384 +0x43 fp=0xc420071cf0 sp=0xc420071cb8 pc=0x4397363
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.invoke(0x4508ee0, 0xc4200ae008, 0x44b6e78, 0x19, 0x4453840, 0xc4200a55a0, 0x4458c40, 0xc4200a55b0, 0xc4200d8f00, 0x0, ...)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/call.go:83 +0x1bb fp=0xc420071d98 sp=0xc420071cf0 pc=0x437e68b
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*ClientConn).Invoke(0xc4200d8f00, 0x4508ee0, 0xc4200ae008, 0x44b6e78, 0x19, 0x4453840, 0xc4200a55a0, 0x4458c40, 0xc4200a55b0, 0x0, ...)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/call.go:37 +0x1b3 fp=0xc420071e50 sp=0xc420071d98 pc=0x437e233
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.Invoke(0x4508ee0, 0xc4200ae008, 0x44b6e78, 0x19, 0x4453840, 0xc4200a55a0, 0x4458c40, 0xc4200a55b0, 0xc4200d8f00, 0x0, ...)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/call.go:60 +0xc1 fp=0xc420071ed0 sp=0xc420071e50 pc=0x437e4a1
github.com/PeerXu/error-grpc-with-plugin/proto.(*greetServiceClient).Greet(0xc4201d5480, 0x4508ee0, 0xc4200ae008, 0xc4200a55a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/proto/greet.pb.go:97 +0xd2 fp=0xc420071f58 sp=0xc420071ed0 pc=0x439fb82
main.main.func1()
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/main.go:31 +0x16b fp=0xc420071fe0 sp=0xc420071f58 pc=0x43a013b
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420071fe8 sp=0xc420071fe0 pc=0x4057c01
created by main.main
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/main.go:23 +0xd3

goroutine 34 [syscall]:
runtime.notetsleepg(0x4749060, 0x1bf08c4575, 0x16)
	/usr/local/opt/go/libexec/src/runtime/lock_sema.go:280 +0x4b fp=0xc420204760 sp=0xc420204720 pc=0x4011c5b
runtime.timerproc(0x4749040)
	/usr/local/opt/go/libexec/src/runtime/time.go:261 +0x2e7 fp=0xc4202047d8 sp=0xc420204760 pc=0x404a087
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4202047e0 sp=0xc4202047d8 pc=0x4057c01
created by runtime.(*timersBucket).addtimerLocked
	/usr/local/opt/go/libexec/src/runtime/time.go:160 +0x107

goroutine 20 [select]:
runtime.gopark(0x44cd210, 0x0, 0x44ad79d, 0x6, 0x18, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420060c68 sp=0xc420060c48 pc=0x402e92a
runtime.selectgo(0xc420060f10, 0xc42009a2a0)
	/usr/local/opt/go/libexec/src/runtime/select.go:392 +0xe50 fp=0xc420060e40 sp=0xc420060c68 pc=0x403d830
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*ccResolverWrapper).watcher(0xc4200a9d10)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/resolver_conn_wrapper.go:109 +0x182 fp=0xc420060fd8 sp=0xc420060e40 pc=0x438b002
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420060fe0 sp=0xc420060fd8 pc=0x4057c01
created by github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*ccResolverWrapper).start
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/resolver_conn_wrapper.go:95 +0x3f

goroutine 21 [select]:
runtime.gopark(0x44cd210, 0x0, 0x44ad79d, 0x6, 0x18, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420061c60 sp=0xc420061c40 pc=0x402e92a
runtime.selectgo(0xc420061f10, 0xc42009a360)
	/usr/local/opt/go/libexec/src/runtime/select.go:392 +0xe50 fp=0xc420061e38 sp=0xc420061c60 pc=0x403d830
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*ccBalancerWrapper).watcher(0xc4200b04c0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/balancer_conn_wrappers.go:122 +0x14a fp=0xc420061fd8 sp=0xc420061e38 pc=0x437d01a
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420061fe0 sp=0xc420061fd8 pc=0x4057c01
created by github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.newCCBalancerWrapper
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/balancer_conn_wrappers.go:113 +0x14c

goroutine 22 [select]:
runtime.gopark(0x44cd210, 0x0, 0x44ad79d, 0x6, 0x18, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420073c28 sp=0xc420073c08 pc=0x402e92a
runtime.selectgo(0xc420073eb8, 0xc420090180)
	/usr/local/opt/go/libexec/src/runtime/select.go:392 +0xe50 fp=0xc420073e00 sp=0xc420073c28 pc=0x403d830
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*addrConn).transportMonitor(0xc4200cb8c0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/clientconn.go:1243 +0x235 fp=0xc420073f80 sp=0xc420073e00 pc=0x4383675
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*addrConn).connect.func1(0xc4200cb8c0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/clientconn.go:854 +0x1b5 fp=0xc420073fd8 sp=0xc420073f80 pc=0x4399c55
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420073fe0 sp=0xc420073fd8 pc=0x4057c01
created by github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*addrConn).connect
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/clientconn.go:845 +0xe1

goroutine 23 [syscall]:
runtime.notetsleepg(0x4748fe0, 0x253f60e5d, 0xc42004ef01)
	/usr/local/opt/go/libexec/src/runtime/lock_sema.go:280 +0x4b fp=0xc42004ef60 sp=0xc42004ef20 pc=0x4011c5b
runtime.timerproc(0x4748fc0)
	/usr/local/opt/go/libexec/src/runtime/time.go:261 +0x2e7 fp=0xc42004efd8 sp=0xc42004ef60 pc=0x404a087
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42004efe0 sp=0xc42004efd8 pc=0x4057c01
created by runtime.(*timersBucket).addtimerLocked
	/usr/local/opt/go/libexec/src/runtime/time.go:160 +0x107

goroutine 4 [IO wait]:
runtime.gopark(0x44cd1a0, 0x4a7fce0, 0x44adc2c, 0x7, 0x4076f1b, 0x5)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420062af0 sp=0xc420062ad0 pc=0x402e92a
runtime.netpollblock(0x4a7fcb8, 0xffffff0000000072, 0x0)
	/usr/local/opt/go/libexec/src/runtime/netpoll.go:366 +0xaa fp=0xc420062b38 sp=0xc420062af0 pc=0x4028bfa
internal/poll.runtime_pollWait(0x4a7fcb8, 0x72, 0xc420062bb8)
	/usr/local/opt/go/libexec/src/runtime/netpoll.go:173 +0x57 fp=0xc420062b60 sp=0xc420062b38 pc=0x4028277
internal/poll.(*pollDesc).wait(0xc420208218, 0x72, 0xffffffffffffff00, 0x4502f60, 0x46ff590)
	/usr/local/opt/go/libexec/src/internal/poll/fd_poll_runtime.go:85 +0x9b fp=0xc420062b90 sp=0xc420062b60 pc=0x408ac1b
internal/poll.(*pollDesc).waitRead(0xc420208218, 0xc420222000, 0x8000, 0x8000)
	/usr/local/opt/go/libexec/src/internal/poll/fd_poll_runtime.go:90 +0x3d fp=0xc420062bc8 sp=0xc420062b90 pc=0x408ac9d
internal/poll.(*FD).Read(0xc420208200, 0xc420222000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
	/usr/local/opt/go/libexec/src/internal/poll/fd_unix.go:157 +0x1dc fp=0xc420062c18 sp=0xc420062bc8 pc=0x408bb5c
net.(*netFD).Read(0xc420208200, 0xc420222000, 0x8000, 0x8000, 0x9, 0x0, 0x0)
	/usr/local/opt/go/libexec/src/net/fd_unix.go:202 +0x4f fp=0xc420062c78 sp=0xc420062c18 pc=0x4117f8f
net.(*conn).Read(0xc42000e010, 0xc420222000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
	/usr/local/opt/go/libexec/src/net/net.go:176 +0x6a fp=0xc420062cd8 sp=0xc420062c78 pc=0x41282ea
bufio.(*Reader).Read(0xc4200900c0, 0xc42023a038, 0x9, 0x9, 0x30, 0x28, 0x4467a00)
	/usr/local/opt/go/libexec/src/bufio/bufio.go:216 +0x238 fp=0xc420062d30 sp=0xc420062cd8 pc=0x40f3e68
io.ReadAtLeast(0x45015e0, 0xc4200900c0, 0xc42023a038, 0x9, 0x9, 0x9, 0xc420062df0, 0x4002eae, 0xc420062e9f)
	/usr/local/opt/go/libexec/src/io/io.go:309 +0x86 fp=0xc420062d90 sp=0xc420062d30 pc=0x406db16
io.ReadFull(0x45015e0, 0xc4200900c0, 0xc42023a038, 0x9, 0x9, 0x4336304, 0xc4202b6000, 0xc4202b0004)
	/usr/local/opt/go/libexec/src/io/io.go:327 +0x58 fp=0xc420062de8 sp=0xc420062d90 pc=0x406dc88
github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2.readFrameHeader(0xc42023a038, 0x9, 0x9, 0x45015e0, 0xc4200900c0, 0x0, 0x0, 0xc4202b6000, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/frame.go:237 +0x7b fp=0xc420062e48 sp=0xc420062de8 pc=0x433441b
github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2.(*Framer).ReadFrame(0xc42023a000, 0xc4202b6000, 0xc4202b6000, 0x0, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/frame.go:492 +0xa4 fp=0xc420062f28 sp=0xc420062e48 pc=0x4334ca4
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.(*http2Client).reader(0xc420001380)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/http2_client.go:1180 +0xe1 fp=0xc420062fd8 sp=0xc420062f28 pc=0x4364461
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420062fe0 sp=0xc420062fd8 pc=0x4057c01
created by github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.newHTTP2Client
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/http2_client.go:258 +0xbf1

goroutine 5 [select]:
runtime.gopark(0x44cd210, 0x0, 0x44ad79d, 0x6, 0x18, 0x1)
	/usr/local/opt/go/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420252be0 sp=0xc420252bc0 pc=0x402e92a
runtime.selectgo(0xc420252e50, 0xc42002e240)
	/usr/local/opt/go/libexec/src/runtime/select.go:392 +0xe50 fp=0xc420252db8 sp=0xc420252be0 pc=0x403d830
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.loopyWriter(0x4508ea0, 0xc4200b0580, 0xc420218180, 0xc420252fb8)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/transport.go:741 +0x368 fp=0xc420252f98 sp=0xc420252db8 pc=0x4374558
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.newHTTP2Client.func3(0xc420001380)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/http2_client.go:290 +0x5e fp=0xc420252fd8 sp=0xc420252f98 pc=0x4375b8e
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420252fe0 sp=0xc420252fd8 pc=0x4057c01
created by github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.newHTTP2Client
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/http2_client.go:289 +0xd42

goroutine 6 [syscall]:
runtime.notetsleepg(0x4748f60, 0x4a7e9ee60, 0x0)
	/usr/local/opt/go/libexec/src/runtime/lock_sema.go:280 +0x4b fp=0xc420053f60 sp=0xc420053f20 pc=0x4011c5b
runtime.timerproc(0x4748f40)
	/usr/local/opt/go/libexec/src/runtime/time.go:261 +0x2e7 fp=0xc420053fd8 sp=0xc420053f60 pc=0x404a087
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420053fe0 sp=0xc420053fd8 pc=0x4057c01
created by runtime.(*timersBucket).addtimerLocked
	/usr/local/opt/go/libexec/src/runtime/time.go:160 +0x107

goroutine 36 [running]:
	goroutine running on other thread; stack unavailable
created by github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.newHTTP2Server
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/http2_server.go:260 +0xe4c

goroutine 38 [runnable]:
runtime.memhash(0x44ac13a, 0x8904787b, 0x5, 0x68)
	/usr/local/opt/go/libexec/src/runtime/hash64.go:23 +0x309 fp=0xc420256960 sp=0xc420256958 pc=0x4009459
runtime.strhash(0xc420256a98, 0x8904787b, 0x40131c8)
	/usr/local/opt/go/libexec/src/runtime/alg.go:97 +0x41 fp=0xc420256990 sp=0xc420256960 pc=0x4003021
type..3dy+qhMN(0xc420256a98, 0x8904787b, 0xc420256a38)
	<autogenerated>:1 +0x35 fp=0xc4202569b8 sp=0xc420256990 pc=0x4331475
runtime.mapassign(0x4417b40, 0xc42021a0f0, 0xc420256a98, 0x5)
	/usr/local/opt/go/libexec/src/runtime/hashmap.go:522 +0x7e fp=0xc420256a48 sp=0xc4202569b8 pc=0x400a24e
github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack.(*headerFieldTable).addEntry(...)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack/tables.go:59
github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack.(*dynamicTable).add(0xc42027c0e0, 0x44ac13a, 0x5, 0xc420290040, 0x19, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack/hpack.go:171 +0x13d fp=0xc420256b18 sp=0xc420256a48 pc=0x432d97d
github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack.(*Decoder).parseFieldLiteral(0xc42027c0e0, 0x6, 0x0, 0xc42027a100, 0xc4201fea80)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack/hpack.go:372 +0x2f7 fp=0xc420256c48 sp=0xc420256b18 pc=0x432eba7
github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack.(*Decoder).parseHeaderFieldRepr(0xc42027c0e0, 0x0, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack/hpack.go:308 +0x1ad fp=0xc420256c90 sp=0xc420256c48 pc=0x432e53d
github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack.(*Decoder).Write(0xc42027c0e0, 0xc4202b4000, 0x47, 0x47, 0x4a12d90, 0x4700040101, 0x1)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/hpack/hpack.go:255 +0xac fp=0xc420256cf0 sp=0xc420256c90 pc=0x432e17c
github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2.(*Framer).readMetaFrame(0xc42027c000, 0xc42021a240, 0x0, 0x0, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/frame.go:1501 +0x292 fp=0xc420256de0 sp=0xc420256cf0 pc=0x433a622
github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2.(*Framer).ReadFrame(0xc42027c000, 0x0, 0x0, 0x0, 0x0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/golang.org/x/net/http2/frame.go:517 +0x3fe fp=0xc420256ec0 sp=0xc420256de0 pc=0x4334ffe
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport.(*http2Server).HandleStreams(0xc4201fe600, 0xc42021a210, 0x5ccc1b0)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/transport/http2_server.go:392 +0x37 fp=0xc420256f30 sp=0xc420256ec0 pc=0x43684e7
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*Server).serveStreams(0xc4200da840, 0x450a500, 0xc4201fe600)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/server.go:633 +0xf3 fp=0xc420256f70 sp=0xc420256f30 pc=0x5b8c663
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*Server).handleRawConn.func2()
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/server.go:590 +0x3c fp=0xc420256f98 sp=0xc420256f70 pc=0x5b979ec
github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*Server).handleRawConn.func3(0xc4201f8060, 0xc4200da840, 0x4da0020, 0xc4201fe600)
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/server.go:598 +0x27 fp=0xc420256fc0 sp=0xc420256f98 pc=0x5b97a27
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420256fc8 sp=0xc420256fc0 pc=0x5853001
created by github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc.(*Server).handleRawConn
	/Users/peer/.golang/src/github.com/PeerXu/error-grpc-with-plugin/vendor/google.golang.org/grpc/server.go:597 +0x61b

goroutine 50 [syscall]:
runtime.notetsleepg(0x47490e0, 0x68c616fed7a, 0x0)
	/usr/local/opt/go/libexec/src/runtime/lock_sema.go:280 +0x4b fp=0xc420053760 sp=0xc420053720 pc=0x5811e4b
runtime.timerproc(0x47490c0)
	/usr/local/opt/go/libexec/src/runtime/time.go:261 +0x2f4 fp=0xc4200537d8 sp=0xc420053760 pc=0x5846da4
runtime.goexit()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200537e0 sp=0xc4200537d8 pc=0x5853001
created by runtime.(*timersBucket).addtimerLocked
	/usr/local/opt/go/libexec/src/runtime/time.go:160 +0x10b
exit status 2
make: *** [all] Error 1
@PeerXu PeerXu changed the title Try to start grpc server in shared library got an error when try to start grpc server in shared library May 7, 2018
@MakMukhi
Copy link
Contributor

MakMukhi commented May 7, 2018

Hey thanks for reporting the issue along with a repro. There seems to be a known issue in go 1.10 with plugins on MacOs. The most relevant issue that I found is this. Other related issues are: this and this.

I'd recommend trying go at head and if there's still a problem perhaps provide this repro on one of the open issues on golang's repo.

I'm closing this issue here but feel free to reopen/comment if there's something needed for gRPC-Go for this issue.

@MakMukhi MakMukhi closed this as completed May 7, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Nov 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants