Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trunk serve sometimes fails with new drift sort introduced in rust-1.81.0 #870

Closed
maratik123 opened this issue Sep 9, 2024 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@maratik123
Copy link
Contributor

maratik123 commented Sep 9, 2024

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"

@maratik123
Copy link
Contributor Author

Seems like one of dependencies has incorrect implementation of comparison function

@ctron
Copy link
Collaborator

ctron commented Sep 10, 2024

Thanks for reporting. Looks tricky to find out what the cause is.

@ctron ctron added the bug Something isn't working label Sep 10, 2024
@ctron
Copy link
Collaborator

ctron commented Sep 10, 2024

Running with debug information revealed the issue: notify-rs/notify#636

@ctron
Copy link
Collaborator

ctron commented Sep 10, 2024

I am not sure there's much trunk can do at this point. A workaround would be to stick to Rust versions prior to 1.81.0

@ctron ctron pinned this issue Sep 10, 2024
@RasmusHogslatt
Copy link

No solution but can confirm same thing happened to me.

@ctron
Copy link
Collaborator

ctron commented Sep 16, 2024

The issue seems to be fixed in notify-rs, but no release has been made yet.

@dfaust
Copy link

dfaust commented Oct 14, 2024

notify-debouncer-full v0.3.2 has been released, this should fix the bug.

@ctron ctron closed this as completed in 229ed60 Oct 15, 2024
@ctron
Copy link
Collaborator

ctron commented Oct 15, 2024

It's released as trunk 0.21.1.

@ctron ctron unpinned this issue Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants