trunk serve sometimes fails with new drift sort introduced in rust-1.81.0 #870
Closed
Description
TL;DR: Fixed with trunk 0.21.1.
Here is the stacktrace generated with RUST_BACKTRACE=full trunk serve
:
thread 'notify-rs debouncer loop' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order
stack backtrace:
0: 0x565415c2d4a8 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h1b9dad2a88e955ff
1: 0x565415489edb - core::fmt::write::h4b5a1270214bc4a7
2: 0x565415bf17fe - std::io::Write::write_fmt::hd04af345a50c312d
3: 0x565415c2f91e - std::panicking::default_hook::{{closure}}::h96ab15e9936be7ed
4: 0x565415c309c7 - std::panicking::rust_panic_with_hook::hfe205f6954b2c97b
5: 0x565415c30292 - std::panicking::begin_panic_handler::{{closure}}::h6cb44b3a50f28c44
6: 0x565415c30229 - std::sys::backtrace::__rust_end_short_backtrace::hf1c1f2a92799bb0e
7: 0x565415c30213 - rust_begin_unwind
8: 0x565414fb4e61 - core::panicking::panic_fmt::h3d8fc78294164da7
9: 0x565415493263 - core::slice::sort::shared::smallsort::panic_on_ord_violation::h4e03188016ac0891
10: 0x56541513c1f9 - core::slice::sort::stable::quicksort::quicksort::h4b95b6fa824e998a
11: 0x565415135574 - core::slice::sort::stable::drift::sort::h6da7dfff3c2b2cea
12: 0x5654151349a8 - core::slice::sort::stable::driftsort_main::h37f276de78726f4e
13: 0x5654150de42d - std::sys::backtrace::__rust_begin_short_backtrace::h48b01f60f28414ab
14: 0x5654150f8505 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h408b32fe58cd7043
15: 0x565415c32b8b - std::sys::pal::unix::thread::Thread::new::thread_start::ha8af9c992ef0b208
16: 0x7fd58a91c541 - start_thread
17: 0x7fd58a98a91c - __GI___clone3
18: 0x0 - <unknown>
I can not dig more to exact function which generates incorrect ordering.
Can be reproduced on linux with trunk-0.20.3 using feature "detect changes"