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

Sometimes peco freezes. #532

Open
pocari opened this issue Mar 29, 2022 · 4 comments
Open

Sometimes peco freezes. #532

pocari opened this issue Mar 29, 2022 · 4 comments

Comments

@pocari
Copy link

pocari commented Mar 29, 2022

What is the peco version, OS, architecture?

% peco --version
peco version v0.5.1
% cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
MOZART [~/dev/tmp/20220329/peco-freeze]
% uname -m
x86_64
% zsh --version
zsh 5.8 (x86_64-ubuntu-linux-gnu)
% tmux -V
tmux 3.0a

Abstract

It sometimes freezes when I run peco via a command created in zsh, it won't accept Ctr-C, etc.

Reproduction

I am running peco via Ctr-s as follows.
(I put ">& out" which I don't usually set to get a stack trace)

function peco-select-shortcut(){
    LBUFFER+=$( \
      cat ~/dotfiles/pecommand.txt | \
      grep -v -e '^\s*#' -e '^$' | \
      peco --prompt "commands>" >& out | \
      sed -e 's/#.*$//' \
    )
    CURSOR=$#LBUFFER
    zle reset-prompt
}

zle -N peco-select-shortcut
bindkey '^s' peco-select-shortcut
% cat ~/dotfiles/pecommand.txt
ls

When I run the above registered Ctr-s many times, it sometimes freezes completely.

スクリーンショット 2022-03-29 17 18 31

The log of kill -ABRT pid at that time is as follows.

SIGABRT: abort
PC=0x4544b3 m=1 sigcode=0

goroutine 0 [idle]:
runtime.futex(0x6a89d8, 0x0, 0xc42003dec0, 0x0, 0xc400000000, 0x454146, 0x3c, 0x0, 0xc42003df08, 0x40d810, ...)
        /usr/lib/go-1.8/src/runtime/sys_linux_amd64.s:426 +0x23
runtime.futexsleep(0x6a89d8, 0x0, 0xdf8475800)
        /usr/lib/go-1.8/src/runtime/os_linux.go:62 +0xd7
runtime.notetsleep_internal(0x6a89d8, 0xdf8475800, 0x0)
        /usr/lib/go-1.8/src/runtime/lock_futex.go:174 +0xd0
runtime.notetsleep(0x6a89d8, 0xdf8475800, 0x1)
        /usr/lib/go-1.8/src/runtime/lock_futex.go:194 +0x56
runtime.sysmon()
        /usr/lib/go-1.8/src/runtime/proc.go:3805 +0x135
runtime.mstart1()
        /usr/lib/go-1.8/src/runtime/proc.go:1179 +0x11e
runtime.mstart()
        /usr/lib/go-1.8/src/runtime/proc.go:1149 +0x64

goroutine 1 [chan send]:
github.com/peco/peco.(*Termbox).Close(0xc42000a8e0, 0x690b60, 0xc420012f00)
        github.com/peco/peco/screen.go:32 +0x43
github.com/peco/peco.(*Peco).Run(0xc420072700, 0x690b60, 0xc420012f00, 0x68fb20, 0x6c3028)
        github.com/peco/peco/peco.go:404 +0x504
main._main(0x0)
        github.com/peco/peco/cmd/peco/peco.go:36 +0xdb
main.main()
        github.com/peco/peco/cmd/peco/peco.go:22 +0x3e

goroutine 5 [syscall]:
os/signal.signal_recv(0x6901e0)
        /usr/lib/go-1.8/src/runtime/sigqueue.go:116 +0x104
os/signal.loop()
        /usr/lib/go-1.8/src/os/signal/signal_unix.go:22 +0x22
created by os/signal.init.1
        /usr/lib/go-1.8/src/os/signal/signal_unix.go:28 +0x41

goroutine 7 [select, locked to thread]:
runtime.gopark(0x5d2ba8, 0x0, 0x5c7f68, 0x6, 0x18, 0x2)
        /usr/lib/go-1.8/src/runtime/proc.go:271 +0x13a
runtime.selectgoImpl(0xc42011cf50, 0x0, 0x18)
        /usr/lib/go-1.8/src/runtime/select.go:423 +0x1364
runtime.selectgo(0xc42011cf50)
        /usr/lib/go-1.8/src/runtime/select.go:238 +0x1c
runtime.ensureSigM.func1()
        /usr/lib/go-1.8/src/runtime/signal_unix.go:434 +0x2dd
runtime.goexit()
        /usr/lib/go-1.8/src/runtime/asm_amd64.s:2197 +0x1

goroutine 23 [select]:
github.com/nsf/termbox-go.Init.func1()
        github.com/nsf/termbox-go/api.go:93 +0x37c
created by github.com/nsf/termbox-go.Init
        github.com/nsf/termbox-go/api.go:105 +0x5ce

goroutine 25 [chan send]:
github.com/peco/peco.(*Termbox).PollEvent.func2(0xc4200ce300, 0x690b60, 0xc420012f00, 0xc42000a8e0)
        github.com/peco/peco/screen.go:88 +0xf2
created by github.com/peco/peco.(*Termbox).PollEvent
        github.com/peco/peco/screen.go:100 +0xba

rax    0xfffffffffffffffc
rbx    0x0
rcx    0x4544b3
rdx    0x0
rdi    0x6a89d8
rsi    0x0
rbp    0xc42003ded0
rsp    0xc42003de88
r8     0x0
r9     0x0
r10    0xc42003dec0
r11    0x246
r12    0x42be10
r13    0x34
r14    0x0
r15    0xf3
rip    0x4544b3
rflags 0x246
cs     0x33
fs     0x0
gs     0x0

(Please be specific. Include code, pseudocode, screen captures if you can)

@pocari
Copy link
Author

pocari commented Mar 29, 2022

The above freeze was reproduced even when tmux was not used.

@syohex
Copy link
Contributor

syohex commented Mar 29, 2022

I tried the reproduction steps however I couldn't reproduce this issue. Can you reproduce this issue when the command is assigned to another key other than Ctrl-s ? I suspect it's terminal stop(pause flow control).

@pocari
Copy link
Author

pocari commented Mar 29, 2022

@syohex
I see...

In order to avoid the Ctr-S problem, I have
stty -ixon
defined, but are there any other settings that might affect it?

@syohex
Copy link
Contributor

syohex commented Mar 30, 2022

but are there any other settings that might affect it?

I think no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants