diff options
| author | bors <bors@rust-lang.org> | 2021-05-20 04:58:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-05-20 04:58:13 +0000 |
| commit | 5ab0f37087b61b2ea51f364498cddc20ecff74fa (patch) | |
| tree | 6a91baf3a776ee830c8fd604503f04d95f567340 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | a426fc37f2269093ef1a4dbb3e31b3247980fccc (diff) | |
| parent | 4ff5ab52966203b8ad8da96f897566e4a218308a (diff) | |
| download | rust-5ab0f37087b61b2ea51f364498cddc20ecff74fa.tar.gz rust-5ab0f37087b61b2ea51f364498cddc20ecff74fa.zip | |
Auto merge of #84697 - CDirkx:util, r=m-ou-se
Introduce `sys_common::rt::rtprintpanic!` to replace `sys_common::util` functionality This PR introduces a new macro `rtprintpanic!`, similar to `sys_common::util::dumb_print` and uses that macro to replace all `sys_common::util` functionality.
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
| -rw-r--r-- | library/std/src/sys/unix/stack_overflow.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/library/std/src/sys/unix/stack_overflow.rs b/library/std/src/sys/unix/stack_overflow.rs index 2a487fff54a..81f47a779d3 100644 --- a/library/std/src/sys/unix/stack_overflow.rs +++ b/library/std/src/sys/unix/stack_overflow.rs @@ -42,6 +42,7 @@ mod imp { use crate::io; use crate::mem; use crate::ptr; + use crate::thread; use libc::MAP_FAILED; use libc::{mmap, munmap}; @@ -95,15 +96,16 @@ mod imp { info: *mut libc::siginfo_t, _data: *mut libc::c_void, ) { - use crate::sys_common::util::report_overflow; - let guard = thread_info::stack_guard().unwrap_or(0..0); let addr = siginfo_si_addr(info); // If the faulting address is within the guard page, then we print a // message saying so and abort. if guard.start <= addr && addr < guard.end { - report_overflow(); + rtprintpanic!( + "\nthread '{}' has overflowed its stack\n", + thread::current().name().unwrap_or("<unknown>") + ); rtabort!("stack overflow"); } else { // Unregister ourselves by reverting back to the default behavior. |
