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

cmd/compile: invalid pointer on stack calling syscall.LazyProc.Call (a go:uintptrescapes function) #38759

Closed
wxj95 opened this issue Apr 30, 2020 · 4 comments

Comments

@wxj95
Copy link

@wxj95 wxj95 commented Apr 30, 2020

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

$ go version
go version go1.14.1 windows/amd64

What did you do?

This is my source code:

func DeleteZip(filePath string) {
	time.Sleep(10 * time.Second) 
	_, err := os.Stat(filePath)
	if err != nil {
		if os.IsNotExist(err) {
			mlog.Log.Error(fmt.Sprintf("[deleteZip] file does not exist,%s", filePath))
			return
		} else {
			mlog.Log.Error(fmt.Sprintf("[deleteZip] os stat err,%s", err.Error()))
			return
		}
	}
	err = os.Remove(filePath)
	if err != nil {
		mlog.Log.Error(fmt.Sprintf("[deleteZip] os Remove err,%s", err.Error()))
		return
	}
	
	mlog.Log.Info(fmt.Sprintf("[deleteZip] delete success,%s", filePath))
	return
}

And the call func is :

func (Instance) Down(idList []int) (filePath string , err error) {
	defer func() { 
		go util.DeleteZip(filepath)
	}()
        ....

the log is use github.com/sirupsen/logrus

package mlog

import (
	"editor4gitbook/setting"
	"github.com/sirupsen/logrus"
)

var Log = logrus.New()

func InitLog() {
	Log.AddHook(newLfsHook(365, setting.LogInfoPath, setting.LogErrorPath))
}

What did you expect to see?

print mlog.Log.Info or mlog.Log.Error

What did you see instead?

But it occur panic

runtime: bad pointer in frame github.com/konsorten/go-windows-terminal-sequences.EnableVirtualTerminalProcessing at 0xc000787740: 0x130
fatal error: invalid pointer found on stack

runtime stack:
runtime.throw(0x149c11a, 0x1e)
        C:/Go/src/runtime/panic.go:1114 +0x79 fp=0x2d0ff728 sp=0x2d0ff6f8 pc=0x437889
runtime.adjustpointers(0xc000787740, 0x2d0ff828, 0x2d0ffbb8, 0x1848ca8, 0xf7c760)
        C:/Go/src/runtime/stack.go:599 +0x22e fp=0x2d0ff788 sp=0x2d0ff728 pc=0x44ceee
runtime.adjustframe(0x2d0ffac8, 0x2d0ffbb8, 0xf7c760)
        C:/Go/src/runtime/stack.go:641 +0x355 fp=0x2d0ff858 sp=0x2d0ff788 pc=0x44d255
runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc000059800, 0x0, 0x0, 0x7fffffff, 0x14deae8, 0x2d0ffbb8, 0x0, ...)
        C:/Go/src/runtime/traceback.go:334 +0x111c fp=0x2d0ffb30 sp=0x2d0ff858 pc=0x45988c
runtime.copystack(0xc000059800, 0x4000)
        C:/Go/src/runtime/stack.go:888 +0x298 fp=0x2d0ffce8 sp=0x2d0ffb30 pc=0x44d978
runtime.newstack()
        C:/Go/src/runtime/stack.go:1043 +0x219 fp=0x2d0ffe78 sp=0x2d0ffce8 pc=0x44dc49
runtime.morestack()
        C:/Go/src/runtime/asm_amd64.s:449 +0x97 fp=0x2d0ffe80 sp=0x2d0ffe78 pc=0x462ea7

goroutine 12 [copystack]:
runtime.rawstringtmp(0xc000787470, 0xd, 0x730413430696e75, 0x731413430696e75, 0x732413430696e75, 0x733413430696e75, 0x734413430696e75)
        C:/Go/src/runtime/string.go:118 +0xa8 fp=0xc000787360 sp=0xc000787358 pc=0x44fa38
runtime.concatstrings(0xc0000bf470, 0xc000787440, 0x2, 0x2, 0x0, 0x736423430696e75)
        C:/Go/src/runtime/string.go:49 +0xb5 fp=0xc0007873f8 sp=0xc000787360 pc=0x44f465
runtime.concatstring2(0xc0000bf470, 0x148546d, 0xc, 0x1479128, 0x1, 0xc0000bf4a8, 0x416856)
        C:/Go/src/runtime/string.go:58 +0x4e fp=0xc000787438 sp=0xc0007873f8 pc=0x44f6ee
syscall.UTF16FromString(0x148546d, 0xc, 0x419b49, 0x2be31200, 0x203000100000000, 0x2be4ffff, 0x2cc32db8)
        C:/Go/src/syscall/syscall_windows.go:45 +0xcc fp=0xc000787520 sp=0xc000787438 pc=0x4b49dc
syscall.UTF16PtrFromString(...)
        C:/Go/src/syscall/syscall_windows.go:91
syscall.LoadDLL(0x148546d, 0xc, 0xc0000bf618, 0x441743, 0xc000059800)
        C:/Go/src/syscall/dll_windows.go:69 +0x54 fp=0xc0007875d8 sp=0xc000787520 pc=0x4b1f14
syscall.(*LazyDLL).Load(0xc000096700, 0x0, 0x0)
        C:/Go/src/syscall/dll_windows.go:236 +0xc7 fp=0xc000787628 sp=0xc0007875d8 pc=0x4b3d27
syscall.(*LazyProc).Find(0xc0000a6c30, 0x0, 0x0)
        C:/Go/src/syscall/dll_windows.go:291 +0xbe fp=0xc000787680 sp=0xc000787628 pc=0x4b401e
syscall.(*LazyProc).mustFind(0xc0000a6c30)
        C:/Go/src/syscall/dll_windows.go:309 +0x32 fp=0xc0007876a8 sp=0xc000787680 pc=0x4b4142
syscall.(*LazyProc).Call(0xc0000a6c30, 0xc0000a03e0, 0x2, 0x2, 0x0, 0x1, 0x0, 0x0)
        C:/Go/src/syscall/dll_windows.go:327 +0x36 fp=0xc0007876f8 sp=0xc0007876a8 pc=0x4b4216
github.com/konsorten/go-windows-terminal-sequences.EnableVirtualTerminalProcessing(0x130, 0x1, 0x0, 0x30000000c)
        D:/go/pkg/mod/github.com/konsorten/go-windows-terminal-sequences@v1.0.1/sequences.go:30 +0xcb fp=0xc000787758 sp=0xc0007876f8 pc=0x56f16b
github.com/sirupsen/logrus.initTerminal(0x1640ca0, 0xc0000ca010)
        D:/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/terminal_windows.go:16 +0x64 fp=0xc000787788 sp=0xc000787758 pc=0x575864
github.com/sirupsen/logrus.(*TextFormatter).init(0xc000387950, 0xc0007883c0)
        D:/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/text_formatter.go:87 +0x7e fp=0xc0007877b0 sp=0xc000787788 pc=0x57598e
github.com/sirupsen/logrus.(*TextFormatter).Format.func1()
        D:/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/text_formatter.go:156 +0x3a fp=0xc0007877d0 sp=0xc0007877b0 pc=0x578d7a
sync.(*Once).doSlow(0xc000387988, 0xc0000bf9a8)
        C:/Go/src/sync/once.go:66 +0xf3 fp=0xc000787820 sp=0xc0007877d0 pc=0x481b73
sync.(*Once).Do(...)
        C:/Go/src/sync/once.go:57
github.com/sirupsen/logrus.(*TextFormatter).Format(0xc000387950, 0xc0007883c0, 0x441, 0x1b6, 0xc000802018, 0x0, 0x0)
        D:/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/text_formatter.go:156 +0xe44 fp=0xc000787bd0 sp=0xc000787820 pc=0x5768f4
github.com/rifflock/lfshook.(*LfsHook).fileWrite(0xc000163ce0, 0xc0007883c0, 0x0, 0x0)
        D:/go/pkg/mod/github.com/rifflock/lfshook@v0.0.0-20180920164130-b9218ef580f5/lfshook.go:181 +0x244 fp=0xc000787ca8 sp=0xc000787bd0 pc=0x5855f4
github.com/rifflock/lfshook.(*LfsHook).Fire(0xc000163ce0, 0xc0007883c0, 0x0, 0x0)
        D:/go/pkg/mod/github.com/rifflock/lfshook@v0.0.0-20180920164130-b9218ef580f5/lfshook.go:118 +0xe0 fp=0xc000787cf0 sp=0xc000787ca8 pc=0x585150
github.com/sirupsen/logrus.LevelHooks.Fire(0xc0000a6db0, 0x4, 0xc0007883c0, 0x1b07b0, 0x0)
        D:/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/hooks.go:28 +0x98 fp=0xc000787d38 sp=0xc000787cf0 pc=0x572ba8
github.com/sirupsen/logrus.(*Entry).fireHooks(0xc0007883c0)
        D:/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/entry.go:223 +0x85 fp=0xc000787dc0 sp=0xc000787d38 pc=0x570635
github.com/sirupsen/logrus.Entry.log(0xc0000e6770, 0xc0000a6bd0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        D:/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/entry.go:201 +0x11b fp=0xc000787e38 sp=0xc000787dc0 pc=0x5703ab
github.com/sirupsen/logrus.(*Entry).Info(0xc000788360, 0xc0000bffb0, 0x1, 0x1)
        D:/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/entry.go:261 +0xe0 fp=0xc000787f20 sp=0xc000787e38 pc=0x570c60
github.com/sirupsen/logrus.(*Logger).Info(0xc0000e6770, 0xc0000bffb0, 0x1, 0x1)
        D:/go/pkg/mod/github.com/sirupsen/logrus@v1.2.0/logger.go:224 +0x79 fp=0xc000787f58 sp=0xc000787f20 pc=0x574059
editor4gitbook/pkg/util.DeleteZip(0xc000031010, 0xf)
        D:/go/src/GreatAgain-Back/pkg/util/basic_func.go:245 +0x448 fp=0xc000787fd0 sp=0xc000787f58 pc=0x77e7c8
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000787fd8 sp=0xc000787fd0 pc=0x464f41
created by editor4gitbook/models/minternalwebdisk.Instance.InternalWebDiskDown.func1
        D:/go/src/GreatAgain-Back/models/minternalwebdisk/outer.go:685 +0x52

goroutine 1 [IO wait]:
runtime.gopark(0x14ded30, 0x3f30e50, 0xc0000c1b02, 0x5)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0003573b0 sp=0xc000357390 pc=0x43a325
runtime.netpollblock(0x3f30e28, 0x72, 0xc0006fd3b0)
        C:/Go/src/runtime/netpoll.go:419 +0xa1 fp=0xc0003573e8 sp=0xc0003573b0 pc=0x431271
internal/poll.runtime_pollWait(0x3f30e28, 0x72, 0x1641e20)
        C:/Go/src/runtime/netpoll.go:203 +0x5c fp=0xc000357410 sp=0xc0003573e8 pc=0x43076c
internal/poll.(*pollDesc).wait(0xc0000cce48, 0x72, 0xf6c500, 0x0, 0x0)
        C:/Go/src/internal/poll/fd_poll_runtime.go:87 +0x4c fp=0xc000357440 sp=0xc000357410 pc=0x4d946c
internal/poll.(*ioSrv).ExecIO(0x1dfc930, 0xc0000ccc98, 0xc0006e8640, 0x1, 0x0, 0x2b0)
        C:/Go/src/internal/poll/fd_windows.go:228 +0x121 fp=0xc0003574c8 sp=0xc000357440 pc=0x4da7f1
internal/poll.(*FD).acceptOne(0xc0000ccc80, 0x2b0, 0xc0006fd3b0, 0x2, 0x2, 0xc0000ccc98, 0x98000004, 0xc0003576bc, 0xc, 0x0)
        C:/Go/src/internal/poll/fd_windows.go:896 +0xa9 fp=0xc000357518 sp=0xc0003574c8 pc=0x4de149
internal/poll.(*FD).Accept(0xc0000ccc80, 0xc0003576c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        C:/Go/src/internal/poll/fd_windows.go:930 +0x15f fp=0xc0003575a8 sp=0xc000357518 pc=0x4de3ff
net.(*netFD).accept(0xc0000ccc80, 0x3e8bb90f44bf8f01, 0xc000386050, 0x3e8bb90f44bf8f96)
        C:/Go/src/net/fd_windows.go:193 +0x7b fp=0xc0003576e0 sp=0xc0003575a8 pc=0x5954fb
net.(*TCPListener).accept(0xc0006e85a0, 0xc000136140, 0xc000386098, 0x4cf2bd)
        C:/Go/src/net/tcpsock_posix.go:139 +0x39 fp=0xc000357720 sp=0xc0003576e0 pc=0x5af1f9
net.(*TCPListener).Accept(0xc0006e85a0, 0xc0003577a8, 0x18, 0xc000058000, 0x740de3)
        C:/Go/src/net/tcpsock.go:261 +0x6b fp=0xc000357760 sp=0xc000357720 pc=0x5adf8b
net/http.(*onceCloseListener).Accept(0xc000076a50, 0x14de760, 0xc000136140, 0x1658540, 0xc000076b10)
        <autogenerated>:1 +0x43 fp=0xc000357798 sp=0xc000357760 pc=0x766153
net/http.(*Server).Serve(0xc000672000, 0x1654240, 0xc0006e85a0, 0x0, 0x0)
        C:/Go/src/net/http/server.go:2901 +0x264 fp=0xc0003578a8 sp=0xc000357798 pc=0x740ce4
net/http.(*Server).ListenAndServe(0xc000672000, 0xc000672000, 0xc000357938)
        C:/Go/src/net/http/server.go:2830 +0xbe fp=0xc0003578f8 sp=0xc0003578a8 pc=0x740a2e
net/http.ListenAndServe(...)
        C:/Go/src/net/http/server.go:3086
github.com/gin-gonic/gin.(*Engine).Run(0xc00009cf00, 0xc000357ea8, 0x1, 0x1, 0x0, 0x0)
        D:/go/pkg/mod/github.com/gin-gonic/gin@v1.5.0/gin.go:295 +0x154 fp=0xc000357968 sp=0xc0003578f8 pc=0xaf32d4
main.main()
        D:/go/src/GreatAgain-Back/main.go:394 +0x9426 fp=0xc000357f88 sp=0xc000357968 pc=0xeb3666
runtime.main()
        C:/Go/src/runtime/proc.go:203 +0x212 fp=0xc000357fe0 sp=0xc000357f88 pc=0x439f52
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000357fe8 sp=0xc000357fe0 pc=0x464f41

goroutine 2 [force gc (idle)]:
runtime.gopark(0x14ded60, 0x1e00520, 0x1411, 0x1)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc00005bfb0 sp=0xc00005bf90 pc=0x43a325
runtime.goparkunlock(...)
        C:/Go/src/runtime/proc.go:310
runtime.forcegchelper()
        C:/Go/src/runtime/proc.go:253 +0xc5 fp=0xc00005bfe0 sp=0xc00005bfb0 pc=0x43a1c5
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00005bfe8 sp=0xc00005bfe0 pc=0x464f41
created by runtime.init.6
        C:/Go/src/runtime/proc.go:242 +0x3c

goroutine 3 [GC sweep wait]:
runtime.gopark(0x14ded60, 0x1e006c0, 0x140c, 0x1)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc00005dfa8 sp=0xc00005df88 pc=0x43a325
runtime.goparkunlock(...)
        C:/Go/src/runtime/proc.go:310
runtime.bgsweep(0xc00002e070)
        C:/Go/src/runtime/mgcsweep.go:89 +0x13f fp=0xc00005dfd8 sp=0xc00005dfa8 pc=0x424d9f
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00005dfe0 sp=0xc00005dfd8 pc=0x464f41
created by runtime.gcenable
        C:/Go/src/runtime/mgc.go:214 +0x63

goroutine 4 [sleep]:
runtime.gopark(0x14ded60, 0x1e00680, 0x1313, 0x2)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc00006bf28 sp=0xc00006bf08 pc=0x43a325
runtime.goparkunlock(...)
        C:/Go/src/runtime/proc.go:310
runtime.scavengeSleep(0x8000000000000000, 0x0)
        C:/Go/src/runtime/mgcscavenge.go:214 +0xc6 fp=0xc00006bf78 sp=0xc00006bf28 pc=0x4231a6
runtime.bgscavenge(0xc00002e070)
        C:/Go/src/runtime/mgcscavenge.go:315 +0x193 fp=0xc00006bfd8 sp=0xc00006bf78 pc=0x423363
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00006bfe0 sp=0xc00006bfd8 pc=0x464f41
created by runtime.gcenable
        C:/Go/src/runtime/mgc.go:215 +0x85

goroutine 18 [finalizer wait]:
runtime.gopark(0x14ded60, 0x1e2ed58, 0x100081410, 0x1)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc00005ff58 sp=0xc00005ff38 pc=0x43a325
runtime.goparkunlock(...)
        C:/Go/src/runtime/proc.go:310
runtime.runfinq()
        C:/Go/src/runtime/mfinal.go:175 +0xb1 fp=0xc00005ffe0 sp=0xc00005ff58 pc=0x41a671
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00005ffe8 sp=0xc00005ffe0 pc=0x464f41
created by runtime.createfing
        C:/Go/src/runtime/mfinal.go:156 +0x68

goroutine 19 [chan receive]:
runtime.gopark(0x14deb58, 0xc000087bb8, 0xc00003170e, 0x2)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc000067e80 sp=0xc000067e60 pc=0x43a325
runtime.chanrecv(0xc000087b60, 0xc000067f77, 0x1, 0x0)
        C:/Go/src/runtime/chan.go:525 +0x2f5 fp=0xc000067f10 sp=0xc000067e80 pc=0x407575
runtime.chanrecv2(0xc000087b60, 0xc000067f77, 0x2)
        C:/Go/src/runtime/chan.go:412 +0x2b fp=0xc000067f40 sp=0xc000067f10 pc=0x40726b
github.com/xormplus/xorm.unique()
        D:/go/pkg/mod/github.com/xormplus/xorm@v0.0.0-20190926190243-42377f593eb1/uuid.go:144 +0xcb fp=0xc000067fe0 sp=0xc000067f40 pc=0x9cf4db
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000067fe8 sp=0xc000067fe0 pc=0x464f41
created by github.com/xormplus/xorm.init.1
        D:/go/pkg/mod/github.com/xormplus/xorm@v0.0.0-20190926190243-42377f593eb1/uuid.go:107 +0x125

goroutine 34 [chan receive]:
runtime.gopark(0x14deb58, 0xc000038178, 0x477a1e59d170e, 0x2)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc000069e88 sp=0xc000069e68 pc=0x43a325
runtime.chanrecv(0xc000038120, 0xc000069f98, 0xc000070001, 0xc000038120)
        C:/Go/src/runtime/chan.go:525 +0x2f5 fp=0xc000069f18 sp=0xc000069e88 pc=0x407575
runtime.chanrecv2(0xc000038120, 0xc000069f98, 0x1)
        C:/Go/src/runtime/chan.go:412 +0x2b fp=0xc000069f48 sp=0xc000069f18 pc=0x40726b
github.com/go-redis/redis/v7/internal/pool.(*ConnPool).reaper(0xc0002b6000, 0xdf8475800)
        D:/go/pkg/mod/github.com/go-redis/redis/v7@v7.0.0-beta.4/internal/pool/pool.go:440 +0x94 fp=0xc000069fd0 sp=0xc000069f48 pc=0xb173d4
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000069fd8 sp=0xc000069fd0 pc=0x464f41
created by github.com/go-redis/redis/v7/internal/pool.NewConnPool
        D:/go/pkg/mod/github.com/go-redis/redis/v7@v7.0.0-beta.4/internal/pool/pool.go:98 +0x1a0

goroutine 35 [select]:
runtime.gopark(0x14dedb0, 0x0, 0x1809, 0x1)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0002e9e10 sp=0xc0002e9df0 pc=0x43a325
runtime.selectgo(0xc0002e9f68, 0xc0002e9f60, 0x2, 0x0, 0x0)
        C:/Go/src/runtime/select.go:316 +0xc88 fp=0xc0002e9f38 sp=0xc0002e9e10 pc=0x4487c8
database/sql.(*DB).connectionOpener(0xc0002b0180, 0x1658480, 0xc0002563c0)
        C:/Go/src/database/sql/sql.go:1052 +0xef fp=0xc0002e9fc8 sp=0xc0002e9f38 pc=0x7bf86f
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0002e9fd0 sp=0xc0002e9fc8 pc=0x464f41
created by database/sql.OpenDB
        C:/Go/src/database/sql/sql.go:722 +0x164

goroutine 36 [select]:
runtime.gopark(0x14dedb0, 0x0, 0x1809, 0x1)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0002ebdf8 sp=0xc0002ebdd8 pc=0x43a325
runtime.selectgo(0xc0002ebf68, 0xc0002ebf48, 0x2, 0x1, 0x1)
        C:/Go/src/runtime/select.go:316 +0xc88 fp=0xc0002ebf20 sp=0xc0002ebdf8 pc=0x4487c8
database/sql.(*DB).connectionResetter(0xc0002b0180, 0x1658480, 0xc0002563c0)
        C:/Go/src/database/sql/sql.go:1065 +0x102 fp=0xc0002ebfc8 sp=0xc0002ebf20 pc=0x7bf9a2
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0002ebfd0 sp=0xc0002ebfc8 pc=0x464f41
created by database/sql.OpenDB
        C:/Go/src/database/sql/sql.go:723 +0x19a

goroutine 5 [chan receive]:
runtime.gopark(0x14deb58, 0xc0000d5a38, 0x477a1e608170e, 0x2)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0002e5e88 sp=0xc0002e5e68 pc=0x43a325
runtime.chanrecv(0xc0000d59e0, 0xc0002e5f98, 0xc0000cf601, 0xc0000d59e0)
        C:/Go/src/runtime/chan.go:525 +0x2f5 fp=0xc0002e5f18 sp=0xc0002e5e88 pc=0x407575
runtime.chanrecv2(0xc0000d59e0, 0xc0002e5f98, 0x1000000010000)
        C:/Go/src/runtime/chan.go:412 +0x2b fp=0xc0002e5f48 sp=0xc0002e5f18 pc=0x40726b
github.com/go-redis/redis/v7/internal/pool.(*ConnPool).reaper(0xc000300000, 0xdf8475800)
        D:/go/pkg/mod/github.com/go-redis/redis/v7@v7.0.0-beta.4/internal/pool/pool.go:440 +0x94 fp=0xc0002e5fd0 sp=0xc0002e5f48 pc=0xb173d4
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0002e5fd8 sp=0xc0002e5fd0 pc=0x464f41
created by github.com/go-redis/redis/v7/internal/pool.NewConnPool
        D:/go/pkg/mod/github.com/go-redis/redis/v7@v7.0.0-beta.4/internal/pool/pool.go:98 +0x1a0

goroutine 38 [select]:
runtime.gopark(0x14dedb0, 0x0, 0x1809, 0x1)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0002e7d68 sp=0xc0002e7d48 pc=0x43a325
runtime.selectgo(0xc0002e7ef0, 0xc0002e7ec4, 0x2, 0x0, 0x0)
        C:/Go/src/runtime/select.go:316 +0xc88 fp=0xc0002e7e90 sp=0xc0002e7d68 pc=0x4487c8
github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1(0xc0000c6540, 0xc0002b0240, 0xc0002b2300)
        D:/go/pkg/mod/github.com/go-sql-driver/mysql@v1.4.1/connection_go18.go:178 +0xc6 fp=0xc0002e7fc8 sp=0xc0002e7e90 pc=0xc79dc6
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0002e7fd0 sp=0xc0002e7fc8 pc=0x464f41
created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher
        D:/go/pkg/mod/github.com/go-sql-driver/mysql@v1.4.1/connection_go18.go:175 +0xc5

goroutine 6 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc0000301e0, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc00006df60 sp=0xc00006df40 pc=0x43a325
runtime.gcBgMarkWorker(0xc00003a000)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc00006dfd8 sp=0xc00006df60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00006dfe0 sp=0xc00006dfd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 7 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000273ac0, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc00043bf60 sp=0xc00043bf40 pc=0x43a325
runtime.gcBgMarkWorker(0xc00003c800)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc00043bfd8 sp=0xc00043bf60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00043bfe0 sp=0xc00043bfd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 21 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc0000301f0, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc000437f60 sp=0xc000437f40 pc=0x43a325
runtime.gcBgMarkWorker(0xc00003f000)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc000437fd8 sp=0xc000437f60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000437fe0 sp=0xc000437fd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 50 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000273ad0, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0004a7f60 sp=0xc0004a7f40 pc=0x43a325
runtime.gcBgMarkWorker(0xc000041800)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc0004a7fd8 sp=0xc0004a7f60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0004a7fe0 sp=0xc0004a7fd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 22 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000273ae0, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc000439f60 sp=0xc000439f40 pc=0x43a325
runtime.gcBgMarkWorker(0xc000044000)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc000439fd8 sp=0xc000439f60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000439fe0 sp=0xc000439fd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 23 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000273af0, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0004a3f60 sp=0xc0004a3f40 pc=0x43a325
runtime.gcBgMarkWorker(0xc000046800)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc0004a3fd8 sp=0xc0004a3f60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0004a3fe0 sp=0xc0004a3fd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 39 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000252300, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0002f3f60 sp=0xc0002f3f40 pc=0x43a325
runtime.gcBgMarkWorker(0xc000049000)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc0002f3fd8 sp=0xc0002f3f60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0002f3fe0 sp=0xc0002f3fd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 40 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000252310, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0002f5f60 sp=0xc0002f5f40 pc=0x43a325
runtime.gcBgMarkWorker(0xc00004b800)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc0002f5fd8 sp=0xc0002f5f60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0002f5fe0 sp=0xc0002f5fd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 41 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000252320, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0002eff60 sp=0xc0002eff40 pc=0x43a325
runtime.gcBgMarkWorker(0xc00004e000)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc0002effd8 sp=0xc0002eff60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0002effe0 sp=0xc0002effd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 24 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000273b00, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0004a5f60 sp=0xc0004a5f40 pc=0x43a325
runtime.gcBgMarkWorker(0xc000050800)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc0004a5fd8 sp=0xc0004a5f60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0004a5fe0 sp=0xc0004a5fd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 25 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000273b10, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc000507f60 sp=0xc000507f40 pc=0x43a325
runtime.gcBgMarkWorker(0xc000053000)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc000507fd8 sp=0xc000507f60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000507fe0 sp=0xc000507fd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 26 [GC worker (idle)]:
runtime.gopark(0x14debe0, 0xc000252330, 0x1418, 0x0)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc000509f60 sp=0xc000509f40 pc=0x43a325
runtime.gcBgMarkWorker(0xc000055800)
        C:/Go/src/runtime/mgc.go:1865 +0x114 fp=0xc000509fd8 sp=0xc000509f60 pc=0x41e114
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000509fe0 sp=0xc000509fd8 pc=0x464f41
created by runtime.gcBgMarkStartWorkers
        C:/Go/src/runtime/mgc.go:1813 +0x7e

goroutine 9 [select]:
runtime.gopark(0x14dedb0, 0x0, 0x1809, 0x1)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc000503cf8 sp=0xc000503cd8 pc=0x43a325
runtime.selectgo(0xc000503f28, 0xc000503e90, 0x4, 0x24754c38, 0xed63c3d8e)
        C:/Go/src/runtime/select.go:316 +0xc88 fp=0xc000503e20 sp=0xc000503cf8 pc=0x4487c8
github.com/robfig/cron.(*Cron).run(0xc0003879f0)
        D:/go/pkg/mod/github.com/robfig/cron@v1.2.0/cron.go:191 +0x2b4 fp=0xc000503fd8 sp=0xc000503e20 pc=0xcbeae4
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000503fe0 sp=0xc000503fd8 pc=0x464f41
created by github.com/robfig/cron.(*Cron).Start
        D:/go/pkg/mod/github.com/robfig/cron@v1.2.0/cron.go:144 +0x5a

goroutine 28 [select]:
runtime.gopark(0x14dedb0, 0x0, 0x1809, 0x1)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc00043dc58 sp=0xc00043dc38 pc=0x43a325
runtime.selectgo(0xc00043df00, 0xc00043de04, 0x5, 0x25e28838, 0xed63c3d8e)
        C:/Go/src/runtime/select.go:316 +0xc88 fp=0xc00043dd80 sp=0xc00043dc58 pc=0x4487c8
github.com/robfig/cron/v3.(*Cron).run(0xc0002ac460)
        D:/go/pkg/mod/github.com/robfig/cron/v3@v3.0.0/cron.go:258 +0x548 fp=0xc00043dfd8 sp=0xc00043dd80 pc=0x78dfc8
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00043dfe0 sp=0xc00043dfd8 pc=0x464f41
created by github.com/robfig/cron/v3.(*Cron).Start
        D:/go/pkg/mod/github.com/robfig/cron/v3@v3.0.0/cron.go:217 +0xab

goroutine 10 [IO wait]:
runtime.gopark(0x14ded30, 0x3f30d70, 0xc0000c1b02, 0x5)
        C:/Go/src/runtime/proc.go:304 +0xf5 fp=0xc0003535b8 sp=0xc000353598 pc=0x43a325
runtime.netpollblock(0x3f30d48, 0x72, 0x4400000001)
        C:/Go/src/runtime/netpoll.go:419 +0xa1 fp=0xc0003535f0 sp=0xc0003535b8 pc=0x431271
internal/poll.runtime_pollWait(0x3f30d48, 0x72, 0x1641e20)
        C:/Go/src/runtime/netpoll.go:203 +0x5c fp=0xc000353618 sp=0xc0003535f0 pc=0x43076c
internal/poll.(*pollDesc).wait(0xc0000cd0c8, 0x72, 0xf6c500, 0x0, 0x0)
        C:/Go/src/internal/poll/fd_poll_runtime.go:87 +0x4c fp=0xc000353648 sp=0xc000353618 pc=0x4d946c
internal/poll.(*ioSrv).ExecIO(0x1dfc930, 0xc0000ccf18, 0x14de518, 0xc000353780, 0x4dce44, 0xc0000cc280)
        C:/Go/src/internal/poll/fd_windows.go:228 +0x121 fp=0xc0003536d0 sp=0xc000353648 pc=0x4da7f1
internal/poll.(*FD).Read(0xc0000ccf00, 0xc0002af000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        C:/Go/src/internal/poll/fd_windows.go:527 +0x2fc fp=0xc000353750 sp=0xc0003536d0 pc=0x4dbdac
net.(*netFD).Read(0xc0000ccf00, 0xc0002af000, 0x1000, 0x1000, 0x4ece18, 0x12568e0, 0x1443280)
        C:/Go/src/net/fd_windows.go:152 +0x56 fp=0xc0003537b0 sp=0xc000353750 pc=0x594f86
net.(*conn).Read(0xc000006b48, 0xc0002af000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        C:/Go/src/net/net.go:184 +0x95 fp=0xc000353810 sp=0xc0003537b0 pc=0x5a78d5
net/http.(*connReader).Read(0xc000076c00, 0xc0002af000, 0x1000, 0x1000, 0x1a2, 0x0, 0x5)
        C:/Go/src/net/http/server.go:786 +0xfb fp=0xc000353870 sp=0xc000353810 pc=0x73674b
bufio.(*Reader).fill(0xc000038480)
        C:/Go/src/bufio/bufio.go:100 +0x10a fp=0xc0003538c0 sp=0xc000353870 pc=0x53421a
bufio.(*Reader).ReadSlice(0xc000038480, 0xa, 0x1640ca0, 0xc0003539c0, 0x40dd80, 0xc0000f2700, 0x100)
        C:/Go/src/bufio/bufio.go:359 +0x44 fp=0xc000353908 sp=0xc0003538c0 pc=0x534f44
bufio.(*Reader).ReadLine(0xc000038480, 0xc0003539c8, 0x1e01ec0, 0x1b0108, 0x0, 0x0, 0xc)
        C:/Go/src/bufio/bufio.go:388 +0x3b fp=0xc000353978 sp=0xc000353908 pc=0x53518b
net/textproto.(*Reader).readLineSlice(0xc000076c60, 0xc0000f2700, 0x0, 0x43a3e3, 0xc000353a28, 0x0)
        C:/Go/src/net/textproto/reader.go:58 +0x73 fp=0xc000353a00 sp=0xc000353978 pc=0x5bba83
net/textproto.(*Reader).ReadLine(...)
        C:/Go/src/net/textproto/reader.go:39
net/http.readRequest(0xc000038480, 0x0, 0xc0000f2700, 0x0, 0x0)
        C:/Go/src/net/http/request.go:1015 +0xab fp=0xc000353ac0 sp=0xc000353a00 pc=0x730d5b
net/http.(*conn).readRequest(0xc000136140, 0x1658480, 0xc00006fe40, 0x0, 0x0, 0x0)
        C:/Go/src/net/http/server.go:966 +0x198 fp=0xc000353c18 sp=0xc000353ac0 pc=0x737ab8
net/http.(*conn).serve(0xc000136140, 0x1658480, 0xc00006fe40)
        C:/Go/src/net/http/server.go:1822 +0x6db fp=0xc000353fc8 sp=0xc000353c18 pc=0x73c04b
runtime.goexit()
        C:/Go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000353fd0 sp=0xc000353fc8 pc=0x464f41
created by net/http.(*Server).Serve
        C:/Go/src/net/http/server.go:2933 +0x363

And the call func is :

func (Instance) Down(idList []int) (filePath string , err error) {
	defer func() { 
	    util.DeleteZip(filepath)  // not go
	}()
        ....

Or before mlog.Log.Info.... Add fmt.Println(mlog.Log) Like this:

....
fmt.Println(mlog.Log)
mlog.Log.Info(fmt.Sprintf("[deleteZip] delete success,%s", filePath))

It will not occur panic

@ianlancetaylor ianlancetaylor changed the title fatal error: invalid pointer found on stack cmd/compile: invalid pointer on stack calling syscall.LazyProc.Call (a go:uintptrescapes function) Apr 30, 2020
@ianlancetaylor ianlancetaylor added this to the Go1.15 milestone Apr 30, 2020
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 30, 2020

We're growing the stack while the stack holds a call to a go:uintptrescapes function: syscall.LazyProc.Call. I don't know if that is the problem but it seems worth taking a look.

CC @mdempsky

@randall77
Copy link
Contributor

@randall77 randall77 commented Apr 30, 2020

This bug was reported against github.com/konsorten/go-windows-terminal-sequences as https://github.com/konsorten/go-windows-terminal-sequences/issues/4, which was fixed with this commit: konsorten/go-windows-terminal-sequences@71a52a1

Does that fix work for you?

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Apr 30, 2020

It looks like the error is that package incorrectly converted a syscall.Handle (an integer value) to unsafe.Pointer? I think -d=checkptr should have been able to catch that.

@wxj95 I'd be interested to know if you try building your program with -race or -gcflags=all=-d=checkptr, if it triggers any checkptr errors when you run it. (You can use these flags with either go build or go test.)

Edit: I just realized this is on Windows, and due to standard library issues, we didn't automatically enable -d=checkptr with -race in Go 1.14. It will be enabled for Go 1.15 though.

@wxj95
Copy link
Author

@wxj95 wxj95 commented Apr 30, 2020

Thx for your kind help!

I see the @randall77 's response,and I upgrade github.com/sirupsen/logrus to v1.5.0.

And this problem is solved!

Thx for everyone!

@wxj95 wxj95 closed this Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.