Skip to content

v0.9.11

Latest

Choose a tag to compare

@sarsko sarsko released this 02 Dec 07:05
v0.9.11
83de06f
  • The default task stack is now 2 MiB, the stack of a thread from std::thread::spawn and of tokio's worker threads. It was 60 KiB, so a task that built a large value on its stack died with SIGSEGV and no panic message. The stack is reserved address space, and a task uses only the pages it touches. The shuttle-tokio test macro no longer sets its own 960 KiB. (#461)

  • A task's wake is now consumed when its poll starts, as in tokio. Before, a wake that came before the poll still counted when the poll returned Pending, so the task got one more poll. That extra poll hid lost wakeups where a future is woken, polled, and then becomes ready with no further wake: tokio never polls it again, and such a test now fails with a deadlock. Schedules that were recorded with an earlier version can fail to replay. (#478)

  • Fix four bugs at the end of thread::scope. The last scoped thread woke the scope's owner wherever it was blocked, so a join of another thread or the end of an inner scope could return too early (#449). A scope ended before a thread dropped a result that nobody joined, and that result can borrow from the scope (#448). The end of a scope now joins the vector clocks of its threads, as a join does. When the scope's function panics, scope now waits for its threads before it resumes the panic, as std does. A scope with a forgotten handle, or with a thread that waits for the panicking owner, now waits forever, which Shuttle reports as a deadlock, as std's scope would hang. (#451)

  • Take a scheduling point before the drop of a std mpsc Receiver, or of the last Sender or SyncSender, disconnects the channel while the other side still exists. Before, the drop ran in the same step as the thread's previous operation, so a receiver never saw Empty between a sender's last send and its drop. (#420)

  • shuttle-std's RwLock::try_read no longer loses a permit when it fails because the task already holds a read guard. Before, no writer could take the lock after that, and Shuttle reported a false deadlock. (#466)

  • shuttle-std's RwLock<T> is now Sync only when T: Send + Sync, as std's is. It was Sync for any T: Send, so a static RwLock<Cell<u64>> compiled and let two tests that run at the same time share a &Cell<u64> across OS threads. Code that relied on the old bound doesn't compile with std's RwLock either. (#465)

  • Add is_poisoned to shuttle-std's Mutex and RwLock, as in std. (#426)

  • shuttle-tokio:

    • The timeouts that trigger_timeouts expires now last only until the end of the execution. They were kept in a thread-local, so a trigger that an execution didn't clear also expired timeouts in every later execution, and a failing schedule could pass when replayed on its own. (#421)
    • watch takes one scheduling point per wait in changed, wait_for and Sender::closed, instead of up to four, and none to wake the waiters. The drop of the last Sender or Receiver outside an execution no longer panics. (#414)
    • Fix undefined behavior from safe code in OwnedRwLockWriteGuard::downgrade: a tracing subscriber that panicked on its trace event caused a use after free and a double drop of the lock's Arc. (#468)
    • Fix undefined behavior from safe code in OnceCell::get_or_init and get_or_try_init: after a cancelled initializer closed the semaphore outside an execution, they returned a reference into the empty cell. They now panic instead. (#469)
    • Add rwlock() to OwnedRwLockReadGuard and OwnedRwLockWriteGuard, as in tokio. (#417)
  • deterministic_collections: deserializing a HashMap or HashSet now uses the deterministic hasher, so the same input gives the same iteration order. (#416)

  • Add the shuttle-enabler crate. Its shuttle feature turns on the shuttle feature of every wrapper crate, and the deterministic feature of determinizable_collections, so a crate that uses several wrappers names one feature instead of listing each wrapper. (#325)

  • Publish shuttle 0.9.11, shuttle-engine 0.1.9, shuttle-std 0.1.6, shuttle-tokio-impl-inner 0.1.8, deterministic_collections 0.1.1 and shuttle-enabler 0.1.0. shuttle-std requires shuttle-engine 0.1.9 for the wake change. shuttle-tokio-impl-inner requires it for the 2 MiB default, because its test macro no longer sets a stack size. shuttle-schedulers 0.1.1 and the other wrappers are unchanged. shuttle-tokio-impl 0.1.2 and shuttle-tokio 1.0.0 take inner as ^0.1.5, and dashmap and determinizable_collections take deterministic_collections as ^0.1.0, so they get the fixes without a new release.