Skip to content

Commit 882390b

Browse files
committed
Print thread ID in panic message if thread name is unknown
`panic!` does not print any identifying information for threads that are unnamed. However, in many cases, the thread ID can be determined. This changes the panic message from something like this: thread '<unnamed>' panicked at src/main.rs:3:5: explicit panic To something like this: thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5: explicit panic Stack overflow messages are updated as well. This change applies to both named and unnamed threads. The ID printed is the OS integer thread ID rather than the Rust thread ID, which should also be what debuggers print.
1 parent eff75f8 commit 882390b

File tree

107 files changed

+274
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+274
-155
lines changed

library/std/src/panicking.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ fn default_hook(info: &PanicHookInfo<'_>) {
269269

270270
thread::with_current_name(|name| {
271271
let name = name.unwrap_or("<unnamed>");
272+
let tid = thread::current_os_id().unwrap_or_default();
272273

273274
// Try to write the panic message to a buffer first to prevent other concurrent outputs
274275
// interleaving with it.
@@ -277,7 +278,7 @@ fn default_hook(info: &PanicHookInfo<'_>) {
277278

278279
let write_msg = |dst: &mut dyn crate::io::Write| {
279280
// We add a newline to ensure the panic message appears at the start of a line.
280-
writeln!(dst, "\nthread '{name}' panicked at {location}:\n{msg}")
281+
writeln!(dst, "\nthread '{name}' ({tid:#x}) panicked at {location}:\n{msg}")
281282
};
282283

283284
if write_msg(&mut cursor).is_ok() {

library/std/src/sys/pal/hermit/thread.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ impl Thread {
103103
}
104104
}
105105

106+
pub(crate) fn current_os_id() -> Option<u64> {
107+
None
108+
}
109+
106110
pub fn available_parallelism() -> io::Result<NonZero<usize>> {
107111
unsafe { Ok(NonZero::new_unchecked(hermit_abi::available_parallelism())) }
108112
}

library/std/src/sys/pal/itron/thread.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ unsafe fn terminate_and_delete_current_task() -> ! {
349349
unsafe { crate::hint::unreachable_unchecked() };
350350
}
351351

352+
pub(crate) fn current_os_id() -> Option<u64> {
353+
None
354+
}
355+
352356
pub fn available_parallelism() -> io::Result<NonZero<usize>> {
353357
super::unsupported()
354358
}

library/std/src/sys/pal/teeos/thread.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ impl Drop for Thread {
132132
}
133133
}
134134

135+
pub(crate) fn current_os_id() -> Option<u64> {
136+
None
137+
}
138+
135139
// Note: Both `sched_getaffinity` and `sysconf` are available but not functional on
136140
// teeos, so this function always returns an Error!
137141
pub fn available_parallelism() -> io::Result<NonZero<usize>> {

library/std/src/sys/pal/uefi/thread.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ impl Thread {
4444
}
4545
}
4646

47+
pub(crate) fn current_os_id() -> Option<u64> {
48+
None
49+
}
50+
4751
pub fn available_parallelism() -> io::Result<NonZero<usize>> {
4852
// UEFI is single threaded
4953
Ok(NonZero::new(1).unwrap())

library/std/src/sys/pal/unix/stack_overflow.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ mod imp {
120120
&& thread_info.guard_page_range.contains(&fault_addr)
121121
{
122122
let name = thread_info.thread_name.as_deref().unwrap_or("<unknown>");
123-
rtprintpanic!("\nthread '{name}' has overflowed its stack\n");
123+
let tid = crate::thread::current_os_id().unwrap_or_default();
124+
rtprintpanic!("\nthread '{name}' ({tid:#x}) has overflowed its stack\n");
124125
rtabort!("stack overflow");
125126
}
126127
})
@@ -696,7 +697,8 @@ mod imp {
696697
if code == c::EXCEPTION_STACK_OVERFLOW {
697698
crate::thread::with_current_name(|name| {
698699
let name = name.unwrap_or("<unknown>");
699-
rtprintpanic!("\nthread '{name}' has overflowed its stack\n");
700+
let tid = crate::thread::current_os_id().unwrap_or_default();
701+
rtprintpanic!("\nthread '{name}' ({tid:#x}) has overflowed its stack\n");
700702
});
701703
}
702704
c::EXCEPTION_CONTINUE_SEARCH

library/std/src/sys/pal/unix/thread.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,44 @@ impl Drop for Thread {
318318
}
319319
}
320320

321+
pub(crate) fn current_os_id() -> Option<u64> {
322+
// Most Unix platforms have a way to query an integer ID of the current thread, all with
323+
// slightly different spellings.
324+
cfg_if::cfg_if! {
325+
// Most platforms have a function returning a `pid_t` or int, which is an `i32`.
326+
if #[cfg(any(target_os = "android", target_os = "linux", target_os = "nto"))] {
327+
// SAFETY: FFI call with no preconditions.
328+
let id: libc::pid_t = unsafe { libc::gettid() };
329+
Some(id as u64)
330+
} else if #[cfg(target_os = "openbsd")] {
331+
// SAFETY: FFI call with no preconditions.
332+
let id: libc::pid_t = unsafe { libc::getthrid() };
333+
Some(id as u64)
334+
} else if #[cfg(target_os = "freebsd")] {
335+
// SAFETY: FFI call with no preconditions.
336+
let id: libc::c_int = unsafe { libc::pthread_getthreadid_np() };
337+
Some(id as u64)
338+
} else if #[cfg(target_os = "netbsd")] {
339+
// SAFETY: FFI call with no preconditions.
340+
let id: libc::lwpid_t = unsafe { libc::_lwp_self() };
341+
Some(id as u64)
342+
} else if #[cfg(target_vendor = "apple")] {
343+
// Apple allows querying arbitrary thread IDs, `thread=NULL` queries the current thread.
344+
let mut id = 0u64;
345+
// SAFETY: `thread_id` is a valid pointer, no other preconditions.
346+
let status: libc::c_int = unsafe { libc::pthread_threadid_np(0, &mut id) };
347+
if status == 0 {
348+
Some(id)
349+
} else {
350+
None
351+
}
352+
} else {
353+
// As a fallback, return the pid which can be used to help identify a crashing process.
354+
Some(super::os::getpid().into())
355+
}
356+
}
357+
}
358+
321359
#[cfg(any(
322360
target_os = "linux",
323361
target_os = "nto",

library/std/src/sys/pal/unsupported/thread.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ impl Thread {
3131
}
3232
}
3333

34+
pub(crate) fn current_os_id() -> Option<u64> {
35+
None
36+
}
37+
3438
pub fn available_parallelism() -> io::Result<NonZero<usize>> {
3539
unsupported()
3640
}

library/std/src/sys/pal/wasi/thread.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ impl Thread {
186186
}
187187
}
188188

189+
pub(crate) fn current_os_id() -> Option<u64> {
190+
None
191+
}
192+
189193
pub fn available_parallelism() -> io::Result<NonZero<usize>> {
190194
cfg_if::cfg_if! {
191195
if #[cfg(target_feature = "atomics")] {

library/std/src/sys/pal/windows/c/bindings.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,6 +2177,7 @@ GetSystemInfo
21772177
GetSystemTimeAsFileTime
21782178
GetSystemTimePreciseAsFileTime
21792179
GetTempPathW
2180+
GetThreadId
21802181
GetUserProfileDirectoryW
21812182
GetWindowsDirectoryW
21822183
HANDLE

library/std/src/sys/pal/windows/c/windows_sys.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ windows_targets::link!("kernel32.dll" "system" fn GetSystemInfo(lpsysteminfo : *
6161
windows_targets::link!("kernel32.dll" "system" fn GetSystemTimeAsFileTime(lpsystemtimeasfiletime : *mut FILETIME));
6262
windows_targets::link!("kernel32.dll" "system" fn GetSystemTimePreciseAsFileTime(lpsystemtimeasfiletime : *mut FILETIME));
6363
windows_targets::link!("kernel32.dll" "system" fn GetTempPathW(nbufferlength : u32, lpbuffer : PWSTR) -> u32);
64+
windows_targets::link!("kernel32.dll" "system" fn GetThreadId(thread : HANDLE) -> u32);
6465
windows_targets::link!("userenv.dll" "system" fn GetUserProfileDirectoryW(htoken : HANDLE, lpprofiledir : PWSTR, lpcchsize : *mut u32) -> BOOL);
6566
windows_targets::link!("kernel32.dll" "system" fn GetWindowsDirectoryW(lpbuffer : PWSTR, usize : u32) -> u32);
6667
windows_targets::link!("kernel32.dll" "system" fn InitOnceBeginInitialize(lpinitonce : *mut INIT_ONCE, dwflags : u32, fpending : *mut BOOL, lpcontext : *mut *mut core::ffi::c_void) -> BOOL);

library/std/src/sys/pal/windows/stack_overflow.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ unsafe extern "system" fn vectored_handler(ExceptionInfo: *mut c::EXCEPTION_POIN
2020
if code == c::EXCEPTION_STACK_OVERFLOW {
2121
thread::with_current_name(|name| {
2222
let name = name.unwrap_or("<unknown>");
23-
rtprintpanic!("\nthread '{name}' has overflowed its stack\n");
23+
let tid = thread::current_os_id().unwrap_or_default();
24+
rtprintpanic!("\nthread '{name}' ({tid:#x}) has overflowed its stack\n");
2425
});
2526
}
2627
c::EXCEPTION_CONTINUE_SEARCH

library/std/src/sys/pal/windows/thread.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ impl Thread {
115115
}
116116
}
117117

118+
pub(crate) fn current_os_id() -> Option<u64> {
119+
// SAFETY: FFI call with no preconditions.
120+
let id: u32 = unsafe { c::GetThreadId(c::GetCurrentThread()) };
121+
122+
// A return value of 0 indicates failed lookup.
123+
if id == 0 { None } else { Some(id.into()) }
124+
}
125+
118126
pub fn available_parallelism() -> io::Result<NonZero<usize>> {
119127
let res = unsafe {
120128
let mut sysinfo: c::SYSTEM_INFO = crate::mem::zeroed();

library/std/src/sys/pal/xous/thread.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ impl Thread {
133133
}
134134
}
135135

136+
pub(crate) fn current_os_id() -> Option<u64> {
137+
None
138+
}
139+
136140
pub fn available_parallelism() -> io::Result<NonZero<usize>> {
137141
// We're unicore right now.
138142
Ok(unsafe { NonZero::new_unchecked(1) })

library/std/src/thread/current.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{Thread, ThreadId};
1+
use super::{Thread, ThreadId, imp};
22
use crate::mem::ManuallyDrop;
33
use crate::ptr;
44
use crate::sys::thread_local::local_pointer;
@@ -148,6 +148,15 @@ pub(crate) fn current_id() -> ThreadId {
148148
id::get_or_init()
149149
}
150150

151+
/// Gets the OS thread ID of the thread that invokes it, if available.
152+
///
153+
/// We use a `u64` to fit either integer or pointer IDs on all platforms without excess `cfg`. This
154+
/// is a "best effort" approach for diagnostics and is allowed to fall back to a non-unique ID (such
155+
/// as PID) if the thread ID cannot be retrieved.
156+
pub(crate) fn current_os_id() -> Option<u64> {
157+
imp::current_os_id()
158+
}
159+
151160
/// Gets a reference to the handle of the thread that invokes it, if the handle
152161
/// has been initialized.
153162
pub(super) fn try_with_current<F, R>(f: F) -> R

library/std/src/thread/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ mod current;
183183

184184
#[stable(feature = "rust1", since = "1.0.0")]
185185
pub use current::current;
186-
pub(crate) use current::{current_id, current_or_unnamed, drop_current};
186+
pub(crate) use current::{current_id, current_or_unnamed, current_os_id, drop_current};
187187
use current::{set_current, try_with_current};
188188

189189
mod spawnhook;

library/std/src/thread/tests.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,19 @@ fn test_thread_id_not_equal() {
346346
assert!(thread::current().id() != spawned_id);
347347
}
348348

349+
#[test]
350+
fn test_thread_os_id_not_equal() {
351+
let spawned_id = thread::spawn(|| thread::current_os_id()).join().unwrap();
352+
let current_id = thread::current_os_id();
353+
354+
// Spot check on platforms that we know should be able to query a TID.
355+
if cfg!(target_os = "linux") || cfg!(target_vendor = "apple") || cfg!(target_os = "windows") {
356+
assert!(spawned_id.is_some());
357+
assert!(current_id.is_some());
358+
assert!(current_id != spawned_id);
359+
}
360+
}
361+
349362
#[test]
350363
fn test_scoped_threads_drop_result_before_join() {
351364
let actually_finished = &AtomicBool::new(false);

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66

7-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7+
thread 'main' ($HEX) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88
panic in a function that cannot unwind
99
stack backtrace:
1010
thread caused non-unwinding panic. aborting.

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66

7-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7+
thread 'main' ($HEX) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88
panic in a function that cannot unwind
99
stack backtrace:
1010
thread caused non-unwinding panic. aborting.

src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
33
aborted execution: attempted to instantiate uninhabited type `!`
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
33
aborted execution: attempted to zero-initialize type `fn()`, which is invalid
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/panic/abort_unwind.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
thread 'main' panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
33
PANIC!!!
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66

7-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7+
thread 'main' ($HEX) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88
panic in a function that cannot unwind
99
stack backtrace:
1010
thread caused non-unwinding panic. aborting.

src/tools/miri/tests/fail/panic/bad_unwind.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/panic/bad_unwind.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/panic/bad_unwind.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/panic/double_panic.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

2-
thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/panic/double_panic.rs:LL:CC:
33
first
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66

7-
thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
7+
thread 'main' ($HEX) panicked at tests/fail/panic/double_panic.rs:LL:CC:
88
second
99
stack backtrace:
1010

11-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
11+
thread 'main' ($HEX) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
1212
panic in a destructor during cleanup
1313
thread caused non-unwinding panic. aborting.
1414
error: abnormal termination: the program aborted execution

src/tools/miri/tests/fail/panic/panic_abort1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/panic/panic_abort1.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/panic/panic_abort1.rs:LL:CC:
33
panicking from libstd
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/panic/panic_abort2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
33
42-panicking from libstd
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/panic/panic_abort3.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/panic/panic_abort3.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/panic/panic_abort3.rs:LL:CC:
33
panicking from libcore
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/panic/panic_abort4.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/panic/panic_abort4.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/panic/panic_abort4.rs:LL:CC:
33
42-panicking from libcore
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread $NAME panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC:
2+
thread $NAME ($HEX) panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC:
33
ow
44
fatal runtime error: thread local panicked on drop, aborting
55
error: abnormal termination: the program aborted execution

src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread $NAME panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC:
2+
thread $NAME ($HEX) panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC:
33
ow
44
fatal runtime error: thread local panicked on drop, aborting
55
error: abnormal termination: the program aborted execution

src/tools/miri/tests/fail/ptr_swap_nonoverlapping.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/ptr_swap_nonoverlapping.rs:LL:CC:
2+
thread 'main' ($HEX) panicked at tests/fail/ptr_swap_nonoverlapping.rs:LL:CC:
33
unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap
44

55
This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.

0 commit comments

Comments
 (0)