zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
21.44k stars 651 forks source link

strider causes panic on Arch #2888

Closed LFd3v closed 1 year ago

LFd3v commented 1 year ago

Hi, there!

Thanks for zellij!

I got this error when trying to use strider on Arch, and I did not find anything related after a quick search in the issues, I hope this helps.

  1. Installed zellij from the stock Arch repo (extra);
  2. zelling -l strider crashes after a while (if I delete ~/.cache/zellij I can see the UI very briefly, then it crashes).

Basic information

zellij --version: 0.38.2 stty size: 30 110 (I tried full screen, etc, even using a VT, no change) uname -av: Linux a515-g 6.5.8-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Thu, 19 Oct 2023 22:51:49 +0000 x86_64 GNU/Linux (same problem using the LTS kernel as well)

Further information

$ zellij -l strider             

Error occurred in server:

  × Thread 'async-std/runtime' panicked.
  ├─▶ At library/std/src/sys/unix/time.rs:77:9
  ╰─▶ assertion failed: tv_nsec >= 0 && tv_nsec < NSEC_PER_SEC as i64
  help: If you are seeing this message, it means that something went wrong.

        -> To get additional information, check the log at: /tmp/zellij-1000/zellij-log/zellij.log
        -> To see a backtrace next time, reproduce the error with: RUST_BACKTRACE=1 zellij [...]
        -> To help us fix this, please open an issue: https://github.com/zellij-org/zellij/issues

$ cat /tmp/zellij-1000/zellij-log/zellij.log
INFO   |zellij_client            | 2023-10-23 11:03:09.390 [main      ] [zellij-client/src/lib.rs:152]: Starting Zellij client! 
INFO   |zellij_server            | 2023-10-23 11:03:09.395 [main      ] [zellij-server/src/lib.rs:245]: Starting Zellij server! 
INFO   |zellij_server            | 2023-10-23 11:03:09.449 [main      ] [zellij-server/src/lib.rs:913]: Compiling plugins using Cranelift 
INFO   |zellij_server::plugins   | 2023-10-23 11:03:09.450 [wasm      ] [zellij-server/src/plugins/mod.rs:137]: Wasm main thread starts 
ERROR  |zellij_client::stdin_ansi| 2023-10-23 11:03:09.451 [stdin_handler] [zellij-client/src/stdin_ansi_parser.rs:94]: Failed to open STDIN cache file: Os { code: 2, kind: NotFound, message: "No such file or directory" } 
INFO   |zellij_server::plugins::p| 2023-10-23 11:03:09.860 [async-std/runti] [zellij-server/src/plugins/plugin_loader.rs:526]: Compiled plugin 'tab-bar' in 399.964459ms 
INFO   |zellij_server::plugins::p| 2023-10-23 11:03:10.783 [async-std/runti] [zellij-server/src/plugins/plugin_loader.rs:526]: Compiled plugin 'strider' in 1.319655995s 
ERROR  |zellij_utils::errors::not| 2023-10-23 11:03:10.788 [async-std/runti] [zellij-utils/src/errors.rs:614]: Panic occured:
             thread: async-std/runtime
             location: At library/std/src/sys/unix/time.rs:77:9
             message: assertion failed: tv_nsec >= 0 && tv_nsec < NSEC_PER_SEC as i64 
INFO   |zellij_server::plugins::w| 2023-10-23 11:03:10.788 [wasm      ] [zellij-server/src/plugins/wasm_bridge.rs:198]: Bye from plugin 1 
INFO   |zellij_server::plugins::w| 2023-10-23 11:03:10.789 [wasm      ] [zellij-server/src/plugins/wasm_bridge.rs:198]: Bye from plugin 0 
ERROR  |zellij_server::plugins::p| 2023-10-23 11:03:10.789 [async-std/runti] [zellij-server/src/plugins/plugin_worker.rs:72]: Failed to receive worker message on channel: RecvError 
INFO   |zellij_server::plugins   | 2023-10-23 11:03:10.789 [wasm      ] [zellij-server/src/plugins/mod.rs:339]: wasm main thread exits 
ERROR  |zellij_server::plugins::p| 2023-10-23 11:03:10.789 [async-std/runti] [zellij-server/src/plugins/plugin_worker.rs:72]: Failed to receive worker message on channel: RecvError 

$ RUST_BACKTRACE=1 zellij -l strider     

Error occurred in server:

  × Thread 'async-std/runtime' panicked.
  ├─▶ At library/std/src/sys/unix/time.rs:77:9
  ╰─▶ assertion failed: tv_nsec >= 0 && tv_nsec < NSEC_PER_SEC as i64

      Panic backtrace:
         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: <unknown>
        14: <unknown>
        15: <unknown>
        16: <unknown>
        17: <unknown>
        18: <unknown>
        19: <unknown>
        20: <unknown>

  help: If you are seeing this message, it means that something went wrong.

        -> To get additional information, check the log at: /tmp/zellij-1000/zellij-log/zellij.log
        -> To see a backtrace next time, reproduce the error with: RUST_BACKTRACE=1 zellij [...]
        -> To help us fix this, please open an issue: https://github.com/zellij-org/zellij/issues
tlinford commented 1 year ago

Not quite sure what's up here, but does it behave differently if you open it in a different directory?

LFd3v commented 1 year ago

Not quite sure what's up here, but does it behave differently if you open it in a different directory?

Do you have a crystal ball or something? I entered another directory and it worked. lol

So it seems that there is some problem in my home directory. How can I help further?

tlinford commented 1 year ago

are you on btrfs by any chance?

no crystal ball, we saw somethig similar a while ago in #2369... the TLDR is that rust is panicking on some files with invalid timestamps.

LFd3v commented 1 year ago

are you on btrfs by any chance?

Bingo again! Let me check if I see any weird time stamps...

Well, all dates are from 2021-03-06 and today. Maybe because my locale for numbers/time is not en_US.UTF-8?

Edit.1: maybe the crash is because of a broken link (standard Steam install, I did not touch it):

lrwxrwxrwx  1 lfom lfom     29 out 20 19:50 .steampath -> /home/user/.steam/sdk32/steam
lrwxrwxrwx  1 lfom lfom     27 out 20 19:50 .steampid -> /home/user/.steam/steam.pid

Oh, and thank you for your quick replies!

tlinford commented 1 year ago

I doubt locale is the problem here. See here for some details: https://gitlab.gnome.org/World/pika-backup/-/issues/328#note_1678430, the problem is likely with the birth field and you would need to use that stat command to see it.

LFd3v commented 1 year ago

Thank you a lot, this was spot on:

$ for file in $(/usr/bin/ls -a); do echo "** $file " && stat $file 2&>/dev/null | grep Birth | grep -v 2023 | grep -v 2022 ; done
...
** .cache
 Birth: 26760730-10-20 05:12:48.020175362 -030
...

Recreating .cache fixed the problem, using strider does not panic anymore!

Although it is not a bug in zellij itself, maybe adding something to the code to prevent the crash would be a good idea? Anyway, I am closing it now.

Cheers!