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

Zellij server crashes when killing X session #1040

Closed
Tracked by #1100
raphCode opened this issue Feb 6, 2022 · 3 comments
Closed
Tracked by #1100

Zellij server crashes when killing X session #1040

raphCode opened this issue Feb 6, 2022 · 3 comments
Labels
stability Issues in relation to stability suspected bug

Comments

@raphCode
Copy link
Contributor

raphCode commented Feb 6, 2022

The zellij server crashes for me when the zellij session was startet from inside X and the X server is killed.

Reproduction:
The optional steps do not influence whether the crash happens.

  1. Start X and a terminal emulator (I used alacritty)
  2. from the terminal emulator, run zellij
  3. (optional:) Detach from the session or close the terminal emulator
  4. (optional:) Login to a framebuffer console (e.g. Ctrl + Alt + F2) and attach to session zellij attach
  5. kill X server, I did sudo systemctl restart lightdm to restart my display manager
  6. zellij session crashes
Originating Thread(s):
1. ipc_server: AttachClient
2. screen_thread: AddClient
3. plugin_thread: Update
4. screen_thread: Render
5. ipc_server: Render

Error: thread 'router' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" })': /build/zellij/src/zellij-0.24.0/zellij-utils/src/ipc.rs:168

The crash does not happen when:

  • zellij session was initiated from a framebuffer console (does not crash even if attached to an X terminal)
  • the X session is exited gracefully by logging out (does not crash even if logging in again and killing X)

Version information
zellij --version: 0.24.0
uname -av: Linux 5.15.12-arch1-1 #1 SMP PREEMPT Wed, 29 Dec 2021 12:04:56 +0000 x86_64 GNU/Linux

@AutumnMeowMeow
Copy link
Contributor

The error doesn't look like a signals thing, but on the off chance zellij is getting the signal that killed the X server, maybe 'setsid' could be part of a solution. Some programs (e.g. 'script' grrr) send their kill to the entire process group.

@raphCode
Copy link
Contributor Author

raphCode commented Feb 9, 2022

Mhh, systemd seems to kill all processes in the control group when restarting services:
https://stackoverflow.com/questions/40898077/systemd-systemctl-stop-aggressively-kills-subprocesses
Also man systemd.kill

But from systemd-cgls it seems that lightdm.service is in another cgroup than the user sessions with the zellij server. Maybe I am reading this wrong, or both the user and lightdm cgroup are killed?
Simplified output:

-.slice
├─user.slice (#187)
│ └─user-1000.slice (#1870)
│   └─session-2.scope (#2068)
│     ├─   523 lightdm --session-child 12 19
│     ├─   549 xfce4-session
│     └─  1861 /usr/bin/zellij --server /run/user/1000/zellij/0.24.0/grieving-o…
└─system.slice (#55)
  └─lightdm.service (#1507)
    ├─ 445 /usr/bin/lightdm
    └─ 450 /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tc…

I am not sure if upon logout of the X session the zellij server process gets disconnected from the control group? Because after logout, X/lightdm restarts do not lead to the crash anymore.

@a-kenji a-kenji added the stability Issues in relation to stability label Mar 9, 2022
@raphCode
Copy link
Contributor Author

Amazing, even this issue should also be solved by #1351!

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

No branches or pull requests

3 participants