[windows] panic while using watch
Describe the bug panic from radovskyb/watcher and might have to patch the lib as you just start a go routine to start the watcher but thought you'd want to see the stack trace from the panic I got tonight while using watch.
fatal error: sync: unlock of unlocked mutex
goroutine 77 [running]:
runtime.throw(0x9b0e42, 0x1e)
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/panic.go:774 +0x79 fp=0xc000575b40 sp=0xc000575b10 pc=0x432119
sync.throw(0x9b0e42, 0x1e)
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/panic.go:760 +0x3c fp=0xc000575b60 sp=0xc000575b40 pc=0x43208c
sync.(*Mutex).unlockSlow(0xc0001f8828, 0xffffffff)
/usr/local/Cellar/go/1.13.7/libexec/src/sync/mutex.go:196 +0xdd fp=0xc000575b88 sp=0xc000575b60 pc=0x46f60d
sync.(*Mutex).Unlock(0xc0001f8828)
/usr/local/Cellar/go/1.13.7/libexec/src/sync/mutex.go:190 +0x4f fp=0xc000575ba8 sp=0xc000575b88 pc=0x46f51f
runtime.call32(0x0, 0x9cd3f8, 0xc000575d08, 0x800000008)
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/asm_amd64.s:539 +0x42 fp=0xc000575bd8 sp=0xc000575ba8 pc=0x45c892
panic(0x91fcc0, 0xc000203350)
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/panic.go:679 +0x1c0 fp=0xc000575c68 sp=0xc000575bd8 pc=0x431c40
runtime.panicdottypeE(...)
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/iface.go:255
runtime.panicdottypeI(0xa9f200, 0x929380, 0x922220)
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/iface.go:265 +0xfb fp=0xc000575c90 sp=0xc000575c68 pc=0x40a46b
github.com/radovskyb/watcher.(*Watcher).retrieveFileList(0xc000210200, 0x0)
/Users/timanema/workspace/go/pkg/mod/github.com/radovskyb/[email protected]/watcher.go:514 +0x6f8 fp=0xc000575e20 sp=0xc000575c90 pc=0x7a9258
github.com/radovskyb/watcher.(*Watcher).Start(0xc000210200, 0x1dcd6500, 0x0, 0xc000425320)
/Users/timanema/workspace/go/pkg/mod/github.com/radovskyb/[email protected]/watcher.go:563 +0x396 fp=0xc000575fc0 sp=0xc000575e20 pc=0x7a9626
runtime.goexit()
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc000575fc8 sp=0xc000575fc0 pc=0x45e611
created by github.com/Shopify/themekit/src/file.(*Watcher).Watch
/Users/timanema/src/github.com/Shopify/themekit/src/file/watcher.go:103 +0x78
goroutine 1 [semacquire, 9 minutes]:
sync.runtime_Semacquire(0xc000203030)
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/sema.go:56 +0x49
sync.(*WaitGroup).Wait(0xc000203028)
/usr/local/Cellar/go/1.13.7/libexec/src/sync/waitgroup.go:130 +0x6b
golang.org/x/sync/errgroup.(*Group).Wait(0xc000203020, 0xc0001fa380, 0xc00001e660)
/Users/timanema/workspace/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:40 +0x38
github.com/Shopify/themekit/src/cmdutil.forEachClient(0x9cc718, 0xc00001e660, 0x23, 0x0, 0x0, 0xc000089d60, 0x1, 0x1, 0x0, 0x0, ...)
/Users/timanema/src/github.com/Shopify/themekit/src/cmdutil/util.go:288 +0x220
github.com/Shopify/themekit/src/cmdutil.ForEachClient(...)
/Users/timanema/src/github.com/Shopify/themekit/src/cmdutil/util.go:274
github.com/Shopify/themekit/cmd.glob..func13(0xdce520, 0xc000005780, 0x0, 0x2, 0x0, 0x0)
/Users/timanema/src/github.com/Shopify/themekit/cmd/watch.go:36 +0xe6
github.com/spf13/cobra.(*Command).execute(0xdce520, 0xc000005720, 0x2, 0x2, 0xdce520, 0xc000005720)
/Users/timanema/workspace/go/pkg/mod/github.com/spf13/[email protected]/command.go:762 +0x467
github.com/spf13/cobra.(*Command).ExecuteC(0xdcd220, 0x13, 0x0, 0x0)
/Users/timanema/workspace/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2f1
github.com/spf13/cobra.(*Command).Execute(...)
/Users/timanema/workspace/go/pkg/mod/github.com/spf13/[email protected]/command.go:800
main.main()
/Users/timanema/src/github.com/Shopify/themekit/cmd/theme/main.go:29 +0x72
goroutine 39 [select]:
github.com/vbauerster/mpb.(*Progress).serve(0xc000281080, 0xc00025c820)
/Users/timanema/workspace/go/pkg/mod/github.com/vbauerster/[email protected]+incompatible/progress_windows.go:7 +0xc5
created by github.com/vbauerster/mpb.New
/Users/timanema/workspace/go/pkg/mod/github.com/vbauerster/[email protected]+incompatible/progress.go:89 +0x2cc
goroutine 18 [syscall, 9 minutes]:
os/signal.signal_recv(0x0)
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/sigqueue.go:147 +0xa3
os/signal.loop()
/usr/local/Cellar/go/1.13.7/libexec/src/os/signal/signal_unix.go:23 +0x29
created by os/signal.init.0
/usr/local/Cellar/go/1.13.7/libexec/src/os/signal/signal_unix.go:29 +0x48
goroutine 23 [select]:
github.com/Shopify/themekit/cmd.watch(0xc000364240, 0xc0004c82a0, 0xc0000960c0, 0xa9e0a0, 0xdf6050, 0x0, 0x0)
/Users/timanema/src/github.com/Shopify/themekit/cmd/watch.go:81 +0x3f4
github.com/Shopify/themekit/cmd.glob..func13.1(0xc000364240, 0x0, 0x0)
/Users/timanema/src/github.com/Shopify/themekit/cmd/watch.go:60 +0x333
github.com/Shopify/themekit/src/cmdutil.forEachClient.func1(0xc0002c3f68, 0x0)
/Users/timanema/src/github.com/Shopify/themekit/src/cmdutil/util.go:286 +0x35
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc000203020, 0xc0001fa380)
/Users/timanema/workspace/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57 +0x6b
created by golang.org/x/sync/errgroup.(*Group).Go
/Users/timanema/workspace/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:54 +0x6d
goroutine 76 [select]:
github.com/Shopify/themekit/src/file.(*Watcher).watchFsEvents(0xc00037e060)
/Users/timanema/src/github.com/Shopify/themekit/src/file/watcher.go:108 +0x122
created by github.com/Shopify/themekit/src/file.(*Watcher).Watch
/Users/timanema/src/github.com/Shopify/themekit/src/file/watcher.go:102 +0x46
goroutine 1356 [IO wait]:
internal/poll.runtime_pollWait(0x28e0dd8, 0x72, 0xa9f200)
/usr/local/Cellar/go/1.13.7/libexec/src/runtime/netpoll.go:184 +0x5c
internal/poll.(*pollDesc).wait(0xc0004a90c8, 0x72, 0xd8a500, 0x0, 0x0)
/usr/local/Cellar/go/1.13.7/libexec/src/internal/poll/fd_poll_runtime.go:87 +0x4c
internal/poll.(*ioSrv).ExecIO(0xdd2850, 0xc0004a8f18, 0x9ccb20, 0x10, 0x923, 0xa)
/usr/local/Cellar/go/1.13.7/libexec/src/internal/poll/fd_windows.go:228 +0x121
internal/poll.(*FD).Read(0xc0004a8f00, 0xc000382000, 0xed2, 0xed2, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.13.7/libexec/src/internal/poll/fd_windows.go:527 +0x31c
net.(*netFD).Read(0xc0004a8f00, 0xc000382000, 0xed2, 0xed2, 0xa8e021, 0x0, 0x92d)
/usr/local/Cellar/go/1.13.7/libexec/src/net/fd_windows.go:152 +0x56
net.(*conn).Read(0xc000206170, 0xc000382000, 0xed2, 0xed2, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.13.7/libexec/src/net/net.go:184 +0x6f
crypto/tls.(*atLeastReader).Read(0xc0004221a0, 0xc000382000, 0xed2, 0xed2, 0x963, 0xe000e0, 0xc000573970)
/usr/local/Cellar/go/1.13.7/libexec/src/crypto/tls/conn.go:780 +0x67
bytes.(*Buffer).ReadFrom(0xc0004b85d8, 0xa9de80, 0xc0004221a0, 0x40a98c, 0x923820, 0x988700)
/usr/local/Cellar/go/1.13.7/libexec/src/bytes/buffer.go:204 +0xbb
crypto/tls.(*Conn).readFromUntil(0xc0004b8380, 0x28e50c0, 0xc000206170, 0x5, 0xc000206170, 0x9)
/usr/local/Cellar/go/1.13.7/libexec/src/crypto/tls/conn.go:802 +0xf3
crypto/tls.(*Conn).readRecordOrCCS(0xc0004b8380, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.13.7/libexec/src/crypto/tls/conn.go:609 +0x12b
crypto/tls.(*Conn).readRecord(...)
/usr/local/Cellar/go/1.13.7/libexec/src/crypto/tls/conn.go:577
crypto/tls.(*Conn).Read(0xc0004b8380, 0xc00039c000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.13.7/libexec/src/crypto/tls/conn.go:1255 +0x168
bufio.(*Reader).Read(0xc0001e47e0, 0xc00011a578, 0x9, 0x9, 0xc000573d10, 0x0, 0x771cd9)
/usr/local/Cellar/go/1.13.7/libexec/src/bufio/bufio.go:226 +0x271
io.ReadAtLeast(0xa9dd20, 0xc0001e47e0, 0xc00011a578, 0x9, 0x9, 0x9, 0xc000088040, 0x0, 0xa9e020)
/usr/local/Cellar/go/1.13.7/libexec/src/io/io.go:310 +0x8e
io.ReadFull(...)
/usr/local/Cellar/go/1.13.7/libexec/src/io/io.go:329
net/http.http2readFrameHeader(0xc00011a578, 0x9, 0x9, 0xa9dd20, 0xc0001e47e0, 0x0, 0x0, 0xc000203140, 0x0)
/usr/local/Cellar/go/1.13.7/libexec/src/net/http/h2_bundle.go:1477 +0x8e
net/http.(*http2Framer).ReadFrame(0xc00011a540, 0xc000203140, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.13.7/libexec/src/net/http/h2_bundle.go:1735 +0xa8
net/http.(*http2clientConnReadLoop).run(0xc000573fb8, 0x0, 0x0)
/usr/local/Cellar/go/1.13.7/libexec/src/net/http/h2_bundle.go:8175 +0x95
net/http.(*http2ClientConn).readLoop(0xc000473980)
/usr/local/Cellar/go/1.13.7/libexec/src/net/http/h2_bundle.go:8103 +0xaa
created by net/http.(*http2Transport).newClientConn
/usr/local/Cellar/go/1.13.7/libexec/src/net/http/h2_bundle.go:7162 +0x636
To Reproduce Steps to reproduce the behavior:
- theme -e
watch - change files
- wait...
Expected behavior execpt it to watch and sync files on save
Environment (please complete the following information):
- OS [e.g. iOS]: Windows running in powershell
- Themekit version (run theme version to check): ThemeKit 1.1.6 windows/amd64
- Editor [e.g. atom, sublime]:
- Ignore:
Additional context
not sure if it will help but im going to clone radovskyb/watcher and merge this pr https://github.com/radovskyb/watcher/pull/96 and then use replace to compile theme locally and see if it helps. will report back. if it works you may want to fork watcher to a shopify repo and merge some of the outstanding PRs and use that in your go.mod for more stability as it seems the guy hasnt merged anything for 2yrs+