From 55e569e38d80c71e919480e1a009beb19601ffda Mon Sep 17 00:00:00 2001 From: raphTec Date: Thu, 10 Feb 2022 01:45:57 +0100 Subject: [PATCH 1/2] fix: catch and report errors about tty I/O (#882) Quick and dirty bandaid fix to some server crashes which occur to me lately. The underlying issue seems to be a race condition somewhere when the shell in the pane exits and the tty file descriptor becomes invalid, but zellij wants to write/read it? Bug trigger: - open some panes - exit the shells in the panes by spamming Ctrl-D works best when the system only runs on a single CPU, run the following to disable all cores but one: echo 0 | sudo tee /sys/devices/system/cpu/cpu*/online --- zellij-server/src/tab/mod.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index c91ac87a9a..1798687810 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -787,12 +787,15 @@ impl Tab { PaneId::Terminal(active_terminal_id) => { let active_terminal = self.panes.get(&pane_id).unwrap(); let adjusted_input = active_terminal.adjust_input_to_terminal(input_bytes); - self.os_api + if let Err(e) = self + .os_api .write_to_tty_stdin(active_terminal_id, &adjusted_input) - .expect("failed to write to terminal"); - self.os_api - .tcdrain(active_terminal_id) - .expect("failed to drain terminal"); + { + log::error!("failed to write to terminal: {}", e); + } + if let Err(e) = self.os_api.tcdrain(active_terminal_id) { + log::error!("failed to drain terminal: {}", e); + } } PaneId::Plugin(pid) => { for key in parse_keys(&input_bytes) { From 109d688b25853e4b8f1d1b6ff3f00caeb5eaa1d1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 24 Apr 2022 00:30:11 +0000 Subject: [PATCH 2/2] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'crate2nix': 'github:kolloch/crate2nix/c4a479172ebafdd3baf36aa274b2168b4fd42f40' (2022-03-03) → 'github:kolloch/crate2nix/78258f27fc3121562a44eb02c652a5ec77cf8d02' (2022-04-20) • Updated input 'flake-compat': 'github:edolstra/flake-compat/b7547d3eed6f32d06102ead8991ec52ab0a4f1a7' (2022-01-03) → 'github:edolstra/flake-compat/b4a34015c698c7793d592d66adbab377907a2be8' (2022-04-19) • Updated input 'flake-utils': 'github:numtide/flake-utils/3cecb5b042f7f209c56ffd8371b2711a290ec797' (2022-02-07) → 'github:numtide/flake-utils/a4b154ebbdc88c8498a5c7b01589addc9e9cb678' (2022-04-11) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/fcd48a5a0693f016a5c370460d0c2a8243b882dc' (2022-03-10) → 'github:nixos/nixpkgs/bc41b01dd7a9fdffd32d9b03806798797532a5fe' (2022-04-23) • Updated input 'rust-overlay': 'github:oxalica/rust-overlay/c984623eb0584a2aadeca505dd85ec68a3f5a576' (2022-03-13) → 'github:oxalica/rust-overlay/d10f36b093459eb71ddcfedbab538c1ae3dfebb2' (2022-04-23) --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index fb2d7e9673..724bafc504 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "crate2nix": { "flake": false, "locked": { - "lastModified": 1646322090, - "narHash": "sha256-Jtqd5Ory+1LgMMTY0tNJKd/U2mOiPRd/oYnuyTHE08o=", + "lastModified": 1650460722, + "narHash": "sha256-jk4SZ8iOnfJEceVULjyOAq4MrX9CfU5bCWMyZP9nJVA=", "owner": "kolloch", "repo": "crate2nix", - "rev": "c4a479172ebafdd3baf36aa274b2168b4fd42f40", + "rev": "78258f27fc3121562a44eb02c652a5ec77cf8d02", "type": "github" }, "original": { @@ -19,11 +19,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", "type": "github" }, "original": { @@ -34,11 +34,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "lastModified": 1649676176, + "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", "owner": "numtide", "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", "type": "github" }, "original": { @@ -49,11 +49,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1646939531, - "narHash": "sha256-bxOjVqcsccCNm+jSmEh/bm0tqfE3SdjwS+p+FZja3ho=", + "lastModified": 1650701402, + "narHash": "sha256-XKfstdtqDg+O+gNBx1yGVKWIhLgfEDg/e2lvJSsp9vU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fcd48a5a0693f016a5c370460d0c2a8243b882dc", + "rev": "bc41b01dd7a9fdffd32d9b03806798797532a5fe", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1647138040, - "narHash": "sha256-rG9G4ND7hoG7VVIe614s0s76jEcZjhFm1JO1m5EiSsI=", + "lastModified": 1650681299, + "narHash": "sha256-JNvHHeeXDl3UnjWolMSbH2sWvhAYPfAutL815kZ6vFs=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "c984623eb0584a2aadeca505dd85ec68a3f5a576", + "rev": "d10f36b093459eb71ddcfedbab538c1ae3dfebb2", "type": "github" }, "original": {