gardesk/garterm / 94f8f47

Browse files

use _exit in forked child to avoid NVIDIA atexit handler crash

Authored by espadonne
SHA
94f8f4736fd4c9fa19fcabde14b51f0769857fb5
Parents
667b8f6
Tree
2f39661

1 changed file

StatusFile+-
M garterm/src/pty/unix.rs 3 2
garterm/src/pty/unix.rsmodified
@@ -107,8 +107,9 @@ impl Pty {
107107
 
108108
                 execvp(&shell_cstr, &[argv0]).ok();
109109
 
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) };
112113
             }
113114
             Ok(ForkResult::Parent { child }) => {
114115
                 // Parent process