3 ms·
Stack overflow in Rust does abort the process, but not immediately: the signal handler first distinguishes stack overflow from other sources of SIGSEGV/SIGBUS,
by ridiculous_fish 3y ago
Stack overflow in Rust does abort the process, but not immediately: the signal handler first distinguishes stack overflow from other sources of SIGSEGV/SIGBUS, and then prints a message containing the name of the current thread. Both of these require accessing TLS, which in turn may panic, or invoke other non-async-signal safe functions. That is UB.
I don't know what the definition of a "soundness issue" is, but I think there are some nasal demons to be found here; it will be fun to try at least.
edit the linked issue missed a case! Rust aborts by using libc::abort(), which is not async signal-safe in glibc prior to 2.26.
- ridiculous_fish 3y agoI have put a bug report where my mouth is. https://github.com/rust-lang/rust/issues/111272 https://github.com/rust-lang/rust/issues/111272
- kibwen 3y agoThanks for the report! We can continue there. :)