Repository navigation
-
Fix a process abort when a
Drophandler touches a modelledMutex,RwLockor semaphore outside a running task. EveryBatchSemaphoreoperation looks up the running task's vector clock, andcurrent::clock()panicked when there was no running task, whenExecutionStatewas already borrowed, or outside a Shuttle execution. The first case is reached wheneverExecutionState::cleanupforce-unwinds a task that was still parked when the execution ended, for example after an ordinary test failure. The panic came from a destructor, so the process aborted, and the failure report and persisted schedule were lost with it.current::clock()now returns an empty clock in all three cases: an operation that belongs to no task has no causality to record. (#357) -
Fix spans leaking on the thread's entered-span stack while any thread in the process holds a scoped default subscriber, such as one installed with
tracing::subscriber::set_defaultby a concurrently running test. Shuttle exited a task's spans by callingSpan::current()insidetracing::dispatcher::get_default, where it returnsSpan::none()while a scoped default exists anywhere in the process, so it exited nothing but still entered the execution's span. Every scheduling step leaked one entry and everyRunner::runanother: a span entered before a context switch was no longer current after it, and once the leaked spans had closed, a laterSpan::current()panicked withtried to clone a span (Id(..)) that already closed. Spans are now exited and entered throughSpan::with_subscriber. (#359) -
A task's default
tracingdispatcher is now saved and restored across context switches, like its span stack. The default dispatcher is per OS thread and every task runs on the same one, so a task that yielded insidetracing::dispatcher::with_defaultleft its dispatcher installed while the scheduler and every other task ran: their events went to that dispatcher instead of the test's subscriber, and the task's spans stayed entered, so later events were attributed to the wrong task. If the execution was stopped or panicked while such a task was switched out, the task's default stayed installed after the execution ended too. Shuttle only parks a task's default when it may differ from the execution's, so runs without a scoped default subscriber skip it. (#359) -
Deadlock reports now print blocked tasks' backtraces (captured when
SHUTTLE_CAPTURE_BACKTRACEis set) withDisplay, in the numbered layout panics use underRUST_BACKTRACE=1, instead of with{:#?}, which printed oneDebugrecord per frame wrapped inSome(Backtrace [ .. ]). A task without a captured backtrace prints<not captured>. Output withoutSHUTTLE_CAPTURE_BACKTRACEis unchanged. (#360) -
Publish
shuttle-engine0.1.3, which has all of the changes above.shuttle-stdandshuttle-schedulersare unchanged at 0.1.2 and 0.1.1; they takeshuttle-engineas^0.1.2and^0.1.1, so they build against 0.1.3 as they stand.shuttle's own source is unchanged too; it now requiresshuttle-engine0.1.3, so that upgrading to 0.9.5 brings the fixes with it.