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

Crash when creating a new tab (WSL2 multiples days without shutdown) #2151

Closed
Zykino opened this issue Feb 10, 2023 · 10 comments
Closed

Crash when creating a new tab (WSL2 multiples days without shutdown) #2151

Zykino opened this issue Feb 10, 2023 · 10 comments

Comments

@Zykino
Copy link
Contributor

Zykino commented Feb 10, 2023

I had zellij opened on 2 distinct WindowsTerminal window, connected to the same session. After around 4 days (windows goes in sleep/hibernation every nights), I tried to open a new tab and this crash log was shown instead.

Error occurred in server:

  × Thread 'wasm' panicked.
  ├─▶ Originating Thread(s)
  │     1. stdin_handler_thread: AcceptInput
  │     2. screen_thread: NewTab
  │     3. plugin_thread: NewTab
  │
  ├─▶ At /home/x667421/.cargo/registry/src/github.com-1ecc6299db9ec823/zellij-server-0.34.4/src/lib.rs:726:18
  ╰─▶ Program terminates: a fatal error occured

      Caused by:
          0: failed to load plugin for client 1
          1: failed to start plugin PluginConfig {
                 path: "tab-bar",
                 run: Pane(
                     None,
                 ),
                 _allow_exec_host_cmd: false,
                 location: Zellij(
                     PluginTag(
                         "tab-bar",
                     ),
                 ),
             } for client 1
          2: wasi filesystem creation error: `Could not get metadata for file "/tmp/zellij-1000": entity not found`
  help: If you are seeing this message, it means that something went wrong.
        Please report this error to the github issue.
        (https://github.com/zellij-org/zellij/issues)

        Also, if you want to see the backtrace, you can set the `RUST_BACKTRACE` environment variable to `1`.

Apparently /tmp/zellij-1000 exist after the crash.

file /tmp/zellij-1000/zellij-log/zellij.log
/tmp/zellij-1000/zellij-log/zellij.log: empty

It happens once so, I am not sure how much this is easy to reproduce.

@imsnif
Copy link
Member

imsnif commented Feb 13, 2023

Hey @har7an - I think we fixed this already, right?

@har7an
Copy link
Contributor

har7an commented Feb 15, 2023

@imsnif Hard to say, #2093 dealt specifically with the cache folder, although it does recreate the TMP folder when it's missing, too. I think that this is resolved by #2093, because the description sounds very much like what led me to make that PR in the first place.

@Zykino Can you try running the following command:

$ rm -rf /tmp/zellij-1000 && zellij action new-tab

And post the output you get?

Edit: Beware, if my assumption is correct, this will crash your session.

@Zykino
Copy link
Contributor Author

Zykino commented Feb 20, 2023

Brand new terminal/tab (no active session)

There is no active session!

I tried it again with a zellij session in another tab and I get the same result.

$ zellij ls
No active zellij sessions found.

@imsnif
Copy link
Member

imsnif commented Feb 20, 2023

@Zykino - wild guess: is there a chance you're running more than one version of Zellij?

@Zykino
Copy link
Contributor Author

Zykino commented Feb 20, 2023

When in the title I said "when creating a new tab", I meant "with keyboard shortcuts: Ctrl+t, n.
That said, I’m not sure, I may have done cargo install-update -a in the interval. With zellij last release from mid December I doubt it upgraded, but maybe.

I just tried again with my setup and this cause a crash each time:

  1. zellij # Start a session
  2. rm /tmp/zellij-1000 -fr
  3. "Ctrl+t, n"
    => Crash

Opening a new tab with zellij action new-tab after removing the /tmp folder does not crash either from within zellij.

  • In my previous reply I tried the commands outside of a zellij session. This give the same result as stated BUT if I then do Ctrl+t, n, I have the new tab as expected.

-> The default keybinding is not protected, but calling explicitly a zellij command from inside recreate enough for the keyboard shortcut to work. And multiples zellij action new-tab do not achieve a new tab. Even after a successful one from the keyboard.

Sorry if I’m not clear 😅 a bit sick and I do not have the force to edit much a text in a foreign language right now.
Still good job in general on zellij, it has been way more stable since my last issue. 👍 (Now I need to unbind Ctrl+q as I hate this shortcut everywhere on AZERTY keyboards.)

@imsnif
Copy link
Member

imsnif commented Feb 21, 2023

Hey @Zykino - first, I hope you feel better soon! Please don't exert yourself just to help us with a bug :)

Zellij relies on IPC pipes in the tmp folder. If it is deleted, it will crash. We should be able to recover from this, but right now we are not. In the next version we will add a sticky bit to the tmp files so that they will not be cleaned up by other processes. Not sure if this is your issue, but it might help.

Zellij also does not deal well with having two versions of itself running on the same machine. This is a result of some bad design in the early days. We should be able to deal with this too, but currently don't.

@Zykino
Copy link
Contributor Author

Zykino commented Feb 22, 2023

I reproduce on Pop-Os only 1 version of Zellij.

zellij # Start a session
rm /tmp/zellij-1000 -fr
# "Ctrl+t, n"
# Crash
zellij # Start a session
rm /tmp/zellij-1000 -fr
`zellij action new-tab`
# Ok tab 2 created
"Ctrl+t, n"
# Ok tab 3 created

It feels so strange that starting another process fix the tmp folder structure while in process shortcut don’t. I though that the keybinding was exactly that: a shortuct that executed exactly the same code as the long form operation.

I guess architecture is what it is 😅.

@har7an
Copy link
Contributor

har7an commented Feb 23, 2023

@Zykino There's a lot of technical difference between what Ctrl + t, n and zellij action new-tab do, unfortunately. I'm very confident that our next release will fix your issue, though. If you feel adventurous, you can always compile a current version from main and try that.

@Zykino
Copy link
Contributor Author

Zykino commented Mar 8, 2023

Just checked, it is indeed fixed in 0.35.1 🎉

@Zykino Zykino closed this as completed Mar 8, 2023
@non-descriptive
Copy link

non-descriptive commented Mar 27, 2023

It reappeared in 0.36.0 or earlier. Look #2078. Also there's bunch of issues related to this specific panic.

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

4 participants