Skip to content
Myr

Fix yet another deadlock

Before adoption: this commit came in with the history the project adopted, so no landing records it.

EventBox.Set should not be called while holding the terminal mutex goroutine 1 [semacquire]: sync.runtime_SemacquireMutex(0xc0001923bc, 0x1000001066200, 0x1) /usr/local/Cellar/go/1.16/libexec/src/runtime/sema.go:71 +0x47 sync.(*Mutex).lockSlow(0xc0001923b8) /usr/local/Cellar/go/1.16/libexec/src/sync/mutex.go:138 +0x105 sync.(*Mutex).Lock(...) /usr/local/Cellar/go/1.16/libexec/src/sync/mutex.go:81 github.com/junegunn/fzf/src.(*Terminal).Input(0xc000192000, 0x0, 0x0, 0x0, 0x0) /fzf/src/terminal.go:581 +0x145 github.com/junegunn/fzf/src.Run.func10(0xc00010c8a0, 0xc000092050, 0xa) /fzf/src/core.go:245 +0x37 github.com/junegunn/fzf/src.Run.func11(0xc00011a4e0) /fzf/src/core.go:295 +0x5ce github.com/junegunn/fzf/src/util.(*EventBox).Wait(0xc00011a4e0, 0xc000127ec8) /fzf/src/util/eventbox.go:34 +0x5e github.com/junegunn/fzf/src.Run(0xc000180000, 0x11ac014, 0x6, 0x11ac158, 0x7) /fzf/src/core.go:251 +0xdac main.main() /fzf/main.go:13 +0x5a goroutine 11 [semacquire]: sync.runtime_SemacquireMutex(0xc00012c31c, 0xc00010e800, 0x1) /usr/local/Cellar/go/1.16/libexec/src/runtime/sema.go:71 +0x47 sync.(*Mutex).lockSlow(0xc00012c318) /usr/local/Cellar/go/1.16/libexec/src/sync/mutex.go:138 +0x105 sync.(*Mutex).Lock(0xc00012c318) /usr/local/Cellar/go/1.16/libexec/src/sync/mutex.go:81 +0x47 github.com/junegunn/fzf/src/util.(*EventBox).Set(0xc00011a4e0, 0x7, 0x114eb40, 0x1265460) /fzf/src/util/eventbox.go:40 +0x3b github.com/junegunn/fzf/src.(*Terminal).killPreview(0xc000192000, 0x0) /fzf/src/terminal.go:1831 +0xa5 github.com/junegunn/fzf/src.(*Terminal).exit(0xc000192000, 0xc000106e58) /fzf/src/terminal.go:1847 +0x75 github.com/junegunn/fzf/src.(*Terminal).Loop.func8.1(0xc00011a540) /fzf/src/terminal.go:2148 +0x38f github.com/junegunn/fzf/src/util.(*EventBox).Wait(0xc00011a540, 0xc000106f90) /fzf/src/util/eventbox.go:34 +0x5e github.com/junegunn/fzf/src.(*Terminal).Loop.func8(0xc000192000, 0xc00010a2c0) /fzf/src/terminal.go:2077 +0xa5 created by github.com/junegunn/fzf/src.(*Terminal).Loop /fzf/src/terminal.go:2072 +0x3e8

authored by Junegunn Choi · committed by Junegunn Choi · parent dfda5c0 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/terminal.go+1 added-1 removed
1842 unmodified lines
1843 if code <= exitNoMatch && t.history != nil {1844 t.history.append(string(t.input))1845 }1846 // prof.Stop()1847 t.killPreview(code)1847 t.running = false1848 t.mutex.Unlock()1849 t.killPreview(code)1850}18511852// Loop is called to start Terminal I/O1853func (t *Terminal) Loop() {
884 unmodified lines