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

plugin: Open panics depending on order of imports #24442

Closed
eraac opened this issue Mar 18, 2018 · 6 comments
Closed

plugin: Open panics depending on order of imports #24442

eraac opened this issue Mar 18, 2018 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@eraac
Copy link

eraac commented Mar 18, 2018

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

go version go1.10 darwin/amd64

Does this issue reproduce with the latest release?

Yes, fresh install of go 1.10

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

MacOS 10.13.3 (17D102)

go env

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/kevin/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/kevin/Code/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/43/45xhjfkn0xbbr4flsgzh879h0000gn/T/go-build744060967=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Depending on order of my import, plugin.Open() crash or not for the same .so file

All code are available here https://github.com/friendly-bot/api/tree/bug-plugin, sorry i can't give smaller code, due of the nature of the bug and when this happens. All dependencies are push too, and a dump of the database is also available.

Three things can change behaviors of this bug

order import feature is_active cron is_active result
order 1 yes yes crash when cron is loaded https://github.com/friendly-bot/api/blob/bug-plugin/main.go#L56
order 1 yes no no crash
order 1 no yes no crash (according to row 1, this case should crash, but no)
order 2 yes yes crash when feature is loaded https://github.com/friendly-bot/api/blob/bug-plugin/main.go#L51
order 2 yes no crash when feature is loaded https://github.com/friendly-bot/api/blob/bug-plugin/main.go#L51
order 2 no yes crash when cron is loaded https://github.com/friendly-bot/api/blob/bug-plugin/main.go#L56

If you have any questions, feel free to ask. I probably don't use plugin very well, i actually experiment with it

Actually some issues like this are already posted, but i hope with this detailed example, i can help

What did you expect to see?

plugin.Open() should load plugin correctly or return error if something is wrong with the .so file

What did you see instead?

INFO[0000] using config file                             file=config.json
INFO[0000] load started                                  feature=keyword_reaction plugin=keyword_reaction
DEBU[0000] open                                          plugin=/Users/kevin/Code/go/src/github.com/friendly-bot/plugins/keyword_reaction/keyword_reaction.so
runtime: bad pointer in frame main.RegisterFeatures at 0xc42039da18: 0x1
fatal error: invalid pointer found on stack

runtime stack:
runtime.throw(0x65a38f1, 0x1e)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/panic.go:619 +0x81 fp=0x7000087db6f8 sp=0x7000087db6d8 pc=0x61cac71
runtime.adjustpointers(0xc42039d970, 0x7000087db7f0, 0x7000087dbbc0, 0x48507f8, 0x4865020)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/stack.go:592 +0x23e fp=0x7000087db768 sp=0x7000087db6f8 pc=0x61e093e
runtime.adjustframe(0x7000087dbad0, 0x7000087dbbc0, 0x4865020)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/stack.go:663 +0x32c fp=0x7000087db820 sp=0x7000087db768 pc=0x61e0c8c
runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc420000180, 0x0, 0x0, 0x7fffffff, 0x65b0ff0, 0x7000087dbbc0, 0x0, ...)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/traceback.go:355 +0x136c fp=0x7000087dbb38 sp=0x7000087db820 pc=0x61e9e7c
runtime.copystack(0xc420000180, 0x8000, 0x7368301)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/stack.go:891 +0x26e fp=0x7000087dbcf0 sp=0x7000087dbb38 pc=0x61e177e
runtime.newstack()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/stack.go:1063 +0x310 fp=0x7000087dbe80 sp=0x7000087dbcf0 pc=0x61e1b90
runtime: unexpected return pc for runtime.morestack called from 0x0
stack: frame={sp:0x7000087dbe80, fp:0x7000087dbe88} stack=[0x70000875c290,0x7000087dbe90)
00007000087dbd80:  000000c4202c8480  00000074696e692e 
00007000087dbd90:  000000000682a955  0000000004b000a0 
00007000087dbda0:  05d3ba43d253003a  00001b0000001b00 
00007000087dbdb0:  00000000064aeb30 <plugin/unnamed-c146d71888c72c8bfdd35bbd8de45a05a9de864d.init+0>  000000c4202be258 
00007000087dbdc0:  000000c420000180  000000c42013b540 
00007000087dbdd0:  00000000064aeb8b <plugin/unnamed-c146d71888c72c8bfdd35bbd8de45a05a9de864d.init+91>  000000c420000180 
00007000087dbde0:  0000000000000000  0000000000000000 
00007000087dbdf0:  0000000000000000  0000000000000000 
00007000087dbe00:  00007000087dbe30  000000000446ca8c 
00007000087dbe10:  000000c42013b518  ffffffffffffffff 
00007000087dbe20:  000000000000011c  0000000000000200 
00007000087dbe30:  000000c42013b4c8  00000000040575d0 <runtime.asmcgocall+112> 
00007000087dbe40:  000000c4202c8480  00007000087dbe68 
00007000087dbe50:  0000000004052fa2 <runtime.(*mcache).nextFree.func1+50>  0000000004ab9458 
00007000087dbe60:  000000c42013b00b  0000000000000b68 
00007000087dbe70:  000000c42013b540  00000000061f0069 <runtime.morestack+137> 
00007000087dbe80: <0000000000000000 >0100000004e00000 
runtime.morestack()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:480 +0x89 fp=0x7000087dbe88 sp=0x7000087dbe80 pc=0x61f0069

goroutine 1 [copystack]:
github.com/nlopes/slack.init()
	<autogenerated>:1 +0x2bd9 fp=0xc42039d540 sp=0xc42039d538 pc=0x648da59
plugin/unnamed-c146d71888c72c8bfdd35bbd8de45a05a9de864d.init()
	<autogenerated>:1 +0x5b fp=0xc42039d550 sp=0xc42039d540 pc=0x64aeb8b
plugin.open(0xc4202a8300, 0x5a, 0x5, 0xc4202e7b98, 0x4)
	/usr/local/Cellar/go/1.10/libexec/src/plugin/plugin_dlopen.go:113 +0xb21 fp=0xc42039d808 sp=0xc42039d550 pc=0x446a061
plugin.Open(0xc4202a8300, 0x5d, 0x1, 0x1, 0xc4202ba910)
	/usr/local/Cellar/go/1.10/libexec/src/plugin/plugin.go:32 +0x35 fp=0xc42039d840 sp=0xc42039d808 pc=0x4469105
main.GetPlugin(0xc4202a8300, 0x5d, 0x0, 0x0, 0x0)
	/Users/kevin/Code/go/src/github.com/friendly-bot/api/plugin.go:30 +0xca fp=0xc42039d8a0 sp=0xc42039d840 pc=0x446b37a
main.LoadPlugin(0xc4202a8300, 0x5d, 0x45a8b7c, 0xa, 0xc4202a8180, 0x59, 0x60, 0x0, 0xc42008c658, 0xc4202e71c0, ...)
	/Users/kevin/Code/go/src/github.com/friendly-bot/api/plugin.go:84 +0x39 fp=0xc42039d900 sp=0xc42039d8a0 pc=0x446baa9
main.RegisterFeatures(0xc4202ba0f0, 0x1, 0x0, 0x4612b60)
	/Users/kevin/Code/go/src/github.com/friendly-bot/api/register_feature.go:24 +0x330 fp=0xc42039dc58 sp=0xc42039d900 pc=0x446c670
main.main()
	/Users/kevin/Code/go/src/github.com/friendly-bot/api/main.go:51 +0x45b fp=0xc42039df88 sp=0xc42039dc58 pc=0x446accb
runtime.main()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:198 +0x212 fp=0xc42039dfe0 sp=0xc42039df88 pc=0x402e3d2
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42039dfe8 sp=0xc42039dfe0 pc=0x40588e1

goroutine 2 [force gc (idle)]:
runtime.gopark(0x45c7600, 0x489c190, 0x45abdb5, 0xf, 0x45c7514, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420042768 sp=0xc420042748 pc=0x402e82a
runtime.goparkunlock(0x489c190, 0x45abdb5, 0xf, 0x14, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:297 +0x5e fp=0xc4200427a8 sp=0xc420042768 pc=0x402e8de
runtime.forcegchelper()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:248 +0xcc fp=0xc4200427e0 sp=0xc4200427a8 pc=0x402e66c
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200427e8 sp=0xc4200427e0 pc=0x40588e1
created by runtime.init.4
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:237 +0x35

goroutine 3 [GC sweep wait]:
runtime.gopark(0x45c7600, 0x489c280, 0x45aa738, 0xd, 0x4020814, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420042f60 sp=0xc420042f40 pc=0x402e82a
runtime.goparkunlock(0x489c280, 0x45aa738, 0xd, 0x14, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:297 +0x5e fp=0xc420042fa0 sp=0xc420042f60 pc=0x402e8de
runtime.bgsweep(0xc420080000)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/mgcsweep.go:52 +0xa3 fp=0xc420042fd8 sp=0xc420042fa0 pc=0x4020833
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420042fe0 sp=0xc420042fd8 pc=0x40588e1
created by runtime.gcenable
	/usr/local/Cellar/go/1.10/libexec/src/runtime/mgc.go:216 +0x58

goroutine 18 [finalizer wait]:
runtime.gopark(0x45c7600, 0x48ba550, 0x45ab35a, 0xe, 0x14, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc42003e718 sp=0xc42003e6f8 pc=0x402e82a
runtime.goparkunlock(0x48ba550, 0x45ab35a, 0xe, 0x14, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:297 +0x5e fp=0xc42003e758 sp=0xc42003e718 pc=0x402e8de
runtime.runfinq()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/mfinal.go:175 +0xad fp=0xc42003e7e0 sp=0xc42003e758 pc=0x40178dd
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42003e7e8 sp=0xc42003e7e0 pc=0x40588e1
created by runtime.createfing
	/usr/local/Cellar/go/1.10/libexec/src/runtime/mfinal.go:156 +0x62

goroutine 19 [syscall]:
runtime.notetsleepg(0x48ba920, 0xffffffffffffffff, 0x0)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/lock_sema.go:280 +0x4b fp=0xc42003ef80 sp=0xc42003ef40 pc=0x4011b5b
os/signal.signal_recv(0x0)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/sigqueue.go:139 +0xa7 fp=0xc42003efa8 sp=0xc42003ef80 pc=0x4042687
os/signal.loop()
	/usr/local/Cellar/go/1.10/libexec/src/os/signal/signal_unix.go:22 +0x22 fp=0xc42003efe0 sp=0xc42003efa8 pc=0x408ceb2
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42003efe8 sp=0xc42003efe0 pc=0x40588e1
created by os/signal.init.0
	/usr/local/Cellar/go/1.10/libexec/src/os/signal/signal_unix.go:28 +0x41

goroutine 20 [chan receive]:
runtime.gopark(0x45c7600, 0xc420170178, 0x45aa05d, 0xc, 0xc420035817, 0x3)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420050e30 sp=0xc420050e10 pc=0x402e82a
runtime.goparkunlock(0xc420170178, 0x45aa05d, 0xc, 0x17, 0x3)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:297 +0x5e fp=0xc420050e70 sp=0xc420050e30 pc=0x402e8de
runtime.chanrecv(0xc420170120, 0x0, 0x1, 0xc420172020)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/chan.go:518 +0x2f2 fp=0xc420050f08 sp=0xc420050e70 pc=0x4006c72
runtime.chanrecv1(0xc420170120, 0x0)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/chan.go:400 +0x2b fp=0xc420050f38 sp=0xc420050f08 pc=0x400692b
github.com/spf13/viper.(*Viper).WatchConfig.func1(0xc4200c00f0)
	/Users/kevin/Code/go/src/github.com/spf13/viper/viper.go:282 +0x22f fp=0xc420050fd8 sp=0xc420050f38 pc=0x43574bf
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420050fe0 sp=0xc420050fd8 pc=0x40588e1
created by github.com/spf13/viper.(*Viper).WatchConfig
	/Users/kevin/Code/go/src/github.com/spf13/viper/viper.go:243 +0x3f

goroutine 34 [syscall]:
syscall.Syscall6(0x16b, 0x3, 0x0, 0x0, 0xc42017a688, 0xa, 0x48ba770, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.10/libexec/src/syscall/asm_darwin_amd64.s:41 +0x5 fp=0xc42017a450 sp=0xc42017a448 pc=0x406bcb5
golang.org/x/sys/unix.kevent(0x3, 0x0, 0x0, 0xc42017a688, 0xa, 0x48ba770, 0x0, 0x0, 0x0)
	/Users/kevin/Code/go/src/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:207 +0x9d fp=0xc42017a4d8 sp=0xc42017a450 pc=0x40e55fd
golang.org/x/sys/unix.Kevent(0x3, 0x0, 0x0, 0x0, 0xc42017a688, 0xa, 0xa, 0x48ba770, 0x0, 0x0, ...)
	/Users/kevin/Code/go/src/golang.org/x/sys/unix/syscall_bsd.go:460 +0x71 fp=0xc42017a530 sp=0xc42017a4d8 pc=0x40e4fc1
github.com/fsnotify/fsnotify.read(0x3, 0xc42017a688, 0xa, 0xa, 0x48ba770, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/kevin/Code/go/src/github.com/fsnotify/fsnotify/kqueue.go:493 +0x6e fp=0xc42017a598 sp=0xc42017a530 pc=0x40e875e
github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc420172000)
	/Users/kevin/Code/go/src/github.com/fsnotify/fsnotify/kqueue.go:284 +0x572 fp=0xc42017a7d8 sp=0xc42017a598 pc=0x40e7c72
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42017a7e0 sp=0xc42017a7d8 pc=0x40588e1
created by github.com/fsnotify/fsnotify.NewWatcher
	/Users/kevin/Code/go/src/github.com/fsnotify/fsnotify/kqueue.go:62 +0x1a2

goroutine 35 [select]:
runtime.gopark(0x45c7648, 0x0, 0x45a5c91, 0x6, 0x18, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc4201a2ca8 sp=0xc4201a2c88 pc=0x402e82a
runtime.selectgo(0xc4201a2f30, 0xc420170060)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/select.go:392 +0xe50 fp=0xc4201a2e80 sp=0xc4201a2ca8 pc=0x403d970
github.com/spf13/viper.(*Viper).WatchConfig.func1.1(0xc420172000, 0x45a9671, 0xb, 0xc4200c00f0)
	/Users/kevin/Code/go/src/github.com/spf13/viper/viper.go:263 +0x10a fp=0xc4201a2fc0 sp=0xc4201a2e80 pc=0x435709a
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4201a2fc8 sp=0xc4201a2fc0 pc=0x40588e1
created by github.com/spf13/viper.(*Viper).WatchConfig.func1
	/Users/kevin/Code/go/src/github.com/spf13/viper/viper.go:261 +0x1f6

goroutine 21 [select]:
runtime.gopark(0x45c7648, 0x0, 0x45a5c91, 0x6, 0x18, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc42003fd30 sp=0xc42003fd10 pc=0x402e82a
runtime.selectgo(0xc42003ff38, 0xc42008c420)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/select.go:392 +0xe50 fp=0xc42003ff08 sp=0xc42003fd30 pc=0x403d970
database/sql.(*DB).connectionOpener(0xc4202452c0, 0x460dbe0, 0xc42025cb00)
	/usr/local/Cellar/go/1.10/libexec/src/database/sql/sql.go:935 +0x119 fp=0xc42003ffc8 sp=0xc42003ff08 pc=0x4362aa9
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42003ffd0 sp=0xc42003ffc8 pc=0x40588e1
created by database/sql.OpenDB
	/usr/local/Cellar/go/1.10/libexec/src/database/sql/sql.go:634 +0x178

goroutine 22 [select]:
runtime.gopark(0x45c7648, 0x0, 0x45a5c91, 0x6, 0x18, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420040520 sp=0xc420040500 pc=0x402e82a
runtime.selectgo(0xc420040738, 0xc420268000)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/select.go:392 +0xe50 fp=0xc4200406f8 sp=0xc420040520 pc=0x403d970
database/sql.(*DB).connectionResetter(0xc4202452c0, 0x460dbe0, 0xc42025cb00)
	/usr/local/Cellar/go/1.10/libexec/src/database/sql/sql.go:948 +0x12a fp=0xc4200407c8 sp=0xc4200406f8 pc=0x4362c0a
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200407d0 sp=0xc4200407c8 pc=0x40588e1
created by database/sql.OpenDB
	/usr/local/Cellar/go/1.10/libexec/src/database/sql/sql.go:635 +0x1ae

goroutine 4 [select, locked to thread]:
runtime.gopark(0x45c7648, 0x0, 0x45a5c91, 0x6, 0x18, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420043548 sp=0xc420043528 pc=0x402e82a
runtime.selectgo(0xc420043750, 0xc42002e120)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/select.go:392 +0xe50 fp=0xc420043720 sp=0xc420043548 pc=0x403d970
runtime.ensureSigM.func1()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/signal_unix.go:549 +0x1c6 fp=0xc4200437e0 sp=0xc420043720 pc=0x4055636
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200437e8 sp=0xc4200437e0 pc=0x40588e1
created by runtime.ensureSigM
	/usr/local/Cellar/go/1.10/libexec/src/runtime/signal_unix.go:532 +0xda

goroutine 50 [syscall]:
runtime.notetsleepg(0x48a0f20, 0xb2ceacc4, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/lock_sema.go:280 +0x4b fp=0xc420040f60 sp=0xc420040f20 pc=0x4011b5b
runtime.timerproc(0x48a0f00)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/time.go:261 +0x2e7 fp=0xc420040fd8 sp=0xc420040f60 pc=0x404a647
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420040fe0 sp=0xc420040fd8 pc=0x40588e1
created by runtime.(*timersBucket).addtimerLocked
	/usr/local/Cellar/go/1.10/libexec/src/runtime/time.go:160 +0x107

goroutine 24 [chan receive]:
runtime.gopark(0x45c7600, 0xc4201b2298, 0x45aa05d, 0xc, 0x404a017, 0x3)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc4200415e0 sp=0xc4200415c0 pc=0x402e82a
runtime.goparkunlock(0xc4201b2298, 0x45aa05d, 0xc, 0x17, 0x3)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:297 +0x5e fp=0xc420041620 sp=0xc4200415e0 pc=0x402e8de
runtime.chanrecv(0xc4201b2240, 0xc420041748, 0xc4202ba001, 0xc4200416f0)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/chan.go:518 +0x2f2 fp=0xc4200416b8 sp=0xc420041620 pc=0x4006c72
runtime.chanrecv2(0xc4201b2240, 0xc420041748, 0xc4202ba000)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/chan.go:405 +0x2b fp=0xc4200416e8 sp=0xc4200416b8 pc=0x400696b
github.com/go-redis/redis/internal/pool.(*ConnPool).reaper(0xc42025e600, 0xdf8475800)
	/Users/kevin/Code/go/src/github.com/go-redis/redis/internal/pool/pool.go:356 +0xa7 fp=0xc4200417d0 sp=0xc4200416e8 pc=0x43d5ca7
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200417d8 sp=0xc4200417d0 pc=0x40588e1
created by github.com/go-redis/redis/internal/pool.NewConnPool
	/Users/kevin/Code/go/src/github.com/go-redis/redis/internal/pool/pool.go:89 +0x1b8

goroutine 25 [chan receive]:
runtime.gopark(0x45c7600, 0xc420082358, 0x45aa05d, 0xc, 0xc420030e17, 0x3)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:291 +0x11a fp=0xc420041de8 sp=0xc420041dc8 pc=0x402e82a
runtime.goparkunlock(0xc420082358, 0x45aa05d, 0xc, 0x17, 0x3)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:297 +0x5e fp=0xc420041e28 sp=0xc420041de8 pc=0x402e8de
runtime.chanrecv(0xc420082300, 0xc420041f50, 0xc42026e001, 0xc420041ef8)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/chan.go:518 +0x2f2 fp=0xc420041ec0 sp=0xc420041e28 pc=0x4006c72
runtime.chanrecv2(0xc420082300, 0xc420041f50, 0xc42026e0f0)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/chan.go:405 +0x2b fp=0xc420041ef0 sp=0xc420041ec0 pc=0x400696b
github.com/go-redis/redis.(*Ring).heartbeat(0xc4202686c0)
	/Users/kevin/Code/go/src/github.com/go-redis/redis/ring.go:339 +0x210 fp=0xc420041fd8 sp=0xc420041ef0 pc=0x43fdac0
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420041fe0 sp=0xc420041fd8 pc=0x40588e1
created by github.com/go-redis/redis.NewRing
	/Users/kevin/Code/go/src/github.com/go-redis/redis/ring.go:159 +0x324

goroutine 26 [syscall]:
runtime.notetsleepg(0x48a0e20, 0x12a04472e, 0x1)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/lock_sema.go:280 +0x4b fp=0xc420176760 sp=0xc420176720 pc=0x4011b5b
runtime.timerproc(0x48a0e00)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/time.go:261 +0x2e7 fp=0xc4201767d8 sp=0xc420176760 pc=0x404a647
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4201767e0 sp=0xc4201767d8 pc=0x40588e1
created by runtime.(*timersBucket).addtimerLocked
	/usr/local/Cellar/go/1.10/libexec/src/runtime/time.go:160 +0x107

goroutine 5 [syscall]:
runtime.notetsleepg(0x48a0da0, 0x1dcd3d78, 0x0)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/lock_sema.go:280 +0x4b fp=0xc420043f60 sp=0xc420043f20 pc=0x4011b5b
runtime.timerproc(0x48a0d80)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/time.go:261 +0x2e7 fp=0xc420043fd8 sp=0xc420043f60 pc=0x404a647
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420043fe0 sp=0xc420043fd8 pc=0x40588e1
created by runtime.(*timersBucket).addtimerLocked
	/usr/local/Cellar/go/1.10/libexec/src/runtime/time.go:160 +0x107

goroutine 36 [syscall]:
runtime.notetsleepg(0x48a0ea0, 0xb2cf6143, 0x0)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/lock_sema.go:280 +0x4b fp=0xc420176f60 sp=0xc420176f20 pc=0x4011b5b
runtime.timerproc(0x48a0e80)
	/usr/local/Cellar/go/1.10/libexec/src/runtime/time.go:261 +0x2e7 fp=0xc420176fd8 sp=0xc420176f60 pc=0x404a647
runtime.goexit()
	/usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420176fe0 sp=0xc420176fd8 pc=0x40588e1
created by runtime.(*timersBucket).addtimerLocked
	/usr/local/Cellar/go/1.10/libexec/src/runtime/time.go:160 +0x107
exit status 2
@odeke-em odeke-em changed the title runtime/plugin: Open() panic depending on order of imports plugin: Open panics depending on order of imports Mar 19, 2018
@odeke-em
Copy link
Member

Hello @eraac, thank you for reporting this and for providing as much information.

I'll page some runtime and plugin wizards /cc @crawshaw @ianlancetaylor @aclements

@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 19, 2018
@randall77
Copy link
Contributor

Can you try tip? I think https://go-review.googlesource.com/c/go/+/100739 will fix this issue for you.

@eraac
Copy link
Author

eraac commented Mar 20, 2018

Thank, but unfortunately i have new errors

After compile my program, when plugin are loaded I have plugin was built with a different version of package internal/cpu.

So I have re-compiled my plugin and I have plugin was built with a different version of package errors

And after I compile with GOCACHE=off(plugin & program) and I get the first error

runtime: bad pointer in frame main.RegisterCron at 0xc0004cf958: 0x3
fatal error: invalid pointer found on stack

I use this commit for my go bin ae10914

EDIT:

I have no idea if this is linked with my bug, but when i compile my plugin for linux from macos, I get this

# command-line-arguments
loadinternal: cannot find runtime/cgo
/usr/local/Cellar/go/1.10/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: unknown option: -z
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@andybons andybons added this to the Go1.11 milestone Mar 26, 2018
@hirochachacha
Copy link
Contributor

Is this still reproducible? #23369 was closed recently.

@eraac
Copy link
Author

eraac commented Apr 6, 2018

@hirochachacha its seems to work correctly now, thanks !

@cherrymui
Copy link
Member

Seems fixed. Closing.

@golang golang locked and limited conversation to collaborators Apr 24, 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

8 participants