From 4d4cdca2c853292306e944b8e814a536b992316b Mon Sep 17 00:00:00 2001 From: Alex Plotnick Date: Sat, 15 Aug 2026 16:54:00 +0000 Subject: [PATCH] Fix a crash on ^C during a REPL command Pressing ^C while a REPL command ran could crash the client with a core dump. The crash came from a stale rustyline signal handler writing to a closed pipe. Enabling rustyline's signal-hook feature makes it share the signal registry that tokio uses, and no stale handler remains installed. Co-Authored-By: Claude Mythos 5 --- Cargo.lock | 11 +++++++++++ Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 18c1e75..8563b05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4066,6 +4066,7 @@ dependencies = [ "memchr", "nix", "radix_trie", + "signal-hook", "termios", "unicode-segmentation", "unicode-width 0.2.2", @@ -4453,6 +4454,16 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" version = "1.4.8" diff --git a/Cargo.toml b/Cargo.toml index 8ff48fa..a3df96c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ rlimit = "0.10" rumors = { git = "https://github.com/oxidecomputer/rumors", rev = "b2675dbef99b784efb817db01920ee59dac708c3" } rustix = { version = "1", features = ["fs", "process", "pty", "termios"] } rustls = "0.23" -rustyline = { version = "17", features = ["termios"] } +rustyline = { version = "17", features = ["signal-hook", "termios"] } schemars = { version = "0.8", features = ["chrono"] } serde = "1" serde_json = "1"