Auto merge of #142556 - RalfJung:miri-sync, r=RalfJung
Miri subtree update r? `@ghost`
This commit is contained in:
commit
d9ca9bd014
568 changed files with 882 additions and 1013 deletions
|
|
@ -1 +1 @@
|
|||
c6768de2d63de7a41124a0fb8fc78f9e26111c01
|
||||
0cbc0764380630780a275c437260e4d4d5f28c92
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ impl MutexRef {
|
|||
fn new() -> Self {
|
||||
MutexRef(Rc::new(RefCell::new(Mutex::default())))
|
||||
}
|
||||
|
||||
/// Get the id of the thread that currently owns this lock, or `None` if it is not locked.
|
||||
pub fn owner(&self) -> Option<ThreadId> {
|
||||
self.0.borrow().owner
|
||||
}
|
||||
}
|
||||
|
||||
impl VisitProvenance for MutexRef {
|
||||
|
|
@ -75,8 +80,6 @@ impl VisitProvenance for MutexRef {
|
|||
}
|
||||
}
|
||||
|
||||
declare_id!(RwLockId);
|
||||
|
||||
/// The read-write lock state.
|
||||
#[derive(Default, Debug)]
|
||||
struct RwLock {
|
||||
|
|
@ -111,6 +114,49 @@ struct RwLock {
|
|||
clock_current_readers: VClock,
|
||||
}
|
||||
|
||||
impl RwLock {
|
||||
#[inline]
|
||||
/// Check if locked.
|
||||
fn is_locked(&self) -> bool {
|
||||
trace!(
|
||||
"rwlock_is_locked: writer is {:?} and there are {} reader threads (some of which could hold multiple read locks)",
|
||||
self.writer,
|
||||
self.readers.len(),
|
||||
);
|
||||
self.writer.is_some() || self.readers.is_empty().not()
|
||||
}
|
||||
|
||||
/// Check if write locked.
|
||||
#[inline]
|
||||
fn is_write_locked(&self) -> bool {
|
||||
trace!("rwlock_is_write_locked: writer is {:?}", self.writer);
|
||||
self.writer.is_some()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug)]
|
||||
pub struct RwLockRef(Rc<RefCell<RwLock>>);
|
||||
|
||||
impl RwLockRef {
|
||||
fn new() -> Self {
|
||||
RwLockRef(Rc::new(RefCell::new(RwLock::default())))
|
||||
}
|
||||
|
||||
pub fn is_locked(&self) -> bool {
|
||||
self.0.borrow().is_locked()
|
||||
}
|
||||
|
||||
pub fn is_write_locked(&self) -> bool {
|
||||
self.0.borrow().is_write_locked()
|
||||
}
|
||||
}
|
||||
|
||||
impl VisitProvenance for RwLockRef {
|
||||
fn visit_provenance(&self, _visit: &mut VisitWith<'_>) {
|
||||
// RwLockRef contains no provenance.
|
||||
}
|
||||
}
|
||||
|
||||
declare_id!(CondvarId);
|
||||
|
||||
/// The conditional variable state.
|
||||
|
|
@ -164,7 +210,6 @@ struct FutexWaiter {
|
|||
/// The state of all synchronization objects.
|
||||
#[derive(Default, Debug)]
|
||||
pub struct SynchronizationObjects {
|
||||
rwlocks: IndexVec<RwLockId, RwLock>,
|
||||
condvars: IndexVec<CondvarId, Condvar>,
|
||||
pub(super) init_onces: IndexVec<InitOnceId, InitOnce>,
|
||||
}
|
||||
|
|
@ -174,17 +219,17 @@ impl<'tcx> EvalContextExtPriv<'tcx> for crate::MiriInterpCx<'tcx> {}
|
|||
pub(super) trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
||||
fn condvar_reacquire_mutex(
|
||||
&mut self,
|
||||
mutex_ref: &MutexRef,
|
||||
mutex_ref: MutexRef,
|
||||
retval: Scalar,
|
||||
dest: MPlaceTy<'tcx>,
|
||||
) -> InterpResult<'tcx> {
|
||||
let this = self.eval_context_mut();
|
||||
if this.mutex_is_locked(mutex_ref) {
|
||||
assert_ne!(this.mutex_get_owner(mutex_ref), this.active_thread());
|
||||
if let Some(owner) = mutex_ref.owner() {
|
||||
assert_ne!(owner, this.active_thread());
|
||||
this.mutex_enqueue_and_block(mutex_ref, Some((retval, dest)));
|
||||
} else {
|
||||
// We can have it right now!
|
||||
this.mutex_lock(mutex_ref);
|
||||
this.mutex_lock(&mutex_ref);
|
||||
// Don't forget to write the return value.
|
||||
this.write_scalar(retval, &dest)?;
|
||||
}
|
||||
|
|
@ -196,8 +241,8 @@ impl SynchronizationObjects {
|
|||
pub fn mutex_create(&mut self) -> MutexRef {
|
||||
MutexRef::new()
|
||||
}
|
||||
pub fn rwlock_create(&mut self) -> RwLockId {
|
||||
self.rwlocks.push(Default::default())
|
||||
pub fn rwlock_create(&mut self) -> RwLockRef {
|
||||
RwLockRef::new()
|
||||
}
|
||||
|
||||
pub fn condvar_create(&mut self) -> CondvarId {
|
||||
|
|
@ -334,18 +379,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
Some(alloc_extra.get_sync::<T>(offset).unwrap())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Get the id of the thread that currently owns this lock.
|
||||
fn mutex_get_owner(&self, mutex_ref: &MutexRef) -> ThreadId {
|
||||
mutex_ref.0.borrow().owner.unwrap()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Check if locked.
|
||||
fn mutex_is_locked(&self, mutex_ref: &MutexRef) -> bool {
|
||||
mutex_ref.0.borrow().owner.is_some()
|
||||
}
|
||||
|
||||
/// Lock by setting the mutex owner and increasing the lock count.
|
||||
fn mutex_lock(&mut self, mutex_ref: &MutexRef) {
|
||||
let this = self.eval_context_mut();
|
||||
|
|
@ -413,14 +446,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
#[inline]
|
||||
fn mutex_enqueue_and_block(
|
||||
&mut self,
|
||||
mutex_ref: &MutexRef,
|
||||
mutex_ref: MutexRef,
|
||||
retval_dest: Option<(Scalar, MPlaceTy<'tcx>)>,
|
||||
) {
|
||||
let this = self.eval_context_mut();
|
||||
assert!(this.mutex_is_locked(mutex_ref), "queuing on unlocked mutex");
|
||||
let thread = this.active_thread();
|
||||
mutex_ref.0.borrow_mut().queue.push_back(thread);
|
||||
let mutex_ref = mutex_ref.clone();
|
||||
let mut mutex = mutex_ref.0.borrow_mut();
|
||||
mutex.queue.push_back(thread);
|
||||
assert!(mutex.owner.is_some(), "queuing on unlocked mutex");
|
||||
drop(mutex);
|
||||
this.block_thread(
|
||||
BlockReason::Mutex,
|
||||
None,
|
||||
|
|
@ -432,7 +466,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
|this, unblock: UnblockKind| {
|
||||
assert_eq!(unblock, UnblockKind::Ready);
|
||||
|
||||
assert!(!this.mutex_is_locked(&mutex_ref));
|
||||
assert!(mutex_ref.owner().is_none());
|
||||
this.mutex_lock(&mutex_ref);
|
||||
|
||||
if let Some((retval, dest)) = retval_dest {
|
||||
|
|
@ -445,37 +479,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Check if locked.
|
||||
fn rwlock_is_locked(&self, id: RwLockId) -> bool {
|
||||
let this = self.eval_context_ref();
|
||||
let rwlock = &this.machine.sync.rwlocks[id];
|
||||
trace!(
|
||||
"rwlock_is_locked: {:?} writer is {:?} and there are {} reader threads (some of which could hold multiple read locks)",
|
||||
id,
|
||||
rwlock.writer,
|
||||
rwlock.readers.len(),
|
||||
);
|
||||
rwlock.writer.is_some() || rwlock.readers.is_empty().not()
|
||||
}
|
||||
|
||||
/// Check if write locked.
|
||||
#[inline]
|
||||
fn rwlock_is_write_locked(&self, id: RwLockId) -> bool {
|
||||
let this = self.eval_context_ref();
|
||||
let rwlock = &this.machine.sync.rwlocks[id];
|
||||
trace!("rwlock_is_write_locked: {:?} writer is {:?}", id, rwlock.writer);
|
||||
rwlock.writer.is_some()
|
||||
}
|
||||
|
||||
/// Read-lock the lock by adding the `reader` the list of threads that own
|
||||
/// this lock.
|
||||
fn rwlock_reader_lock(&mut self, id: RwLockId) {
|
||||
fn rwlock_reader_lock(&mut self, rwlock_ref: &RwLockRef) {
|
||||
let this = self.eval_context_mut();
|
||||
let thread = this.active_thread();
|
||||
assert!(!this.rwlock_is_write_locked(id), "the lock is write locked");
|
||||
trace!("rwlock_reader_lock: {:?} now also held (one more time) by {:?}", id, thread);
|
||||
let rwlock = &mut this.machine.sync.rwlocks[id];
|
||||
trace!("rwlock_reader_lock: now also held (one more time) by {:?}", thread);
|
||||
let mut rwlock = rwlock_ref.0.borrow_mut();
|
||||
assert!(!rwlock.is_write_locked(), "the lock is write locked");
|
||||
let count = rwlock.readers.entry(thread).or_insert(0);
|
||||
*count = count.strict_add(1);
|
||||
if let Some(data_race) = this.machine.data_race.as_vclocks_ref() {
|
||||
|
|
@ -485,20 +496,20 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
|
||||
/// Try read-unlock the lock for the current threads and potentially give the lock to a new owner.
|
||||
/// Returns `true` if succeeded, `false` if this `reader` did not hold the lock.
|
||||
fn rwlock_reader_unlock(&mut self, id: RwLockId) -> InterpResult<'tcx, bool> {
|
||||
fn rwlock_reader_unlock(&mut self, rwlock_ref: &RwLockRef) -> InterpResult<'tcx, bool> {
|
||||
let this = self.eval_context_mut();
|
||||
let thread = this.active_thread();
|
||||
let rwlock = &mut this.machine.sync.rwlocks[id];
|
||||
let mut rwlock = rwlock_ref.0.borrow_mut();
|
||||
match rwlock.readers.entry(thread) {
|
||||
Entry::Occupied(mut entry) => {
|
||||
let count = entry.get_mut();
|
||||
assert!(*count > 0, "rwlock locked with count == 0");
|
||||
*count -= 1;
|
||||
if *count == 0 {
|
||||
trace!("rwlock_reader_unlock: {:?} no longer held by {:?}", id, thread);
|
||||
trace!("rwlock_reader_unlock: no longer held by {:?}", thread);
|
||||
entry.remove();
|
||||
} else {
|
||||
trace!("rwlock_reader_unlock: {:?} held one less time by {:?}", id, thread);
|
||||
trace!("rwlock_reader_unlock: held one less time by {:?}", thread);
|
||||
}
|
||||
}
|
||||
Entry::Vacant(_) => return interp_ok(false), // we did not even own this lock
|
||||
|
|
@ -511,15 +522,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
}
|
||||
|
||||
// The thread was a reader. If the lock is not held any more, give it to a writer.
|
||||
if this.rwlock_is_locked(id).not() {
|
||||
if rwlock.is_locked().not() {
|
||||
// All the readers are finished, so set the writer data-race handle to the value
|
||||
// of the union of all reader data race handles, since the set of readers
|
||||
// happen-before the writers
|
||||
let rwlock = &mut this.machine.sync.rwlocks[id];
|
||||
rwlock.clock_unlocked.clone_from(&rwlock.clock_current_readers);
|
||||
let rwlock_ref = &mut *rwlock;
|
||||
rwlock_ref.clock_unlocked.clone_from(&rwlock_ref.clock_current_readers);
|
||||
// See if there is a thread to unblock.
|
||||
if let Some(writer) = rwlock.writer_queue.pop_front() {
|
||||
this.unblock_thread(writer, BlockReason::RwLock(id))?;
|
||||
if let Some(writer) = rwlock_ref.writer_queue.pop_front() {
|
||||
drop(rwlock); // make RefCell available for unblock callback
|
||||
this.unblock_thread(writer, BlockReason::RwLock)?;
|
||||
}
|
||||
}
|
||||
interp_ok(true)
|
||||
|
|
@ -530,26 +542,28 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
#[inline]
|
||||
fn rwlock_enqueue_and_block_reader(
|
||||
&mut self,
|
||||
id: RwLockId,
|
||||
rwlock_ref: RwLockRef,
|
||||
retval: Scalar,
|
||||
dest: MPlaceTy<'tcx>,
|
||||
) {
|
||||
let this = self.eval_context_mut();
|
||||
let thread = this.active_thread();
|
||||
assert!(this.rwlock_is_write_locked(id), "read-queueing on not write locked rwlock");
|
||||
this.machine.sync.rwlocks[id].reader_queue.push_back(thread);
|
||||
let mut rwlock = rwlock_ref.0.borrow_mut();
|
||||
rwlock.reader_queue.push_back(thread);
|
||||
assert!(rwlock.is_write_locked(), "read-queueing on not write locked rwlock");
|
||||
drop(rwlock);
|
||||
this.block_thread(
|
||||
BlockReason::RwLock(id),
|
||||
BlockReason::RwLock,
|
||||
None,
|
||||
callback!(
|
||||
@capture<'tcx> {
|
||||
id: RwLockId,
|
||||
rwlock_ref: RwLockRef,
|
||||
retval: Scalar,
|
||||
dest: MPlaceTy<'tcx>,
|
||||
}
|
||||
|this, unblock: UnblockKind| {
|
||||
assert_eq!(unblock, UnblockKind::Ready);
|
||||
this.rwlock_reader_lock(id);
|
||||
this.rwlock_reader_lock(&rwlock_ref);
|
||||
this.write_scalar(retval, &dest)?;
|
||||
interp_ok(())
|
||||
}
|
||||
|
|
@ -559,12 +573,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
|
||||
/// Lock by setting the writer that owns the lock.
|
||||
#[inline]
|
||||
fn rwlock_writer_lock(&mut self, id: RwLockId) {
|
||||
fn rwlock_writer_lock(&mut self, rwlock_ref: &RwLockRef) {
|
||||
let this = self.eval_context_mut();
|
||||
let thread = this.active_thread();
|
||||
assert!(!this.rwlock_is_locked(id), "the rwlock is already locked");
|
||||
trace!("rwlock_writer_lock: {:?} now held by {:?}", id, thread);
|
||||
let rwlock = &mut this.machine.sync.rwlocks[id];
|
||||
trace!("rwlock_writer_lock: now held by {:?}", thread);
|
||||
|
||||
let mut rwlock = rwlock_ref.0.borrow_mut();
|
||||
assert!(!rwlock.is_locked(), "the rwlock is already locked");
|
||||
rwlock.writer = Some(thread);
|
||||
if let Some(data_race) = this.machine.data_race.as_vclocks_ref() {
|
||||
data_race.acquire_clock(&rwlock.clock_unlocked, &this.machine.threads);
|
||||
|
|
@ -574,35 +589,38 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
/// Try to unlock an rwlock held by the current thread.
|
||||
/// Return `false` if it is held by another thread.
|
||||
#[inline]
|
||||
fn rwlock_writer_unlock(&mut self, id: RwLockId) -> InterpResult<'tcx, bool> {
|
||||
fn rwlock_writer_unlock(&mut self, rwlock_ref: &RwLockRef) -> InterpResult<'tcx, bool> {
|
||||
let this = self.eval_context_mut();
|
||||
let thread = this.active_thread();
|
||||
let rwlock = &mut this.machine.sync.rwlocks[id];
|
||||
let mut rwlock = rwlock_ref.0.borrow_mut();
|
||||
interp_ok(if let Some(current_writer) = rwlock.writer {
|
||||
if current_writer != thread {
|
||||
// Only the owner can unlock the rwlock.
|
||||
return interp_ok(false);
|
||||
}
|
||||
rwlock.writer = None;
|
||||
trace!("rwlock_writer_unlock: {:?} unlocked by {:?}", id, thread);
|
||||
trace!("rwlock_writer_unlock: unlocked by {:?}", thread);
|
||||
// Record release clock for next lock holder.
|
||||
if let Some(data_race) = this.machine.data_race.as_vclocks_ref() {
|
||||
data_race.release_clock(&this.machine.threads, |clock| {
|
||||
rwlock.clock_unlocked.clone_from(clock)
|
||||
});
|
||||
}
|
||||
|
||||
// The thread was a writer.
|
||||
//
|
||||
// We are prioritizing writers here against the readers. As a
|
||||
// result, not only readers can starve writers, but also writers can
|
||||
// starve readers.
|
||||
if let Some(writer) = rwlock.writer_queue.pop_front() {
|
||||
this.unblock_thread(writer, BlockReason::RwLock(id))?;
|
||||
drop(rwlock); // make RefCell available for unblock callback
|
||||
this.unblock_thread(writer, BlockReason::RwLock)?;
|
||||
} else {
|
||||
// Take the entire read queue and wake them all up.
|
||||
let readers = std::mem::take(&mut rwlock.reader_queue);
|
||||
drop(rwlock); // make RefCell available for unblock callback
|
||||
for reader in readers {
|
||||
this.unblock_thread(reader, BlockReason::RwLock(id))?;
|
||||
this.unblock_thread(reader, BlockReason::RwLock)?;
|
||||
}
|
||||
}
|
||||
true
|
||||
|
|
@ -616,26 +634,28 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
#[inline]
|
||||
fn rwlock_enqueue_and_block_writer(
|
||||
&mut self,
|
||||
id: RwLockId,
|
||||
rwlock_ref: RwLockRef,
|
||||
retval: Scalar,
|
||||
dest: MPlaceTy<'tcx>,
|
||||
) {
|
||||
let this = self.eval_context_mut();
|
||||
assert!(this.rwlock_is_locked(id), "write-queueing on unlocked rwlock");
|
||||
let thread = this.active_thread();
|
||||
this.machine.sync.rwlocks[id].writer_queue.push_back(thread);
|
||||
let mut rwlock = rwlock_ref.0.borrow_mut();
|
||||
rwlock.writer_queue.push_back(thread);
|
||||
assert!(rwlock.is_locked(), "write-queueing on unlocked rwlock");
|
||||
drop(rwlock);
|
||||
this.block_thread(
|
||||
BlockReason::RwLock(id),
|
||||
BlockReason::RwLock,
|
||||
None,
|
||||
callback!(
|
||||
@capture<'tcx> {
|
||||
id: RwLockId,
|
||||
rwlock_ref: RwLockRef,
|
||||
retval: Scalar,
|
||||
dest: MPlaceTy<'tcx>,
|
||||
}
|
||||
|this, unblock: UnblockKind| {
|
||||
assert_eq!(unblock, UnblockKind::Ready);
|
||||
this.rwlock_writer_lock(id);
|
||||
this.rwlock_writer_lock(&rwlock_ref);
|
||||
this.write_scalar(retval, &dest)?;
|
||||
interp_ok(())
|
||||
}
|
||||
|
|
@ -700,7 +720,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
}
|
||||
// Try to acquire the mutex.
|
||||
// The timeout only applies to the first wait (until the signal), not for mutex acquisition.
|
||||
this.condvar_reacquire_mutex(&mutex_ref, retval_succ, dest)
|
||||
this.condvar_reacquire_mutex(mutex_ref, retval_succ, dest)
|
||||
}
|
||||
UnblockKind::TimedOut => {
|
||||
// We have to remove the waiter from the queue again.
|
||||
|
|
@ -708,7 +728,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
let waiters = &mut this.machine.sync.condvars[condvar].waiters;
|
||||
waiters.retain(|waiter| *waiter != thread);
|
||||
// Now get back the lock.
|
||||
this.condvar_reacquire_mutex(&mutex_ref, retval_timeout, dest)
|
||||
this.condvar_reacquire_mutex(mutex_ref, retval_timeout, dest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ pub enum BlockReason {
|
|||
/// Blocked on a condition variable.
|
||||
Condvar(CondvarId),
|
||||
/// Blocked on a reader-writer lock.
|
||||
RwLock(RwLockId),
|
||||
RwLock,
|
||||
/// Blocked on a Futex variable.
|
||||
Futex,
|
||||
/// Blocked on an InitOnce.
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ impl fmt::Display for TerminationInfo {
|
|||
DataRace { involves_non_atomic, ptr, op1, op2, .. } =>
|
||||
write!(
|
||||
f,
|
||||
"{} detected between (1) {} on {} and (2) {} on {} at {ptr:?}. (2) just happened here",
|
||||
"{} detected between (1) {} on {} and (2) {} on {} at {ptr:?}",
|
||||
if *involves_non_atomic { "Data race" } else { "Race condition" },
|
||||
op1.action,
|
||||
op1.thread_info,
|
||||
|
|
@ -224,7 +224,7 @@ pub fn report_error<'tcx>(
|
|||
use InterpErrorKind::*;
|
||||
use UndefinedBehaviorInfo::*;
|
||||
|
||||
let mut msg = vec![];
|
||||
let mut labels = vec![];
|
||||
|
||||
let (title, helps) = if let MachineStop(info) = e.kind() {
|
||||
let info = info.downcast_ref::<TerminationInfo>().expect("invalid MachineStop payload");
|
||||
|
|
@ -237,7 +237,10 @@ pub fn report_error<'tcx>(
|
|||
Some("unsupported operation"),
|
||||
StackedBorrowsUb { .. } | TreeBorrowsUb { .. } | DataRace { .. } =>
|
||||
Some("Undefined Behavior"),
|
||||
Deadlock => Some("deadlock"),
|
||||
Deadlock => {
|
||||
labels.push(format!("this thread got stuck here"));
|
||||
None
|
||||
}
|
||||
GenmcStuckExecution => {
|
||||
// This case should only happen in GenMC mode. We treat it like a normal program exit.
|
||||
assert!(ecx.machine.data_race.as_genmc_ref().is_some());
|
||||
|
|
@ -259,7 +262,7 @@ pub fn report_error<'tcx>(
|
|||
]
|
||||
}
|
||||
StackedBorrowsUb { help, history, .. } => {
|
||||
msg.extend(help.clone());
|
||||
labels.extend(help.clone());
|
||||
let mut helps = vec![
|
||||
note!("this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental"),
|
||||
note!("see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information"),
|
||||
|
|
@ -297,6 +300,7 @@ pub fn report_error<'tcx>(
|
|||
Int2PtrWithStrictProvenance =>
|
||||
vec![note!("use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead")],
|
||||
DataRace { op1, extra, retag_explain, .. } => {
|
||||
labels.push(format!("(2) just happened here"));
|
||||
let mut helps = vec![note_span!(op1.span, "and (1) occurred earlier here")];
|
||||
if let Some(extra) = extra {
|
||||
helps.push(note!("{extra}"));
|
||||
|
|
@ -426,12 +430,20 @@ pub fn report_error<'tcx>(
|
|||
_ => {}
|
||||
}
|
||||
|
||||
msg.insert(0, format_interp_error(ecx.tcx.dcx(), e));
|
||||
let mut primary_msg = String::new();
|
||||
if let Some(title) = title {
|
||||
write!(primary_msg, "{title}: ").unwrap();
|
||||
}
|
||||
write!(primary_msg, "{}", format_interp_error(ecx.tcx.dcx(), e)).unwrap();
|
||||
|
||||
if labels.is_empty() {
|
||||
labels.push(format!("{} occurred here", title.unwrap_or("error")));
|
||||
}
|
||||
|
||||
report_msg(
|
||||
DiagLevel::Error,
|
||||
if let Some(title) = title { format!("{title}: {}", msg[0]) } else { msg[0].clone() },
|
||||
msg,
|
||||
primary_msg,
|
||||
labels,
|
||||
vec![],
|
||||
helps,
|
||||
&stacktrace,
|
||||
|
|
@ -449,8 +461,8 @@ pub fn report_error<'tcx>(
|
|||
any_pruned |= was_pruned;
|
||||
report_msg(
|
||||
DiagLevel::Error,
|
||||
format!("deadlock: the evaluated program deadlocked"),
|
||||
vec![format!("the evaluated program deadlocked")],
|
||||
format!("the evaluated program deadlocked"),
|
||||
vec![format!("this thread got stuck here")],
|
||||
vec![],
|
||||
vec![],
|
||||
&stacktrace,
|
||||
|
|
@ -611,7 +623,7 @@ impl<'tcx> MiriMachine<'tcx> {
|
|||
let stacktrace = Frame::generate_stacktrace_from_stack(self.threads.active_thread_stack());
|
||||
let (stacktrace, _was_pruned) = prune_stacktrace(stacktrace, self);
|
||||
|
||||
let (title, diag_level) = match &e {
|
||||
let (label, diag_level) = match &e {
|
||||
RejectedIsolatedOp(_) =>
|
||||
("operation rejected by isolation".to_string(), DiagLevel::Warning),
|
||||
Int2Ptr { .. } => ("integer-to-pointer cast".to_string(), DiagLevel::Warning),
|
||||
|
|
@ -626,10 +638,10 @@ impl<'tcx> MiriMachine<'tcx> {
|
|||
| FreedAlloc(..)
|
||||
| ProgressReport { .. }
|
||||
| WeakMemoryOutdatedLoad { .. } =>
|
||||
("tracking was triggered".to_string(), DiagLevel::Note),
|
||||
("tracking was triggered here".to_string(), DiagLevel::Note),
|
||||
};
|
||||
|
||||
let msg = match &e {
|
||||
let title = match &e {
|
||||
CreatedPointerTag(tag, None, _) => format!("created base tag {tag:?}"),
|
||||
CreatedPointerTag(tag, Some(perm), None) =>
|
||||
format!("created {tag:?} with {perm} derived from unknown tag"),
|
||||
|
|
@ -735,7 +747,7 @@ impl<'tcx> MiriMachine<'tcx> {
|
|||
report_msg(
|
||||
diag_level,
|
||||
title,
|
||||
vec![msg],
|
||||
vec![label],
|
||||
notes,
|
||||
helps,
|
||||
&stacktrace,
|
||||
|
|
|
|||
|
|
@ -292,11 +292,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
let b = this.read_scalar(b)?.to_f32()?;
|
||||
let c = this.read_scalar(c)?.to_f32()?;
|
||||
let fuse: bool = this.machine.float_nondet && this.machine.rng.get_mut().random();
|
||||
let res = if fuse {
|
||||
a.mul_add(b, c).value
|
||||
} else {
|
||||
((a * b).value + c).value
|
||||
};
|
||||
let res = if fuse { a.mul_add(b, c).value } else { ((a * b).value + c).value };
|
||||
let res = this.adjust_nan(res, &[a, b, c]);
|
||||
this.write_scalar(res, dest)?;
|
||||
}
|
||||
|
|
@ -306,11 +302,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
let b = this.read_scalar(b)?.to_f64()?;
|
||||
let c = this.read_scalar(c)?.to_f64()?;
|
||||
let fuse: bool = this.machine.float_nondet && this.machine.rng.get_mut().random();
|
||||
let res = if fuse {
|
||||
a.mul_add(b, c).value
|
||||
} else {
|
||||
((a * b).value + c).value
|
||||
};
|
||||
let res = if fuse { a.mul_add(b, c).value } else { ((a * b).value + c).value };
|
||||
let res = this.adjust_nan(res, &[a, b, c]);
|
||||
this.write_scalar(res, dest)?;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ pub use crate::concurrency::data_race::{
|
|||
};
|
||||
pub use crate::concurrency::init_once::{EvalContextExt as _, InitOnceId};
|
||||
pub use crate::concurrency::sync::{
|
||||
CondvarId, EvalContextExt as _, MutexRef, RwLockId, SynchronizationObjects,
|
||||
CondvarId, EvalContextExt as _, MutexRef, RwLockRef, SynchronizationObjects,
|
||||
};
|
||||
pub use crate::concurrency::thread::{
|
||||
BlockReason, DynUnblockCallback, EvalContextExt as _, StackEmptyCallback, ThreadId,
|
||||
|
|
|
|||
|
|
@ -289,15 +289,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
};
|
||||
let mutex_ref = mutex_ref.clone();
|
||||
|
||||
if this.mutex_is_locked(&mutex_ref) {
|
||||
if this.mutex_get_owner(&mutex_ref) == this.active_thread() {
|
||||
if let Some(owner) = mutex_ref.owner() {
|
||||
if owner == this.active_thread() {
|
||||
// Matching the current macOS implementation: abort on reentrant locking.
|
||||
throw_machine_stop!(TerminationInfo::Abort(
|
||||
"attempted to lock an os_unfair_lock that is already locked by the current thread".to_owned()
|
||||
));
|
||||
}
|
||||
|
||||
this.mutex_enqueue_and_block(&mutex_ref, None);
|
||||
this.mutex_enqueue_and_block(mutex_ref, None);
|
||||
} else {
|
||||
this.mutex_lock(&mutex_ref);
|
||||
}
|
||||
|
|
@ -319,7 +319,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
};
|
||||
let mutex_ref = mutex_ref.clone();
|
||||
|
||||
if this.mutex_is_locked(&mutex_ref) {
|
||||
if mutex_ref.owner().is_some() {
|
||||
// Contrary to the blocking lock function, this does not check for
|
||||
// reentrancy.
|
||||
this.write_scalar(Scalar::from_bool(false), dest)?;
|
||||
|
|
@ -350,9 +350,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
));
|
||||
}
|
||||
|
||||
// If the lock is not locked by anyone now, it went quer.
|
||||
// If the lock is not locked by anyone now, it went quiet.
|
||||
// Reset to zero so that it can be moved and initialized again for the next phase.
|
||||
if !this.mutex_is_locked(&mutex_ref) {
|
||||
if mutex_ref.owner().is_none() {
|
||||
let lock_place = this.deref_pointer_as(lock_op, this.machine.layouts.u32)?;
|
||||
this.write_scalar_atomic(Scalar::from_u32(0), &lock_place, AtomicWriteOrd::Relaxed)?;
|
||||
}
|
||||
|
|
@ -371,9 +371,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
};
|
||||
let mutex_ref = mutex_ref.clone();
|
||||
|
||||
if !this.mutex_is_locked(&mutex_ref)
|
||||
|| this.mutex_get_owner(&mutex_ref) != this.active_thread()
|
||||
{
|
||||
if mutex_ref.owner().is_none_or(|o| o != this.active_thread()) {
|
||||
throw_machine_stop!(TerminationInfo::Abort(
|
||||
"called os_unfair_lock_assert_owner on an os_unfair_lock not owned by the current thread".to_owned()
|
||||
));
|
||||
|
|
@ -393,17 +391,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
};
|
||||
let mutex_ref = mutex_ref.clone();
|
||||
|
||||
if this.mutex_is_locked(&mutex_ref)
|
||||
&& this.mutex_get_owner(&mutex_ref) == this.active_thread()
|
||||
{
|
||||
if mutex_ref.owner().is_some_and(|o| o == this.active_thread()) {
|
||||
throw_machine_stop!(TerminationInfo::Abort(
|
||||
"called os_unfair_lock_assert_not_owner on an os_unfair_lock owned by the current thread".to_owned()
|
||||
));
|
||||
}
|
||||
|
||||
// If the lock is not locked by anyone now, it went quer.
|
||||
// If the lock is not locked by anyone now, it went quiet.
|
||||
// Reset to zero so that it can be moved and initialized again for the next phase.
|
||||
if !this.mutex_is_locked(&mutex_ref) {
|
||||
if mutex_ref.owner().is_none() {
|
||||
let lock_place = this.deref_pointer_as(lock_op, this.machine.layouts.u32)?;
|
||||
this.write_scalar_atomic(Scalar::from_u32(0), &lock_place, AtomicWriteOrd::Relaxed)?;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,9 +229,9 @@ fn mutex_kind_from_static_initializer<'tcx>(
|
|||
// We store some data directly inside the type, ignoring the platform layout:
|
||||
// - init: u32
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Clone)]
|
||||
struct PthreadRwLock {
|
||||
id: RwLockId,
|
||||
rwlock_ref: RwLockRef,
|
||||
}
|
||||
|
||||
fn rwlock_init_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, Size> {
|
||||
|
|
@ -278,8 +278,8 @@ where
|
|||
)? {
|
||||
throw_unsup_format!("unsupported static initializer used for `pthread_rwlock_t`");
|
||||
}
|
||||
let id = ecx.machine.sync.rwlock_create();
|
||||
interp_ok(PthreadRwLock { id })
|
||||
let rwlock_ref = ecx.machine.sync.rwlock_create();
|
||||
interp_ok(PthreadRwLock { rwlock_ref })
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
@ -504,11 +504,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
|
||||
let mutex = mutex_get_data(this, mutex_op)?.clone();
|
||||
|
||||
let ret = if this.mutex_is_locked(&mutex.mutex_ref) {
|
||||
let owner_thread = this.mutex_get_owner(&mutex.mutex_ref);
|
||||
let ret = if let Some(owner_thread) = mutex.mutex_ref.owner() {
|
||||
if owner_thread != this.active_thread() {
|
||||
this.mutex_enqueue_and_block(
|
||||
&mutex.mutex_ref,
|
||||
mutex.mutex_ref,
|
||||
Some((Scalar::from_i32(0), dest.clone())),
|
||||
);
|
||||
return interp_ok(());
|
||||
|
|
@ -541,8 +540,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
|
||||
let mutex = mutex_get_data(this, mutex_op)?.clone();
|
||||
|
||||
interp_ok(Scalar::from_i32(if this.mutex_is_locked(&mutex.mutex_ref) {
|
||||
let owner_thread = this.mutex_get_owner(&mutex.mutex_ref);
|
||||
interp_ok(Scalar::from_i32(if let Some(owner_thread) = mutex.mutex_ref.owner() {
|
||||
if owner_thread != this.active_thread() {
|
||||
this.eval_libc_i32("EBUSY")
|
||||
} else {
|
||||
|
|
@ -596,7 +594,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
// since we make the field uninit below.
|
||||
let mutex = mutex_get_data(this, mutex_op)?.clone();
|
||||
|
||||
if this.mutex_is_locked(&mutex.mutex_ref) {
|
||||
if mutex.mutex_ref.owner().is_some() {
|
||||
throw_ub_format!("destroyed a locked mutex");
|
||||
}
|
||||
|
||||
|
|
@ -616,12 +614,16 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
) -> InterpResult<'tcx> {
|
||||
let this = self.eval_context_mut();
|
||||
|
||||
let id = rwlock_get_data(this, rwlock_op)?.id;
|
||||
let rwlock = rwlock_get_data(this, rwlock_op)?.clone();
|
||||
|
||||
if this.rwlock_is_write_locked(id) {
|
||||
this.rwlock_enqueue_and_block_reader(id, Scalar::from_i32(0), dest.clone());
|
||||
if rwlock.rwlock_ref.is_write_locked() {
|
||||
this.rwlock_enqueue_and_block_reader(
|
||||
rwlock.rwlock_ref,
|
||||
Scalar::from_i32(0),
|
||||
dest.clone(),
|
||||
);
|
||||
} else {
|
||||
this.rwlock_reader_lock(id);
|
||||
this.rwlock_reader_lock(&rwlock.rwlock_ref);
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
|
||||
|
|
@ -631,12 +633,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
fn pthread_rwlock_tryrdlock(&mut self, rwlock_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> {
|
||||
let this = self.eval_context_mut();
|
||||
|
||||
let id = rwlock_get_data(this, rwlock_op)?.id;
|
||||
let rwlock = rwlock_get_data(this, rwlock_op)?.clone();
|
||||
|
||||
if this.rwlock_is_write_locked(id) {
|
||||
if rwlock.rwlock_ref.is_write_locked() {
|
||||
interp_ok(Scalar::from_i32(this.eval_libc_i32("EBUSY")))
|
||||
} else {
|
||||
this.rwlock_reader_lock(id);
|
||||
this.rwlock_reader_lock(&rwlock.rwlock_ref);
|
||||
interp_ok(Scalar::from_i32(0))
|
||||
}
|
||||
}
|
||||
|
|
@ -648,9 +650,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
) -> InterpResult<'tcx> {
|
||||
let this = self.eval_context_mut();
|
||||
|
||||
let id = rwlock_get_data(this, rwlock_op)?.id;
|
||||
let rwlock = rwlock_get_data(this, rwlock_op)?.clone();
|
||||
|
||||
if this.rwlock_is_locked(id) {
|
||||
if rwlock.rwlock_ref.is_locked() {
|
||||
// Note: this will deadlock if the lock is already locked by this
|
||||
// thread in any way.
|
||||
//
|
||||
|
|
@ -663,9 +665,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
// report the deadlock only when no thread can continue execution,
|
||||
// but we could detect that this lock is already locked and report
|
||||
// an error.)
|
||||
this.rwlock_enqueue_and_block_writer(id, Scalar::from_i32(0), dest.clone());
|
||||
this.rwlock_enqueue_and_block_writer(
|
||||
rwlock.rwlock_ref,
|
||||
Scalar::from_i32(0),
|
||||
dest.clone(),
|
||||
);
|
||||
} else {
|
||||
this.rwlock_writer_lock(id);
|
||||
this.rwlock_writer_lock(&rwlock.rwlock_ref);
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
|
||||
|
|
@ -675,12 +681,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
fn pthread_rwlock_trywrlock(&mut self, rwlock_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> {
|
||||
let this = self.eval_context_mut();
|
||||
|
||||
let id = rwlock_get_data(this, rwlock_op)?.id;
|
||||
let rwlock = rwlock_get_data(this, rwlock_op)?.clone();
|
||||
|
||||
if this.rwlock_is_locked(id) {
|
||||
if rwlock.rwlock_ref.is_locked() {
|
||||
interp_ok(Scalar::from_i32(this.eval_libc_i32("EBUSY")))
|
||||
} else {
|
||||
this.rwlock_writer_lock(id);
|
||||
this.rwlock_writer_lock(&rwlock.rwlock_ref);
|
||||
interp_ok(Scalar::from_i32(0))
|
||||
}
|
||||
}
|
||||
|
|
@ -688,9 +694,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
fn pthread_rwlock_unlock(&mut self, rwlock_op: &OpTy<'tcx>) -> InterpResult<'tcx, ()> {
|
||||
let this = self.eval_context_mut();
|
||||
|
||||
let id = rwlock_get_data(this, rwlock_op)?.id;
|
||||
let rwlock = rwlock_get_data(this, rwlock_op)?.clone();
|
||||
|
||||
if this.rwlock_reader_unlock(id)? || this.rwlock_writer_unlock(id)? {
|
||||
if this.rwlock_reader_unlock(&rwlock.rwlock_ref)?
|
||||
|| this.rwlock_writer_unlock(&rwlock.rwlock_ref)?
|
||||
{
|
||||
interp_ok(())
|
||||
} else {
|
||||
throw_ub_format!("unlocked an rwlock that was not locked by the active thread");
|
||||
|
|
@ -702,9 +710,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
|||
|
||||
// Reading the field also has the side-effect that we detect double-`destroy`
|
||||
// since we make the field uninit below.
|
||||
let id = rwlock_get_data(this, rwlock_op)?.id;
|
||||
let rwlock = rwlock_get_data(this, rwlock_op)?.clone();
|
||||
|
||||
if this.rwlock_is_locked(id) {
|
||||
if rwlock.rwlock_ref.is_locked() {
|
||||
throw_ub_format!("destroyed a locked rwlock");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: abnormal termination: called os_unfair_lock_assert_not_owner on an os_unf
|
|||
--> tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs:LL:CC
|
||||
|
|
||||
LL | libc::os_unfair_lock_assert_not_owner(lock.get());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ called os_unfair_lock_assert_not_owner on an os_unfair_lock owned by the current thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: abnormal termination: called os_unfair_lock_assert_owner on an os_unfair_
|
|||
--> tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs:LL:CC
|
||||
|
|
||||
LL | libc::os_unfair_lock_assert_owner(lock.get());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ called os_unfair_lock_assert_owner on an os_unfair_lock not owned by the current thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/apple_os_unfair_lock_move_deadlock.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { libc::os_unfair_lock_lock(lock.get()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_move_deadlock.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: abnormal termination: attempted to lock an os_unfair_lock that is already
|
|||
--> tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs:LL:CC
|
||||
|
|
||||
LL | libc::os_unfair_lock_lock(lock.get());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to lock an os_unfair_lock that is already locked by the current thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: abnormal termination: attempted to unlock an os_unfair_lock not owned by
|
|||
--> tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs:LL:CC
|
||||
|
|
||||
LL | libc::os_unfair_lock_unlock(lock.get());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to unlock an os_unfair_lock not owned by the current thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: using uninitialized data, but this operation requires
|
|||
--> tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_cond_destroy(cond.as_mut_ptr());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: `pthread_cond_t` can't be moved after first use
|
|||
--> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_cond_destroy(cond2.as_mut_ptr());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `pthread_cond_t` can't be moved after first use
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: `pthread_cond_t` can't be moved after first use
|
|||
--> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_cond_destroy(&mut cond2 as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `pthread_cond_t` can't be moved after first use
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: using uninitialized data, but this operation requires
|
|||
--> tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_condattr_destroy(attr.as_mut_ptr());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
error: Undefined Behavior: calling a function with more arguments than it expected
|
||||
|
|
||||
= note: calling a function with more arguments than it expected
|
||||
= note: Undefined Behavior occurred here
|
||||
= note: (no span available)
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
error: Undefined Behavior: calling a function with fewer arguments than it requires
|
||||
|
|
||||
= note: calling a function with fewer arguments than it requires
|
||||
= note: Undefined Behavior occurred here
|
||||
= note: (no span available)
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: trying to join a detached thread
|
|||
--> tests/fail-dep/concurrency/libc_pthread_join_detached.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: trying to join an already joined thread
|
|||
--> tests/fail-dep/concurrency/libc_pthread_join_joined.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join an already joined thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: trying to join a detached thread
|
|||
--> tests/fail-dep/concurrency/libc_pthread_join_main.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: trying to join an already joined thread
|
|||
--> tests/fail-dep/concurrency/libc_pthread_join_multiple.rs:LL:CC
|
||||
|
|
||||
LL | ... assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join an already joined thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: trying to join itself
|
|||
--> tests/fail-dep/concurrency/libc_pthread_join_self.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join itself
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: trying to acquire default mutex already locked by the
|
|||
--> tests/fail-dep/concurrency/libc_pthread_mutex_NULL_reentrant.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutex_lock(&mut mutex as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to acquire default mutex already locked by the current thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(libc::pthread_mutex_lock(lock_copy.0.get() as *mut _), 0);
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: trying to acquire default mutex already locked by the
|
|||
--> tests/fail-dep/concurrency/libc_pthread_mutex_default_reentrant.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutex_lock(&mut mutex as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to acquire default mutex already locked by the current thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: destroyed a locked mutex
|
|||
--> tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutex_destroy(&mut mutex as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ destroyed a locked mutex
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: using uninitialized data, but this operation requires
|
|||
--> tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutex_destroy(mutex.as_mut_ptr());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: `pthread_mutex_t` can't be moved after first use
|
|||
--> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutex_lock(&mut m2 as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `pthread_mutex_t` can't be moved after first use
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: `pthread_mutex_t` can't be moved after first use
|
|||
--> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutex_unlock(&mut m2 as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `pthread_mutex_t` can't be moved after first use
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ fn main() {
|
|||
assert_eq!(libc::pthread_mutex_lock(&mut mutex as *mut _), 0);
|
||||
// A "normal" mutex properly tries to acquire the lock even if its is already held
|
||||
// by the current thread -- and then we deadlock.
|
||||
libc::pthread_mutex_lock(&mut mutex as *mut _); //~ ERROR: deadlock: the evaluated program deadlocked
|
||||
libc::pthread_mutex_lock(&mut mutex as *mut _); //~ ERROR: the evaluated program deadlocked
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/libc_pthread_mutex_normal_reentrant.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutex_lock(&mut mutex as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program deadlocked
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_normal_reentrant.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: unlocked a PTHREAD_MUTEX_NORMAL mutex that was not lo
|
|||
--> tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutex_unlock(&mut mutex as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked a PTHREAD_MUTEX_NORMAL mutex that was not locked by the current thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: trying to acquire default mutex already locked by the
|
|||
--> tests/fail-dep/concurrency/libc_pthread_mutex_staticinit_reentrant.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutex_lock(&mut mutex as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to acquire default mutex already locked by the current thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: Undefined Behavior: unlocked a default mutex that was not locked by the current thread
|
||||
--> tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs:LL:CC
|
||||
|
|
||||
LL | ...t_eq!(libc::pthread_mutex_unlock(lock_copy.0.get() as *mut _), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked a default mutex that was not locked by the current thread
|
||||
LL | ... assert_eq!(libc::pthread_mutex_unlock(lock_copy.0.get() as *mut _), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: using uninitialized data, but this operation requires
|
|||
--> tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_mutexattr_destroy(attr.as_mut_ptr());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: destroyed a locked rwlock
|
|||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_rwlock_destroy(rw.get());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ destroyed a locked rwlock
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: destroyed a locked rwlock
|
|||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_rwlock_destroy(rw.get());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ destroyed a locked rwlock
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: using uninitialized data, but this operation requires
|
|||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_rwlock_destroy(&mut lock);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_rwlock_wrlock(rw.get());
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: unlocked an rwlock that was not locked by the active
|
|||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC
|
||||
|
|
||||
LL | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked an rwlock that was not locked by the active thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: unlocked an rwlock that was not locked by the active
|
|||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_rwlock_unlock(rw.get());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked an rwlock that was not locked by the active thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0);
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_rwlock_rdlock(rw.get());
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0);
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_rwlock_wrlock(rw.get());
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: unlocked an rwlock that was not locked by the active
|
|||
--> tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC
|
||||
|
|
||||
LL | ... assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked an rwlock that was not locked by the active thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: `pthread_rwlock_t` can't be moved after first use
|
|||
--> tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs:LL:CC
|
||||
|
|
||||
LL | libc::pthread_rwlock_unlock(&mut rw2 as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `pthread_rwlock_t` can't be moved after first use
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: trying to join a detached thread
|
|||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(), c::INFINITE) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ const MAIN_THREAD: HANDLE = (2i32 << 29) as HANDLE;
|
|||
fn main() {
|
||||
thread::spawn(|| {
|
||||
unsafe {
|
||||
assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0); //~ ERROR: deadlock: the evaluated program deadlocked
|
||||
assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0); //~ ERROR: deadlock
|
||||
}
|
||||
})
|
||||
.join()
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/windows_join_main.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program deadlocked
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at RUSTLIB/core/src/macros/mod.rs:LL:CC
|
||||
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(), c::INFINITE) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ fn main() {
|
|||
thread::spawn(|| {
|
||||
unsafe {
|
||||
let native = GetCurrentThread();
|
||||
assert_eq!(WaitForSingleObject(native, INFINITE), WAIT_OBJECT_0); //~ ERROR: deadlock: the evaluated program deadlocked
|
||||
assert_eq!(WaitForSingleObject(native, INFINITE), WAIT_OBJECT_0); //~ ERROR: deadlock
|
||||
}
|
||||
})
|
||||
.join()
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/concurrency/windows_join_self.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(WaitForSingleObject(native, INFINITE), WAIT_OBJECT_0);
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/concurrency/windows_join_self.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(), c::INFINITE) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: memory access failed: attempting to access 129 bytes,
|
|||
--> tests/fail-dep/libc/affinity.rs:LL:CC
|
||||
|
|
||||
LL | let err = unsafe { sched_setaffinity(PID, size_of::<cpu_set_t>() + 1, &cpuset) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: attempting to access 129 bytes, but got ALLOC which is only 128 bytes from the end of the allocation
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
|
||||
error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic read on thread `unnamed-ID` at ALLOC
|
||||
--> tests/fail-dep/libc/env-set_var-data-race.rs:LL:CC
|
||||
|
|
||||
LL | libc::getenv(b"TZ/0".as_ptr().cast());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (2) just happened here
|
||||
|
|
||||
help: and (1) occurred earlier here
|
||||
--> tests/fail-dep/libc/env-set_var-data-race.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
@ -14,24 +14,24 @@ note: inside `main`
|
|||
LL | thread2.join().unwrap();
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/libc/eventfd_block_read_twice.rs:LL:CC
|
||||
|
|
||||
LL | let res: i64 = unsafe { libc::read(fd, buf.as_mut_ptr().cast(), 8).try_into().unwrap() };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/libc/eventfd_block_read_twice.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
@ -14,24 +14,24 @@ note: inside `main`
|
|||
LL | thread2.join().unwrap();
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/libc/eventfd_block_write_twice.rs:LL:CC
|
||||
|
|
||||
LL | libc::write(fd, sized_8_data.as_ptr() as *const libc::c_void, 8).try_into().unwrap()
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/libc/eventfd_block_write_twice.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
//@ignore-target: windows # Sockets/pipes are not implemented yet
|
||||
//~^ ERROR: deadlock: the evaluated program deadlocked
|
||||
//~^ ERROR: the evaluated program deadlocked
|
||||
//@compile-flags: -Zmiri-deterministic-concurrency
|
||||
use std::thread;
|
||||
|
||||
|
|
@ -16,5 +16,5 @@ fn main() {
|
|||
});
|
||||
// Main thread will block on read.
|
||||
let _res = unsafe { libc::read(fds[0], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) };
|
||||
//~^ ERROR: deadlock: the evaluated program deadlocked
|
||||
//~^ ERROR: the evaluated program deadlocked
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/libc/fcntl_fsetfl_while_blocking.rs:LL:CC
|
||||
|
|
||||
LL | let _res = unsafe { libc::read(fds[0], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `main` at tests/fail-dep/libc/fcntl_fsetfl_while_blocking.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unsupported operation: cannot close stdout
|
|||
--> tests/fail-dep/libc/fs/close_stdout.rs:LL:CC
|
||||
|
|
||||
LL | libc::close(1);
|
||||
| ^^^^^^^^^^^^^^ cannot close stdout
|
||||
| ^^^^^^^^^^^^^^ unsupported operation occurred here
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
|
||||
= note: BACKTRACE:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: writing to ALLOC which is read-only
|
|||
--> tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC
|
||||
|
|
||||
LL | let _fd = unsafe { libc::mkstemp(s) };
|
||||
| ^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only
|
||||
| ^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unsupported operation: cannot read from stdout
|
|||
--> tests/fail-dep/libc/fs/read_from_stdout.rs:LL:CC
|
||||
|
|
||||
LL | libc::read(1, bytes.as_mut_ptr() as *mut libc::c_void, 512);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot read from stdout
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
|
||||
= note: BACKTRACE:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: not enough variadic arguments for `open(pathname, O_C
|
|||
--> tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC
|
||||
|
|
||||
LL | let _fd = unsafe { libc::open(name_ptr, libc::O_CREAT) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not enough variadic arguments for `open(pathname, O_CREAT, ...)`: got 0, expected at least 1
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unsupported operation: cannot write to stdin
|
|||
--> tests/fail-dep/libc/fs/write_to_stdin.rs:LL:CC
|
||||
|
|
||||
LL | libc::write(0, bytes.as_ptr() as *const libc::c_void, 5);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot write to stdin
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
|
||||
= note: BACKTRACE:
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `main` at ALLOC. (2) just happened here
|
||||
error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `main` at ALLOC
|
||||
--> tests/fail-dep/libc/libc-epoll-data-race.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!({ VAL_TWO }, 51)
|
||||
| ^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `main` at ALLOC. (2) just happened here
|
||||
| ^^^^^^^ (2) just happened here
|
||||
|
|
||||
help: and (1) occurred earlier here
|
||||
--> tests/fail-dep/libc/libc-epoll-data-race.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: constructing invalid value at .value[3]: encountered
|
|||
--> tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs:LL:CC
|
||||
|
|
||||
LL | ... buf.assume_init();
|
||||
| ^^^^^^^^^^^^^^^^^ constructing invalid value at .value[3]: encountered uninitialized memory, but expected an integer
|
||||
| ^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
@ -20,18 +20,18 @@ note: inside `main`
|
|||
LL | thread1.join().unwrap();
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/libc/libc_epoll_block_two_thread.rs:LL:CC
|
||||
|
|
||||
LL | check_epoll_wait::<TAG>(epfd, &[(expected_event, expected_value)], -1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program deadlocked
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/libc/libc_epoll_block_two_thread.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unsupported operation: epoll: epoll does not support this file descriptio
|
|||
--> tests/fail-dep/libc/libc_epoll_unsupported_fd.rs:LL:CC
|
||||
|
|
||||
LL | let res = unsafe { libc::epoll_ctl(epfd0, libc::EPOLL_CTL_ADD, epfd1, &mut ev) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ epoll: epoll does not support this file description
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
|
||||
= note: BACKTRACE:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this p
|
|||
--> tests/fail-dep/libc/malloc_zero_double_free.rs:LL:CC
|
||||
|
|
||||
LL | libc::free(ptr);
|
||||
| ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
|
||||
| ^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: pointer not dereferenceable: pointer must point to so
|
|||
--> tests/fail-dep/libc/memchr_null.rs:LL:CC
|
||||
|
|
||||
LL | libc::memchr(ptr::null(), 0, 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pointer not dereferenceable: pointer must point to some allocation, but got null pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: pointer not dereferenceable: pointer must point to so
|
|||
--> tests/fail-dep/libc/memcmp_null.rs:LL:CC
|
||||
|
|
||||
LL | libc::memcmp(ptr::null(), ptr::null(), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pointer not dereferenceable: pointer must point to some allocation, but got null pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: pointer not dereferenceable: pointer must point to so
|
|||
--> tests/fail-dep/libc/memcmp_zero.rs:LL:CC
|
||||
|
|
||||
LL | libc::memcmp(ptr.cast(), ptr.cast(), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pointer not dereferenceable: pointer must point to some allocation, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: pointer not dereferenceable: pointer must point to so
|
|||
--> tests/fail-dep/libc/memcpy_zero.rs:LL:CC
|
||||
|
|
||||
LL | libc::memcpy(to.cast(), from.cast(), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pointer not dereferenceable: pointer must point to some allocation, but got 0x17[noalloc] which is a dangling pointer (it has no provenance)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: pointer not dereferenceable: pointer must point to so
|
|||
--> tests/fail-dep/libc/memrchr_null.rs:LL:CC
|
||||
|
|
||||
LL | libc::memrchr(ptr::null(), 0, 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pointer not dereferenceable: pointer must point to some allocation, but got null pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: deallocating ALLOC, which is mmap memory, using C hea
|
|||
--> tests/fail-dep/libc/mmap_invalid_dealloc.rs:LL:CC
|
||||
|
|
||||
LL | libc::free(ptr);
|
||||
| ^^^^^^^^^^^^^^^ deallocating ALLOC, which is mmap memory, using C heap deallocation operation
|
||||
| ^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this p
|
|||
--> tests/fail-dep/libc/mmap_use_after_munmap.rs:LL:CC
|
||||
|
|
||||
LL | let _x = *(ptr as *mut u8);
|
||||
| ^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
|
||||
| ^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size SIZE
|
|||
--> tests/fail-dep/libc/munmap_partial.rs:LL:CC
|
||||
|
|
||||
LL | libc::munmap(ptr, 1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size SIZE and alignment ALIGN, but gave size SIZE and alignment ALIGN
|
||||
| ^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this p
|
|||
--> tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs:LL:CC
|
||||
|
|
||||
LL | libc::free(ptr);
|
||||
| ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
|
||||
| ^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: `realloc` with a size of zero
|
|||
--> tests/fail-dep/libc/realloc-zero.rs:LL:CC
|
||||
|
|
||||
LL | let p2 = libc::realloc(p1, 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^ `realloc` with a size of zero
|
||||
| ^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
@ -14,18 +14,18 @@ note: inside `main`
|
|||
LL | thread1.join().unwrap();
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/libc/socketpair-close-while-blocked.rs:LL:CC
|
||||
|
|
||||
LL | libc::read(fds[1], buf.as_mut_ptr().cast(), buf.len() as libc::size_t)
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/libc/socketpair-close-while-blocked.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `main` at ALLOC. (2) just happened here
|
||||
error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `main` at ALLOC
|
||||
--> tests/fail-dep/libc/socketpair-data-race.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { assert_eq!({ VAL }, 1) };
|
||||
| ^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `main` at ALLOC. (2) just happened here
|
||||
| ^^^ (2) just happened here
|
||||
|
|
||||
help: and (1) occurred earlier here
|
||||
--> tests/fail-dep/libc/socketpair-data-race.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
@ -14,24 +14,24 @@ note: inside `main`
|
|||
LL | thread2.join().unwrap();
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/libc/socketpair_block_read_twice.rs:LL:CC
|
||||
|
|
||||
LL | let res = unsafe { libc::read(fds[1], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/libc/socketpair_block_read_twice.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
||||
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
|
||||
|
|
@ -14,24 +14,24 @@ note: inside `main`
|
|||
LL | thread2.join().unwrap();
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
--> tests/fail-dep/libc/socketpair_block_write_twice.rs:LL:CC
|
||||
|
|
||||
LL | let res = unsafe { libc::write(fds[0], data as *const libc::c_void, 3) };
|
||||
| ^ the evaluated program deadlocked
|
||||
| ^ this thread got stuck here
|
||||
|
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
= note: inside closure at tests/fail-dep/libc/socketpair_block_write_twice.rs:LL:CC
|
||||
|
||||
error: deadlock: the evaluated program deadlocked
|
||||
error: the evaluated program deadlocked
|
||||
|
|
||||
= note: the evaluated program deadlocked
|
||||
= note: this thread got stuck here
|
||||
= note: (no span available)
|
||||
= note: BACKTRACE on thread `unnamed-ID`:
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unsupported operation: can't call foreign function `signal` on $OS
|
|||
--> tests/fail-dep/libc/unsupported_incomplete_function.rs:LL:CC
|
||||
|
|
||||
LL | libc::signal(libc::SIGPIPE, libc::SIG_IGN);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `signal` on $OS
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
|
||||
|
|
||||
= help: this means the program tried to do something Miri does not support; it does not indicate a bug in the program
|
||||
= note: BACKTRACE:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ error: abnormal termination: the program aborted execution
|
|||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
|
|
||||
LL | ABORT()
|
||||
| ^ the program aborted execution
|
||||
| ^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ error: abnormal termination: the program aborted execution
|
|||
--> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC
|
||||
|
|
||||
LL | core::intrinsics::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `alloc_error_handler` at tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ error: abnormal termination: the program aborted execution
|
|||
--> tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC
|
||||
|
|
||||
LL | core::intrinsics::abort();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ abnormal termination occurred here
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `panic_handler` at tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 an
|
|||
--> tests/fail/alloc/deallocate-bad-alignment.rs:LL:CC
|
||||
|
|
||||
LL | dealloc(x, Layout::from_size_align_unchecked(1, 2));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 1 and alignment ALIGN
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 an
|
|||
--> tests/fail/alloc/deallocate-bad-size.rs:LL:CC
|
||||
|
|
||||
LL | dealloc(x, Layout::from_size_align_unchecked(2, 1));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this p
|
|||
--> tests/fail/alloc/deallocate-twice.rs:LL:CC
|
||||
|
|
||||
LL | dealloc(x, Layout::from_size_align_unchecked(1, 1));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: deallocating ALLOC, which is Rust heap memory, using
|
|||
--> RUSTLIB/std/src/sys/alloc/PLATFORM.rs:LL:CC
|
||||
|
|
||||
LL | FREE();
|
||||
| ^ deallocating ALLOC, which is Rust heap memory, using PLATFORM heap deallocation operation
|
||||
| ^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unsupported operation: can't call foreign function `__rust_alloc` on $OS
|
|||
--> tests/fail/alloc/no_global_allocator.rs:LL:CC
|
||||
|
|
||||
LL | __rust_alloc(1, 1);
|
||||
| ^^^^^^^^^^^^^^^^^^ can't call foreign function `__rust_alloc` on $OS
|
||||
| ^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
|
||||
|
|
||||
= help: this means the program tried to do something Miri does not support; it does not indicate a bug in the program
|
||||
= note: BACKTRACE:
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
|
||||
--> tests/fail/alloc/reallocate-bad-size.rs:LL:CC
|
||||
|
|
||||
LL | let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
|
||||
LL | ... let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this p
|
|||
--> tests/fail/alloc/reallocate-change-alloc.rs:LL:CC
|
||||
|
|
||||
LL | let _z = *x;
|
||||
| ^^ memory access failed: ALLOC has been freed, so this pointer is dangling
|
||||
| ^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this p
|
|||
--> tests/fail/alloc/reallocate-dangling.rs:LL:CC
|
||||
|
|
||||
LL | let _z = realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: deallocating ALLOC, which is stack variable memory, u
|
|||
--> RUSTLIB/alloc/src/boxed.rs:LL:CC
|
||||
|
|
||||
LL | self.1.deallocate(From::from(ptr.cast()), layout);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocating ALLOC, which is stack variable memory, using Rust heap deallocation operation
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: creating an allocation larger than half the address s
|
|||
--> tests/fail/alloc/too_large.rs:LL:CC
|
||||
|
|
||||
LL | __rust_alloc(bytes, 1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ creating an allocation larger than half the address space
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unsupported operation: creating allocation with alignment ALIGN exceeding
|
|||
--> tests/fail/alloc/unsupported_big_alignment.rs:LL:CC
|
||||
|
|
||||
LL | __rust_alloc(1, 1 << 30);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ creating allocation with alignment ALIGN exceeding rustc's maximum supported value
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
|
||||
= note: BACKTRACE:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: Undefined Behavior: creating allocation with non-power-of-two alignment A
|
|||
--> tests/fail/alloc/unsupported_non_power_two_alignment.rs:LL:CC
|
||||
|
|
||||
LL | __rust_alloc(1, 3);
|
||||
| ^^^^^^^^^^^^^^^^^^ creating allocation with non-power-of-two alignment ALIGN
|
||||
| ^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue