diff options
| author | Laurențiu Nicola <lnicola@users.noreply.github.com> | 2025-01-20 09:29:00 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-20 09:29:00 +0000 |
| commit | 141e53b7154083afcfb2e0fb0334e554d0c146a4 (patch) | |
| tree | 1707172316fef25a86219934940bf7d3196d263f /library/std/src/sys/pal/unix/stack_overflow.rs | |
| parent | 61af2cc09a25a51015ed1c0e3ff9ce3dc8323987 (diff) | |
| parent | 3af5c080e61a00986852fc12ff2681238eaaa2dc (diff) | |
| download | rust-141e53b7154083afcfb2e0fb0334e554d0c146a4.tar.gz rust-141e53b7154083afcfb2e0fb0334e554d0c146a4.zip | |
Merge pull request #18980 from lnicola/sync-from-rust
minor: Sync from downstream
Diffstat (limited to 'library/std/src/sys/pal/unix/stack_overflow.rs')
| -rw-r--r-- | library/std/src/sys/pal/unix/stack_overflow.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/library/std/src/sys/pal/unix/stack_overflow.rs b/library/std/src/sys/pal/unix/stack_overflow.rs index 69b31da427f..db5c6bd3a1c 100644 --- a/library/std/src/sys/pal/unix/stack_overflow.rs +++ b/library/std/src/sys/pal/unix/stack_overflow.rs @@ -100,10 +100,11 @@ mod imp { // If the faulting address is within the guard page, then we print a // message saying so and abort. if start <= addr && addr < end { - rtprintpanic!( - "\nthread '{}' has overflowed its stack\n", - thread::current().name().unwrap_or("<unknown>") - ); + thread::with_current_name(|name| { + let name = name.unwrap_or("<unknown>"); + rtprintpanic!("\nthread '{name}' has overflowed its stack\n"); + }); + rtabort!("stack overflow"); } else { // Unregister ourselves by reverting back to the default behavior. |
