use _exit in forked child to avoid NVIDIA atexit handler crash
- SHA
94f8f4736fd4c9fa19fcabde14b51f0769857fb5- Parents
-
667b8f6 - Tree
2f39661
94f8f47
94f8f4736fd4c9fa19fcabde14b51f0769857fb5667b8f6
2f39661| Status | File | + | - |
|---|---|---|---|
| M |
garterm/src/pty/unix.rs
|
3 | 2 |
garterm/src/pty/unix.rsmodified@@ -107,8 +107,9 @@ impl Pty { | ||
| 107 | 107 | |
| 108 | 108 | execvp(&shell_cstr, &[argv0]).ok(); |
| 109 | 109 | |
| 110 | - // If exec fails, exit | |
| 111 | - std::process::exit(127); | |
| 110 | + // If exec fails, use _exit to avoid running atexit handlers | |
| 111 | + // (which can crash in GPU drivers like NVIDIA after fork) | |
| 112 | + unsafe { libc::_exit(127) }; | |
| 112 | 113 | } |
| 113 | 114 | Ok(ForkResult::Parent { child }) => { |
| 114 | 115 | // Parent process |