Hi, Does anyone know if profiling is supposed to work for an application using plugins or not (i find no information that it shouldn't)?
Background: 1. My package test works fine (including loading a plugin), showing no errors in normal test. 2. When running the test under -race the only output I get is: 2018/03/30 11:05:29 plugin.Open("/temp/eserve/code/a8a00b3145ec747775cb88479615cec44c992a9212dacd496b599ebff6a1e86c"): plugin was built with a different version of package sync/atomic -> I assume this is just because the plugin is build without -race (its build inside the test using cmd := exec.Command("go", "build", "-buildmode=plugin", file), ) 3. When running the same test with -cpuprofile cpu.prof I (sometimes) get: runtime: unexpected return pc for runtime.goexit called from 0xc420020000 stack: frame={sp:0xc42038cfd8, fp:0xc42038cfe0} stack=[0xc42038c800,0xc42038d000) 000000c42038ced8: 00000000043588b0 0000000000000000 000000c42038cee8: 0000000000000000 0000000000000000 000000c42038cef8: 0000000000000000 0000000000000000 000000c42038cf08: 000000c42038cf38 0000000005801228 <runtime.newobject+56> 000000c42038cf18: 0000000000000010 0000000005818056 <runtime.gopark+294> 000000c42038cf28: 00000000058661a8 000000c4204b4010 000000c42038cf38: 000000c42038cfc8 0000000005808440 <runtime.gcBgMarkWorker+528> 000000c42038cf48: 000000c42038cfb0 000000c4204b4010 000000c42038cf58: 0000000005862da2 0000000000000010 000000c42038cf68: 0000000000000014 0000000000000000 000000c42038cf78: 0000000000000000 0000000000000000 000000c42038cf88: 000000007c6a1d8f 0000000000000000 000000c42038cf98: 000000c4202f4480 000000c420021258 000000c42038cfa8: 000000c4204b4010 0000000005833e80 <runtime.gcBgMarkWorker.func2+0> 000000c42038cfb8: 000000c4202f4480 000000c420020000 000000c42038cfc8: 0000000000000000 0000000005837fc1 <runtime.goexit+1> 000000c42038cfd8: <000000c420020000 >0000000000000000 000000c42038cfe8: 0000000000000000 0000000000000000 000000c42038cff8: 0000000000000000 fatal error: unknown caller pc runtime: unexpected return pc for runtime.goexit called from 0xc420024a00 stack: frame={sp:0xc42038dfd8, fp:0xc42038dfe0} stack=[0xc42038d800,0xc42038e000) 000000c42038ded8: 00000000043588b0 0000000000000000 000000c42038dee8: 0000000000000000 0000000000000000 000000c42038def8: 0000000000000000 0000000000000000 000000c42038df08: 000000c42038df38 0000000005801228 <runtime.newobject+56> 000000c42038df18: 0000000000000010 0000000005818056 <runtime.gopark+294> 000000c42038df28: 00000000058661a8 000000c4204b4030 000000c42038df38: 000000c42038dfc8 000000000580836f <runtime.gcBgMarkWorker+319> 000000c42038df48: 00000000058660a0 000000c4204b4030 000000c42038df58: 0000000005862da2 0000000000000010 000000c42038df68: 0000000000000014 0000000000000000 000000c42038df78: 0000000000000000 0000000000000000 000000c42038df88: 0000000000000000 0000000000000000 000000c42038df98: 000000c4202f4780 0000000000000000 000000c42038dfa8: 000000c4204b4030 0000000000000000 000000c42038dfb8: 0000000000000000 0000000000000000 000000c42038dfc8: 0000000000000000 0000000005837fc1 <runtime.goexit+1> 000000c42038dfd8: <000000c420024a00 >0000000000000000 000000c42038dfe8: 0000000000000000 0000000000000000 000000c42038dff8: 0000000000000000 fatal error: unknown caller pc runtime: unexpected return pc for runtime.goexit called from 0xc420022500 stack: frame={sp:0xc42038d7d8, fp:0xc42038d7e0} stack=[0xc42038d000,0xc42038d800) 000000c42038d6d8: 00000000043588b0 0000000000000000 000000c42038d6e8: 0000000000000000 0000000000000000 000000c42038d6f8: 0000000000000000 0000000000000000 000000c42038d708: 000000c42038d738 0000000005801228 <runtime.newobject+56> 000000c42038d718: 0000000000000010 0000000005818056 <runtime.gopark+294> 000000c42038d728: 00000000058661a8 000000c4204b4020 000000c42038d738: 000000c42038d7c8 0000000005808440 <runtime.gcBgMarkWorker+528> 000000c42038d748: 000000c42038d7b0 000000c4204b4020 000000c42038d758: 0000000005862da2 0000000000000010 000000c42038d768: 0000000000000014 0000000000000000 000000c42038d778: 0000000000000000 0000000000000000 000000c42038d788: 000000007c6a8636 0000000000000000 000000c42038d798: 000000c4202f4600 000000c420023758 000000c42038d7a8: 000000c4204b4020 0000000005833e80 <runtime.gcBgMarkWorker.func2+0> 000000c42038d7b8: 000000c4202f4600 000000c420022500 000000c42038d7c8: 0000000000000000 0000000005837fc1 <runtime.goexit+1> 000000c42038d7d8: <000000c420022500 >0000000000000000 000000c42038d7e8: 0000000000000000 0000000000000000 000000c42038d7f8: 0000000000000000 fatal error: unknown caller pc runtime stack: runtime: unexpected return pc for runtime.mstart called from 0x0 stack: frame={sp:0x7000025bfe80, fp:0x7000025bfe88} stack=[0x700002540290,0x7000025bfe90) 00007000025bfd80: 0000000000000000 0000700000000002 00007000025bfd90: 0000000000000004 000000c41ffda7ff 00007000025bfda0: 0000000000000003 00000000055423a0 00007000025bfdb0: 000000c42044c020 0000000005834070 <runtime.markroot.func1+0> 00007000025bfdc0: 000000c4202f4480 000000c420021270 00007000025bfdd0: 00007000025bfe28 000000000580c0f2 <runtime.gcDrain+306> 00007000025bfde0: 000000c420021270 0000000000000020 00007000025bfdf0: 0000000000000000 7fffffffffffffff 00007000025bfe00: 0000000000004000 00000000055423a0 00007000025bfe10: 000000c420001e00 000000c4202f4480 00007000025bfe20: 0000000000000000 00007000025bfe68 00007000025bfe30: 0000000005833f00 <runtime.gcBgMarkWorker.func2+128> 000000c420021270 00007000025bfe40: 0000000000000005 00007000025bfe68 00007000025bfe50: 000000c4202f4480 000000c420020000 00007000025bfe60: 000000c420021270 00007fffffe00000 00007000025bfe70: 0000000005835d19 <runtime.systemstack+121> 000000000581a9b0 <runtime.mstart+0> 00007000025bfe80: <0000000000000000 >0100000004500000 runtime.throw(0x5863088, 0x11) /usr/local/Cellar/go/1.10/libexec/src/runtime/panic.go:619 +0x81 runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc4202f4480, 0x0, 0x0, 0x7fffffff, 0x7000025bfca8, 0x0, 0x0, ...) /usr/local/Cellar/go/1.10/libexec/src/runtime/traceback.go:302 +0x1c48 runtime.scanstack(0xc4202f4480, 0xc420021270) /usr/local/Cellar/go/1.10/libexec/src/runtime/mgcmark.go:786 +0x151 runtime.scang(0xc4202f4480, 0xc420021270) /usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:888 +0x1f6 runtime.markroot.func1() /usr/local/Cellar/go/1.10/libexec/src/runtime/mgcmark.go:264 +0x6d runtime.markroot(0xc420021270, 0x20) /usr/local/Cellar/go/1.10/libexec/src/runtime/mgcmark.go:245 +0x340 runtime.gcDrain(0xc420021270, 0x5) /usr/local/Cellar/go/1.10/libexec/src/runtime/mgcmark.go:934 +0x132 runtime.gcBgMarkWorker.func2() /usr/local/Cellar/go/1.10/libexec/src/runtime/mgc.go:1842 +0x80 runtime.systemstack(0x0) /usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:409 +0x79 runtime: unexpected return pc for runtime.mstart called from 0x0 stack: frame={sp:0x7000025bfe80, fp:0x7000025bfe88} stack=[0x700002540290,0x7000025bfe90) 00007000025bfd80: 0000000000000000 0000700000000002 00007000025bfd90: 0000000000000004 000000c41ffda7ff 00007000025bfda0: 0000000000000003 00000000055423a0 00007000025bfdb0: 000000c42044c020 0000000005834070 <runtime.markroot.func1+0> 00007000025bfdc0: 000000c4202f4480 000000c420021270 00007000025bfdd0: 00007000025bfe28 000000000580c0f2 <runtime.gcDrain+306> 00007000025bfde0: 000000c420021270 0000000000000020 00007000025bfdf0: 0000000000000000 7fffffffffffffff 00007000025bfe00: 0000000000004000 00000000055423a0 00007000025bfe10: 000000c420001e00 000000c4202f4480 00007000025bfe20: 0000000000000000 00007000025bfe68 00007000025bfe30: 0000000005833f00 <runtime.gcBgMarkWorker.func2+128> 000000c420021270 00007000025bfe40: 0000000000000005 00007000025bfe68 00007000025bfe50: 000000c4202f4480 000000c420020000 00007000025bfe60: 000000c420021270 00007fffffe00000 00007000025bfe70: 0000000005835d19 <runtime.systemstack+121> 000000000581a9b0 <runtime.mstart+0> 00007000025bfe80: <0000000000000000 >0100000004500000 runtime.mstart() /usr/local/Cellar/go/1.10/libexec/src/runtime/proc.go:1170 goroutine 131 [GC worker (idle) (scan)]: runtime.systemstack_switch() /usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:363 fp=0xc42038cf48 sp=0xc42038cf40 pc=0x5835c90 runtime.gcBgMarkWorker(0xc420020000) /usr/local/Cellar/go/1.10/libexec/src/runtime/mgc.go:1829 +0x210 fp=0xc42038cfd8 sp=0xc42038cf48 pc=0x5808440 runtime: unexpected return pc for runtime.goexit called from 0xc420020000 stack: frame={sp:0xc42038cfd8, fp:0xc42038cfe0} stack=[0xc42038c800,0xc42038d000) 000000c42038ced8: 00000000043588b0 0000000000000000 000000c42038cee8: 0000000000000000 0000000000000000 000000c42038cef8: 0000000000000000 0000000000000000 000000c42038cf08: 000000c42038cf38 0000000005801228 <runtime.newobject+56> 000000c42038cf18: 0000000000000010 0000000005818056 <runtime.gopark+294> 000000c42038cf28: 00000000058661a8 000000c4204b4010 000000c42038cf38: 000000c42038cfc8 0000000005808440 <runtime.gcBgMarkWorker+528> 000000c42038cf48: 000000c42038cfb0 000000c4204b4010 000000c42038cf58: 0000000005862da2 0000000000000010 000000c42038cf68: 0000000000000014 0000000000000000 000000c42038cf78: 0000000000000000 0000000000000000 000000c42038cf88: 000000007c6a1d8f 0000000000000000 000000c42038cf98: 000000c4202f4480 000000c420021258 000000c42038cfa8: 000000c4204b4010 0000000005833e80 <runtime.gcBgMarkWorker.func2+0> 000000c42038cfb8: 000000c4202f4480 000000c420020000 000000c42038cfc8: 0000000000000000 0000000005837fc1 <runtime.goexit+1> 000000c42038cfd8: <000000c420020000 >0000000000000000 000000c42038cfe8: 0000000000000000 0000000000000000 000000c42038cff8: 0000000000000000 runtime.goexit() /usr/local/Cellar/go/1.10/libexec/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42038cfe0 sp=0xc42038cfd8 pc=0x5837fc1 created by runtime.gcBgMarkStartWorkers /usr/local/Cellar/go/1.10/libexec/src/runtime/mgc.go:1723 +0x84 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.