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

sk suddenly stop working (no response) #308

Closed
JodyStats opened this issue Apr 20, 2020 · 23 comments
Closed

sk suddenly stop working (no response) #308

JodyStats opened this issue Apr 20, 2020 · 23 comments
Labels

Comments

@JodyStats
Copy link

Hi, I am a big fan of Rust and has since moved to sk from fzf. Thanks for the great work.

Before updating 0.8.1, sk was working fine at all. After updating, all of a sudden it just stops working. sk does not have any response. I use fzf side-by-side with sk and fzf is still working as normal.

Using pacman. I removed skim. Reinstall it. Issue persists.

# Start cleanly
bash --noprofile --norc

fzf
# working normally

sk
# no response
sk
# no response
sk
# no response

echo $?
# 101
sk --version
# 0.8.1
sk --help
# Usage: sk [options]
#   Options
#     -h, --help           print this help menu
#     --version [...]
# [truncated ..............................................]

cat /etc/os-release
#    1 NAME="Arch Linux"
#    2 PRETTY_NAME="Arch Linux"
#    3 ID=arch
#    4 BUILD_ID=rolling
#    5 ANSI_COLOR="0;36"
#    6 HOME_URL="https://www.archlinux.org/"
#    7 DOCUMENTATION_URL="https://wiki.archlinux.org/"
#    8 SUPPORT_URL="https://bbs.archlinux.org/"
#    9 BUG_REPORT_URL="https://bugs.archlinux.org/"
#   10 LOGO=archlinux
@lotabout
Copy link
Collaborator

@JodyStats Would you please turn on the log and try to reproduce?

RUST_LOG=debug sk 2> x.log

And paste the content of x.log here?

@JodyStats
Copy link
Author

JodyStats commented Apr 21, 2020

Sure. I also did both RUST_LOG and strace for ya

RUST_LOG=debug sk 2> x.log

# [2020-04-21T01:55:26Z DEBUG sk] query_history_file: None
# [2020-04-21T01:55:26Z DEBUG sk] cmd_history_file: None
# [2020-04-21T01:55:26Z DEBUG sk] query_history: []
# [2020-04-21T01:55:26Z DEBUG sk] cmd_history: []
# [2020-04-21T01:55:26Z DEBUG tuikit::term] key listener start
# [2020-04-21T01:55:26Z DEBUG tuikit::term] size change listener started
# [2020-04-21T01:55:26Z DEBUG tuikit::term] restart: components: 1
# thread 'main' panicked at 'assertion failed: `(left == right)`
#   left: `22`,
#  right: `4`', src/libstd/sys/unix/thread.rs:172:21
# note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


strace sk &> sktrace.log

# execve("/usr/sbin/sk", ["sk"], 0x7ffffa723970 /* 52 vars */) = 0
# brk(NULL)                               = 0x7fffe1aea000
# arch_prctl(0x3001 /* ARCH_??? */, 0x7fffe8768da0) = -1 EINVAL (Invalid argument)
# access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
# openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
# fstat(3, {st_mode=S_IFREG|0644, st_size=68702, ...}) = 0
# mmap(NULL, 68702, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f04ce6ef000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\22\0\0\0\0\0\0"..., 832) = 832
# fstat(3, {st_mode=S_IFREG|0755, st_size=14528, ...}) = 0
# mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04ce730000
# mmap(NULL, 16528, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f04ce6e0000
# mmap(0x7f04ce6e1000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f04ce6e1000
# mmap(0x7f04ce6e2000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f04ce6e2000
# mmap(0x7f04ce6e3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f04ce6e3000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\201\0\0\0\0\0\0"..., 832) = 832
# pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\354e\227\335C\300X\353\375\277<\23:\311L\343"..., 68, 824) = 68
# fstat(3, {st_mode=S_IFREG|0755, st_size=158240, ...}) = 0
# pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\354e\227\335C\300X\353\375\277<\23:\311L\343"..., 68, 824) = 68
# mmap(NULL, 135584, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f04ce6be000
# mmap(0x7f04ce6c5000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f04ce6c5000
# mmap(0x7f04ce6d5000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f04ce6d5000
# mmap(0x7f04ce6da000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f04ce6da000
# mmap(0x7f04ce6dc000, 12704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f04ce6dc000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 0\0\0\0\0\0\0"..., 832) = 832
# fstat(3, {st_mode=S_IFREG|0644, st_size=874264, ...}) = 0
# mmap(NULL, 103152, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f04ce6a4000
# mmap(0x7f04ce6a7000, 69632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f04ce6a7000
# mmap(0x7f04ce6b8000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f04ce6b8000
# mmap(0x7f04ce6bc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f04ce6bc000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`q\2\0\0\0\0\0"..., 832) = 832
# pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
# pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
# pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0m\272\321p\230T\305'y?d\1fnE\247"..., 68, 880) = 68
# fstat(3, {st_mode=S_IFREG|0755, st_size=2145592, ...}) = 0
# pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
# pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
# pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0m\272\321p\230T\305'y?d\1fnE\247"..., 68, 880) = 68
# mmap(NULL, 1856312, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f04ce4de000
# mmap(0x7f04ce503000, 1359872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f04ce503000
# mmap(0x7f04ce64f000, 307200, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x171000) = 0x7f04ce64f000
# mmap(0x7f04ce69a000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bb000) = 0x7f04ce69a000
# mmap(0x7f04ce6a0000, 13112, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f04ce6a0000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\363\0\0\0\0\0\0"..., 832) = 832
# fstat(3, {st_mode=S_IFREG|0755, st_size=1329280, ...}) = 0
# mmap(NULL, 1331224, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f04ce390000
# mmap(0x7f04ce39f000, 638976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f04ce39f000
# mmap(0x7f04ce43b000, 626688, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xab000) = 0x7f04ce43b000
# mmap(0x7f04ce4d4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x143000) = 0x7f04ce4d4000
# close(3)                                = 0
# mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04ce380000
# arch_prctl(ARCH_SET_FS, 0x7f04ce381440) = 0
# mprotect(0x7f04ce69a000, 12288, PROT_READ) = 0
# mprotect(0x7f04ce4d4000, 4096, PROT_READ) = 0
# mprotect(0x7f04ce6bc000, 4096, PROT_READ) = 0
# mprotect(0x7f04ce6da000, 4096, PROT_READ) = 0
# mprotect(0x7f04ce6e3000, 4096, PROT_READ) = 0
# mprotect(0x7f04ce9fc000, 167936, PROT_READ) = 0
# mprotect(0x7f04ce72b000, 4096, PROT_READ) = 0
# munmap(0x7f04ce6ef000, 68702)           = 0
# set_tid_address(0x7f04ce381710)         = 6537
# set_robust_list(0x7f04ce381720, 24)     = 0
# rt_sigaction(SIGRTMIN, {sa_handler=0x7f04ce6c5be0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f04ce6d2800}, NULL, 8) = 0
# rt_sigaction(SIGRT_1, {sa_handler=0x7f04ce6c5c80, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f04ce6d2800}, NULL, 8) = 0
# rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
# prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=8192*1024}) = 0
# rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f04ce519d70}, {sa_handler=SIG_DFL, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f3924cf5d70}, 8) = 0
# brk(NULL)                               = 0x7fffe1aea000
# brk(0x7fffe1b0b000)                     = 0x7fffe1b0b000
# openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3
# prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=8192*1024}) = 0
# fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
# read(3, "7f04ce380000-7f04ce382000 rw-p 0"..., 4096) = 3968
# close(3)                                = 0
# sched_getaffinity(6537, 32, [0, 1, 2, 3, 4, 5, 6, 7]) = 32
# rt_sigaction(SIGSEGV, {sa_handler=0x7f04ce929b30, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x7f04ce6d2800}, NULL, 8) = 0
# rt_sigaction(SIGBUS, {sa_handler=0x7f04ce929b30, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x7f04ce6d2800}, NULL, 8) = 0
# sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0
# mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04ce6f0000
# sigaltstack({ss_sp=0x7f04ce6f0000, ss_flags=0, ss_size=8192}, NULL) = 0
# ioctl(2, TCGETS, 0x7fffe8768720)        = -1 ENOTTY (Inappropriate ioctl for device)
# getrandom("\xc1\x73\x1e\xd5\x3f\x73\x0c\x08\x38\xfb\xe3\x6b\x74\x1b\xa8\x8d", 16, GRND_NONBLOCK) = 16
# ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
# rt_sigprocmask(SIG_BLOCK, [WINCH], NULL, 8) = 0
# rt_sigaction(SIGWINCH, {sa_handler=0x7f04ce94c9e0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f04ce6d2800}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_INTERRUPT, sa_restorer=0x7f3924cf5d70}, 8) = 0
# futex(0x7f04ce6e4048, FUTEX_WAKE_PRIVATE, 2147483647) = 0
# mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f04ce170000
# mprotect(0x7f04ce171000, 2097152, PROT_READ|PROT_WRITE) = 0
# clone(child_stack=0x7f04ce36fdf0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[6542], tls=0x7f04ce370700, child_tidptr=0x7f04ce3709d0) = 6542
# mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f04cdf50000
# mprotect(0x7f04cdf51000, 2097152, PROT_READ|PROT_WRITE) = 0
# clone(child_stack=0x7f04ce14fdf0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[6543], tls=0x7f04ce150700, child_tidptr=0x7f04ce1509d0) = 6543
# openat(AT_FDCWD, "/dev/tty", O_RDWR|O_CLOEXEC) = 3
# fcntl(3, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
# ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
# ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
# ioctl(3, SNDCTL_TMR_START or TCSETS, {B38400 opost -isig -icanon -echo ...}) = 0
# statx(0, NULL, AT_STATX_SYNC_AS_STAT, STATX_ALL, NULL) = -1 ENOSYS (Function not implemented)
# stat("/home/user/.terminfo", 0x7fffe8765e00) = -1 ENOENT (No such file or directory)
# stat("/etc/terminfo", 0x7fffe8765e00)   = -1 ENOENT (No such file or directory)
# stat("/lib/terminfo", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
# stat("/lib/terminfo/t/tmux-256color", {st_mode=S_IFREG|0644, st_size=3217, ...}) = 0
# openat(AT_FDCWD, "/lib/terminfo/t/tmux-256color", O_RDONLY|O_CLOEXEC) = 4
# read(4, "\36\2#\0+\0\17\0i\1\361\4tmux-256color|tmux w"..., 8192) = 3217
# close(4)                                = 0
# openat(AT_FDCWD, "/dev/tty", O_RDWR|O_CLOEXEC) = 4
# pipe([5, 6])                            = 0
# fcntl(5, F_GETFL)                       = 0 (flags O_RDONLY)
# fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
# fcntl(4, F_GETFL)                       = 0x2 (flags O_RDWR)
# fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
# write(3, "\33[6n", 4)                   = 4
# read(5, 0x7fffe87662ff, 1)              = -1 EAGAIN (Resource temporarily unavailable)
# select(6, [4 5], NULL, NULL, {tv_sec=0, tv_usec=300000}) = 1 (in [4], left {tv_sec=0, tv_usec=300000})
# read(4, "\33", 1)                       = 1
# read(4, "[", 1)                         = 1
# read(4, "3", 1)                         = 1
# read(4, ";", 1)                         = 1
# read(4, "1", 1)                         = 1
# read(4, "R", 1)                         = 1
# read(4, 0x7fffe87662ff, 1)              = -1 EAGAIN (Resource temporarily unavailable)
# ioctl(3, TIOCGWINSZ, {ws_row=37, ws_col=66, ws_xpixel=0, ws_ypixel=0}) = 0
# write(3, "\33[?1049h\33[1;1H", 14)      = 14
# ioctl(3, TIOCGWINSZ, {ws_row=37, ws_col=66, ws_xpixel=0, ws_ypixel=0}) = 0
# brk(0x7fffe1b2d000)                     = 0x7fffe1b2d000
# mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f04cdd30000
# mprotect(0x7f04cdd31000, 2097152, PROT_READ|PROT_WRITE) = 0
# clone(child_stack=0x7f04cdf2fdf0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[6544], tls=0x7f04cdf30700, child_tidptr=0x7f04cdf309d0) = 6544
# mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f04cdb10000
# mprotect(0x7f04cdb11000, 2097152, PROT_READ|PROT_WRITE) = 0
# clone(child_stack=0x7f04cdd0fdf0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[6545], tls=0x7f04cdd10700, child_tidptr=0x7f04cdd109d0) = 6545
# clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=10000000}, 0x7fffe8766b20) = -1 EINVAL (Invalid argument)
# write(2, "thread '", 8thread ')                 = 8
# write(2, "main", 4main)                     = 4
# write(2, "' panicked at '", 15' panicked at ')         = 15
# write(2, "assertion failed: `(left == righ"..., 61assertion failed: `(left == right)`
#   left: `22`,
#  right: `4`) = 61
# write(2, "', ", 3', )                      = 3
# write(2, "src/libstd/sys/unix/thread.rs", 29src/libstd/sys/unix/thread.rs) = 29
# write(2, ":", 1:)                        = 1
# write(2, "172", 3172)                      = 3
# write(2, ":", 1:)                        = 1
# write(2, "21", 221)                       = 2
# write(2, "\n", 1
# )                       = 1
# write(2, "note: run with `RUST_BACKTRACE=1"..., 78note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
# ) = 78
# futex(0x7f04ce6bd060, FUTEX_WAKE_PRIVATE, 2147483647) = 0
# write(3, "\33[1;1H\33[J\33[?1000l\33[?1015l\33[?1006"..., 41) = 41
# ioctl(3, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
# close(3)                                = 0
# brk(0x7fffe1b16000)                     = 0x7fffe1b16000
# sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
# munmap(0x7f04ce6f0000, 8192)            = 0
# exit_group(101)                         = ?
# +++ exited with 101 +++

@lotabout
Copy link
Collaborator

@JodyStats Thanks! would you please try again with

RUST_BACKTRACE=1 RUST_LOG=debug sk 2> x.log

@lotabout lotabout added the bug label Apr 21, 2020
@JodyStats
Copy link
Author

Thanks for the help.

RUST_BACKTRACE=1 RUST_LOG=debug sk 2> x.log


# [2020-04-21T15:13:10Z DEBUG sk] query_history_file: None
# [2020-04-21T15:13:10Z DEBUG sk] cmd_history_file: None
# [2020-04-21T15:13:10Z DEBUG sk] query_history: []
# [2020-04-21T15:13:10Z DEBUG sk] cmd_history: []
# [2020-04-21T15:13:10Z DEBUG tuikit::term] restart: components: 0
# thread 'main' panicked at 'assertion failed: `(left == right)`
#   left: `22`,
#  right: `4`', src/libstd/sys/unix/thread.rs:172:21
# stack backtrace:
# [2020-04-21T15:13:10Z DEBUG tuikit::term] key listener start
# [2020-04-21T15:13:10Z DEBUG tuikit::term] size change listener started
#    0: <unknown>
#    1: <unknown>
#    2: <unknown>
#    3: <unknown>
#    4: <unknown>
#    5: <unknown>
#    6: <unknown>
#    7: <unknown>
#    8: <unknown>
#    9: <unknown>
#   10: <unknown>
#   11: <unknown>
#   12: <unknown>
#   13: __libc_start_main
#   14: <unknown>
# note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


strace sk &> sktrace.log


# execve("/usr/sbin/sk", ["sk"], 0x7fffd644ef30 /* 52 vars */) = 0
# brk(NULL)                               = 0x7fffc0099000
# arch_prctl(0x3001 /* ARCH_??? */, 0x7fffc702cf80) = -1 EINVAL (Invalid argument)
# access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
# openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
# fstat(3, {st_mode=S_IFREG|0644, st_size=68702, ...}) = 0
# mmap(NULL, 68702, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f70d063f000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\22\0\0\0\0\0\0"..., 832) = 832
# fstat(3, {st_mode=S_IFREG|0755, st_size=14528, ...}) = 0
# mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f70d0630000
# mmap(NULL, 16528, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f70d0620000
# mmap(0x7f70d0621000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f70d0621000
# mmap(0x7f70d0622000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f70d0622000
# mmap(0x7f70d0623000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f70d0623000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\201\0\0\0\0\0\0"..., 832) = 832
# pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\354e\227\335C\300X\353\375\277<\23:\311L\343"..., 68, 824) = 68
# fstat(3, {st_mode=S_IFREG|0755, st_size=158240, ...}) = 0
# pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\354e\227\335C\300X\353\375\277<\23:\311L\343"..., 68, 824) = 68
# mmap(NULL, 135584, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f70d05fe000
# mmap(0x7f70d0605000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f70d0605000
# mmap(0x7f70d0615000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f70d0615000
# mmap(0x7f70d061a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f70d061a000
# mmap(0x7f70d061c000, 12704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f70d061c000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 0\0\0\0\0\0\0"..., 832) = 832
# fstat(3, {st_mode=S_IFREG|0644, st_size=874264, ...}) = 0
# mmap(NULL, 103152, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f70d05e4000
# mmap(0x7f70d05e7000, 69632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f70d05e7000
# mmap(0x7f70d05f8000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f70d05f8000
# mmap(0x7f70d05fc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f70d05fc000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`q\2\0\0\0\0\0"..., 832) = 832
# pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
# pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
# pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0m\272\321p\230T\305'y?d\1fnE\247"..., 68, 880) = 68
# fstat(3, {st_mode=S_IFREG|0755, st_size=2145592, ...}) = 0
# pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
# pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
# pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0m\272\321p\230T\305'y?d\1fnE\247"..., 68, 880) = 68
# mmap(NULL, 1856312, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f70d041e000
# mmap(0x7f70d0443000, 1359872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f70d0443000
# mmap(0x7f70d058f000, 307200, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x171000) = 0x7f70d058f000
# mmap(0x7f70d05da000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bb000) = 0x7f70d05da000
# mmap(0x7f70d05e0000, 13112, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f70d05e0000
# close(3)                                = 0
# openat(AT_FDCWD, "/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
# read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\363\0\0\0\0\0\0"..., 832) = 832
# fstat(3, {st_mode=S_IFREG|0755, st_size=1329280, ...}) = 0
# mmap(NULL, 1331224, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f70d02d0000
# mmap(0x7f70d02df000, 638976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f70d02df000
# mmap(0x7f70d037b000, 626688, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xab000) = 0x7f70d037b000
# mmap(0x7f70d0414000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x143000) = 0x7f70d0414000
# close(3)                                = 0
# mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f70d02c0000
# arch_prctl(ARCH_SET_FS, 0x7f70d02c1440) = 0
# mprotect(0x7f70d05da000, 12288, PROT_READ) = 0
# mprotect(0x7f70d0414000, 4096, PROT_READ) = 0
# mprotect(0x7f70d05fc000, 4096, PROT_READ) = 0
# mprotect(0x7f70d061a000, 4096, PROT_READ) = 0
# mprotect(0x7f70d0623000, 4096, PROT_READ) = 0
# mprotect(0x7f70d0947000, 167936, PROT_READ) = 0
# mprotect(0x7f70d067b000, 4096, PROT_READ) = 0
# munmap(0x7f70d063f000, 68702)           = 0
# set_tid_address(0x7f70d02c1710)         = 6301
# set_robust_list(0x7f70d02c1720, 24)     = 0
# rt_sigaction(SIGRTMIN, {sa_handler=0x7f70d0605be0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f70d0612800}, NULL, 8) = 0
# rt_sigaction(SIGRT_1, {sa_handler=0x7f70d0605c80, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f70d0612800}, NULL, 8) = 0
# rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
# prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=8192*1024}) = 0
# rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f70d0459d70}, {sa_handler=SIG_DFL, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f3924cf5d70}, 8) = 0
# brk(NULL)                               = 0x7fffc0099000
# brk(0x7fffc00ba000)                     = 0x7fffc00ba000
# openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3
# prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=8192*1024}) = 0
# fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
# read(3, "7f70d02c0000-7f70d02c2000 rw-p 0"..., 4096) = 3968
# close(3)                                = 0
# sched_getaffinity(6301, 32, [0, 1, 2, 3, 4, 5, 6, 7]) = 32
# rt_sigaction(SIGSEGV, {sa_handler=0x7f70d0874b30, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x7f70d0612800}, NULL, 8) = 0
# rt_sigaction(SIGBUS, {sa_handler=0x7f70d0874b30, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_SIGINFO, sa_restorer=0x7f70d0612800}, NULL, 8) = 0
# sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0
# mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f70d0640000
# sigaltstack({ss_sp=0x7f70d0640000, ss_flags=0, ss_size=8192}, NULL) = 0
# ioctl(2, TCGETS, 0x7fffc702c900)        = -1 ENOTTY (Inappropriate ioctl for device)
# getrandom("\xf7\xf3\x3c\x29\x2f\x56\x6e\x89\x15\xd9\x3e\x51\x5b\xe7\x95\xe4", 16, GRND_NONBLOCK) = 16
# ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
# rt_sigprocmask(SIG_BLOCK, [WINCH], NULL, 8) = 0
# rt_sigaction(SIGWINCH, {sa_handler=0x7f70d08979e0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f70d0612800}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_INTERRUPT, sa_restorer=0x7f3924cf5d70}, 8) = 0
# futex(0x7f70d0624048, FUTEX_WAKE_PRIVATE, 2147483647) = 0
# mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f70d00b0000
# mprotect(0x7f70d00b1000, 2097152, PROT_READ|PROT_WRITE) = 0
# clone(child_stack=0x7f70d02afdf0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[6308], tls=0x7f70d02b0700, child_tidptr=0x7f70d02b09d0) = 6308
# mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f70cbdf0000
# mprotect(0x7f70cbdf1000, 2097152, PROT_READ|PROT_WRITE) = 0
# clone(child_stack=0x7f70cbfefdf0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[6309], tls=0x7f70cbff0700, child_tidptr=0x7f70cbff09d0) = 6309
# openat(AT_FDCWD, "/dev/tty", O_RDWR|O_CLOEXEC) = 3
# fcntl(3, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
# ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
# ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
# ioctl(3, SNDCTL_TMR_START or TCSETS, {B38400 opost -isig -icanon -echo ...}) = 0
# statx(0, NULL, AT_STATX_SYNC_AS_STAT, STATX_ALL, NULL) = -1 ENOSYS (Function not implemented)
# stat("/home/user/.terminfo", 0x7fffc7029fe0) = -1 ENOENT (No such file or directory)
# stat("/etc/terminfo", 0x7fffc7029fe0)   = -1 ENOENT (No such file or directory)
# stat("/lib/terminfo", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
# stat("/lib/terminfo/t/tmux-256color", {st_mode=S_IFREG|0644, st_size=3217, ...}) = 0
# openat(AT_FDCWD, "/lib/terminfo/t/tmux-256color", O_RDONLY|O_CLOEXEC) = 4
# read(4, "\36\2#\0+\0\17\0i\1\361\4tmux-256color|tmux w"..., 8192) = 3217
# close(4)                                = 0
# openat(AT_FDCWD, "/dev/tty", O_RDWR|O_CLOEXEC) = 4
# pipe([5, 6])                            = 0
# fcntl(5, F_GETFL)                       = 0 (flags O_RDONLY)
# fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
# fcntl(4, F_GETFL)                       = 0x2 (flags O_RDWR)
# fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
# write(3, "\33[6n", 4)                   = 4
# read(5, 0x7fffc702a4df, 1)              = -1 EAGAIN (Resource temporarily unavailable)
# select(6, [4 5], NULL, NULL, {tv_sec=0, tv_usec=300000}) = 1 (in [4], left {tv_sec=0, tv_usec=300000})
# read(4, "\33", 1)                       = 1
# read(4, "[", 1)                         = 1
# read(4, "1", 1)                         = 1
# read(4, "7", 1)                         = 1
# read(4, ";", 1)                         = 1
# read(4, "1", 1)                         = 1
# read(4, "R", 1)                         = 1
# read(4, 0x7fffc702a4df, 1)              = -1 EAGAIN (Resource temporarily unavailable)
# ioctl(3, TIOCGWINSZ, {ws_row=37, ws_col=66, ws_xpixel=0, ws_ypixel=0}) = 0
# write(3, "\33[?1049h\33[1;1H", 14)      = 14
# ioctl(3, TIOCGWINSZ, {ws_row=37, ws_col=66, ws_xpixel=0, ws_ypixel=0}) = 0
# brk(0x7fffc00dc000)                     = 0x7fffc00dc000
# mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f70cbbe0000
# mprotect(0x7f70cbbe1000, 2097152, PROT_READ|PROT_WRITE) = 0
# clone(child_stack=0x7f70cbddfdf0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[6310], tls=0x7f70cbde0700, child_tidptr=0x7f70cbde09d0) = 6310
# mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f70cb9d0000
# mprotect(0x7f70cb9d1000, 2097152, PROT_READ|PROT_WRITE) = 0
# clone(child_stack=0x7f70cbbcfdf0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[6311], tls=0x7f70cbbd0700, child_tidptr=0x7f70cbbd09d0) = 6311
# clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=10000000}, 0x7fffc702ad00) = -1 EINVAL (Invalid argument)
# write(2, "thread '", 8thread ')                 = 8
# write(2, "main", 4main)                     = 4
# write(2, "' panicked at '", 15' panicked at ')         = 15
# write(2, "assertion failed: `(left == righ"..., 61assertion failed: `(left == right)`
#   left: `22`,
#  right: `4`) = 61
# write(2, "', ", 3', )                      = 3
# write(2, "src/libstd/sys/unix/thread.rs", 29src/libstd/sys/unix/thread.rs) = 29
# write(2, ":", 1:)                        = 1
# write(2, "172", 3172)                      = 3
# write(2, ":", 1:)                        = 1
# write(2, "21", 221)                       = 2
# write(2, "\n", 1
# )                       = 1
# write(2, "note: run with `RUST_BACKTRACE=1"..., 78note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
# ) = 78
# futex(0x7f70d05fd060, FUTEX_WAKE_PRIVATE, 2147483647) = 0
# write(3, "\33[1;1H\33[J\33[?1000l\33[?1015l\33[?1006"..., 41) = 41
# ioctl(3, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
# close(3)                                = 0
# brk(0x7fffc00c5000)                     = 0x7fffc00c5000
# sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
# munmap(0x7f70d0640000, 8192)            = 0
# exit_group(101)                         = ?
# +++ exited with 101 +++

@JodyStats
Copy link
Author

@lotabout The issue is v0.8.1 released a month ago. I install v0.8.0 from source and sk works per normal

mkdir ~/dev
cd ~/dev
curl -LJO https://github.com/lotabout/skim/archive/v0.8.0.zip
unzip skim-0.8.0.zip
./skim-0.8.0/install
export PATH="$PATH:$HOME/dev/skim-0.8.0/bin"

sk --version
# 0.8.0

sk
# It works
sk
# It works
sk
# It works

@kvnxiao
Copy link

kvnxiao commented May 30, 2020

I am also having this issue with 0.8.1

@lotabout
Copy link
Collaborator

@JodyStats It's been quite a while. I tried to reproduce this issue with archlinux docker image but failed to reproduce.

# cat /etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux

Could you please download the pre-built packages and check if you could reproduce?
https://github.com/lotabout/skim/releases/tag/v0.8.1

And also the frequency of this problem? Thanks!

@kvnxiao
Copy link

kvnxiao commented Jun 25, 2020

@lotabout
Using sk downloaded from the pre-built 0.8.1 (skim-v0.8.1-x86_64-unknown-linux-gnu.tar.gz), it simply stops responding through my ssh connection to my Ubuntu 20.04 LTS (GNU/Linux 5.4.0-37-generic x86_64) server.

It simply hangs, and I am unable to provide input to it. I cannot Ctrl+C it either.

So the frequency of this problem is every time I try to use sk, meaning that I am actually unable to use it in its entirety. This issue occurs about 8/10 times when trying to launch sk, which is the majority of the time.

There is also no output during the hang when I attempt to use RUST_BACKTRACE=1 RUST_LOG=debug sk 2> x.log:

[2020-06-25T06:46:18Z DEBUG sk] query_history_file: None
[2020-06-25T06:46:18Z DEBUG sk] cmd_history_file: None
[2020-06-25T06:46:18Z DEBUG sk] query_history: []
[2020-06-25T06:46:18Z DEBUG sk] cmd_history: []

# END OF LOG

For what it's worth, I am accessing my server through ssh on a Windows 10 desktop.

EDIT:

I have even built the binary from source using cargo install skim, which builds v0.8.1, and the same results are happening.

@lotabout
Copy link
Collaborator

@kvnxiao Happens every time?

@kvnxiao
Copy link

kvnxiao commented Jun 25, 2020

Yep, every time.

@lotabout
Copy link
Collaborator

@kvnxiao Thanks for the information. I'll try to grab a Ubuntu 20.04 to reproduce.

@kvnxiao
Copy link

kvnxiao commented Jun 25, 2020

Also just attempted to test 0.8.0, and would mention that this issue happens to 0.8.0 too (where I have to pkill sk to terminate it from hanging), but approximately 1-2 times out of 10 tries, it works. The rest of the time it hangs.

@kvnxiao
Copy link

kvnxiao commented Jun 25, 2020

@lotabout I apologize, my previous comment saying that it happens every time in v0.8.1 is incorrect. It does start up on v0.8.1 only sometimes (to the same effect as 0.8.0).

I took a screen recording of my terminal sessions on 0.8.1, please take a look:
Fg6sqG278e

@lotabout
Copy link
Collaborator

lotabout commented Jun 26, 2020

@kvnxiao Would you please help me to reproduce with RUST_BACKTRACE=full RUST_LOG=trace sk 2> x.log and post the log?

Also, it would be great help if you could rebuild skim with debug symbols enabled before reproducing. (set debug=true in skim's Cargo.toml)

[profile.release]
lto = true
debug = true

I've tried to setup a Ubuntu 20.04(virtual machine) + ssh (from mac), no luck with reproducing.
I know there could be potential dead locks with tuikit but unable to locate the exact line.

@kvnxiao
Copy link

kvnxiao commented Jun 26, 2020

This is all I see after building with debug = true and using RUST_BACKTRACE=full RUST_LOG=trace sk 2> x.log

kvnxiao on kx-thinkcentre in skim/target/debug on  master [!]
❯ cat x.log
[2020-06-26T01:05:21Z DEBUG sk] query_history_file: None
[2020-06-26T01:05:21Z DEBUG sk] cmd_history_file: None
[2020-06-26T01:05:21Z DEBUG sk] query_history: []
[2020-06-26T01:05:21Z DEBUG sk] cmd_history: []
[2020-06-26T01:05:21Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:05:21Z TRACE tuikit::input] get_chars: buf: [27]
[2020-06-26T01:05:21Z TRACE tuikit::input] get_chars: buf: [91]

After this, it hangs, and I have to sudo pkill sk, and the log is still the same.

@kvnxiao
Copy link

kvnxiao commented Jun 26, 2020

When it does work in the off chance,

these are the logs I get:

kvnxiao on kx-thinkcentre in skim/target/debug on  master [!]
❯ cat x.log
[2020-06-26T01:07:00Z DEBUG sk] query_history_file: None
[2020-06-26T01:07:00Z DEBUG sk] cmd_history_file: None
[2020-06-26T01:07:00Z DEBUG sk] query_history: []
[2020-06-26T01:07:00Z DEBUG sk] cmd_history: []
[2020-06-26T01:07:00Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:07:00Z TRACE tuikit::input] get_chars: buf: [27, 91, 51, 50, 59, 49, 82]
[2020-06-26T01:07:00Z TRACE tuikit::input] get_chars: buf: [91, 51, 50, 59, 49, 82]
[2020-06-26T01:07:00Z DEBUG tuikit::term] restart: components: 0
[2020-06-26T01:07:00Z DEBUG tuikit::term] key listener start
[2020-06-26T01:07:00Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:07:00Z DEBUG tuikit::term] size change listener started
[2020-06-26T01:07:00Z DEBUG skim::item_collector] collector: command killer start
[2020-06-26T01:07:00Z DEBUG skim::item_collector] collector: command collector start
[2020-06-26T01:07:00Z DEBUG skim::reader] reader: collect_item start
[2020-06-26T01:07:00Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:00Z DEBUG skim::matcher] engine: Noop
[2020-06-26T01:07:00Z DEBUG skim::model] handle event: EvInputInvalid
[2020-06-26T01:07:00Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:00Z DEBUG skim::matcher] engine: Noop
[2020-06-26T01:07:00Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:00Z DEBUG skim::item_collector] collector: command collector stop
[2020-06-26T01:07:00Z DEBUG skim::item_collector] collector: command killer stop
[2020-06-26T01:07:00Z DEBUG skim::reader] reader: collect_item stop
[2020-06-26T01:07:00Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:00Z DEBUG skim::matcher] engine: Noop
[2020-06-26T01:07:00Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:01Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z TRACE tuikit::input] get_chars: buf: [58]
[2020-06-26T01:07:03Z TRACE tuikit::term] next key: Ok(Char(':'))
[2020-06-26T01:07:03Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvActAddChar(':')
[2020-06-26T01:07:03Z DEBUG skim::matcher] engine: (Or: (And: (Fuzzy: :)))
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z TRACE tuikit::input] get_chars: buf: [113]
[2020-06-26T01:07:03Z TRACE tuikit::term] next key: Ok(Char('q'))
[2020-06-26T01:07:03Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvActAddChar('q')
[2020-06-26T01:07:03Z DEBUG skim::matcher] engine: (Or: (And: (Fuzzy: :q)))
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z TRACE tuikit::input] get_chars: buf: [117]
[2020-06-26T01:07:03Z TRACE tuikit::term] next key: Ok(Char('u'))
[2020-06-26T01:07:03Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvActAddChar('u')
[2020-06-26T01:07:03Z DEBUG skim::matcher] engine: (Or: (And: (Fuzzy: :qu)))
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z TRACE tuikit::input] get_chars: buf: [105]
[2020-06-26T01:07:03Z TRACE tuikit::term] next key: Ok(Char('i'))
[2020-06-26T01:07:03Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvActAddChar('i')
[2020-06-26T01:07:03Z DEBUG skim::matcher] engine: (Or: (And: (Fuzzy: :qui)))
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z TRACE tuikit::input] get_chars: buf: [116]
[2020-06-26T01:07:03Z TRACE tuikit::term] next key: Ok(Char('t'))
[2020-06-26T01:07:03Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvActAddChar('t')
[2020-06-26T01:07:03Z DEBUG skim::matcher] engine: (Or: (And: (Fuzzy: :quit)))
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvHeartBeat
[2020-06-26T01:07:03Z TRACE tuikit::input] get_chars: buf: [13]
[2020-06-26T01:07:03Z TRACE tuikit::term] next key: Ok(Enter)
[2020-06-26T01:07:03Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:07:03Z DEBUG skim::model] handle event: EvActAccept(None)
[2020-06-26T01:07:03Z DEBUG skim::reader] kill reader, components before: 0
[2020-06-26T01:07:03Z TRACE tuikit::term] next key: Err("interrupted when waiting for signal")
[2020-06-26T01:07:03Z DEBUG tuikit::term] size change listener stop
[2020-06-26T01:07:03Z DEBUG tuikit::term] key listener stop

@lotabout
Copy link
Collaborator

@kvnxiao Thanks, I'll have a look.

@lotabout
Copy link
Collaborator

@kvnxiao Could you try the below pre-built version? Expectation: the below package would fix the issue.

skim-debug.tar.gz

If you worried about the pre-built image, would you please try:

  1. git clone -b fix/init-hang git@github.com:lotabout/tuikit.git
  2. modify skim's Cargo.toml
    tuikit = {path = "../tuikit"} # point to the cloned tuikit repo
    
  3. cargo build --release
  4. use the binary ./target/release/sk to reproduce.

@lotabout
Copy link
Collaborator

@kvnxiao However I believe your case is different with @JodyStats 's.

Your logs shows that skim(tuikit) is waiting for the cursor position(^[<row>;<col>R) while the report is not complete.

[2020-06-26T01:05:21Z TRACE tuikit::input] next_key_timeout
[2020-06-26T01:05:21Z TRACE tuikit::input] get_chars: buf: [27]
[2020-06-26T01:05:21Z TRACE tuikit::input] get_chars: buf: [91]

So that sk hangs on waiting for the remaining keys. The above fix should avoid the hanging situation, but you may still get the wrong cursor position since the report is still not complete.

While in @JodyStats 's case it might be some dead lock caused by a thread panic. Which I also failed to reproduce.

@kvnxiao
Copy link

kvnxiao commented Jun 26, 2020

@lotabout Can confirm that the new binary you uploaded works 100% of the time (at least when I tried to start sk about 20 times)

@lotabout
Copy link
Collaborator

@kvnxiao Thanks! I'll commit the changes to master.

@kvnxiao
Copy link

kvnxiao commented Jun 26, 2020

@lotabout Thanks! could you also publish the 0.8.2 update on crates.io?

@lotabout
Copy link
Collaborator

done.

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

No branches or pull requests

3 participants