-
-
Notifications
You must be signed in to change notification settings - Fork 821
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
a race between spawn_receiver() and spawn_sender() #1060
Labels
Comments
Looks like rust-lang/rust#39364. Cool that you found a consistent reproducer! #933 tracks replacing the stdlib's |
Ohh, I see. Thanks for your reply! |
Thank you for reporting this. I think it's a good idea to keep this open. |
sharkdp
changed the title
[bug] a race between spawn_receiver() and spawn_sender()
a race between spawn_receiver() and spawn_sender()
Jul 11, 2022
tavianator
added a commit
to tavianator/fd
that referenced
this issue
Oct 24, 2022
Fixes sharkdp#933. Fixes sharkdp#1060. Fixes sharkdp#1113.
This can also fail in CI: https://github.com/sharkdp/fd/actions/runs/3255706132/jobs/5345297564#step:10:319 |
tavianator
added a commit
to tavianator/fd
that referenced
this issue
Nov 1, 2022
Fixes sharkdp#933. Fixes sharkdp#1060. Fixes sharkdp#1113.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I found a race bug that makes fd panic by reaching an unreachable code at Line 1176 in std/sync/mpsc/mod.rs.
I suspect that fd crashes when the receiver thread spawned by spawn_receiver() does not proceed to execute line 352 and the sender threads spawned by spawn_senders() race to send messages to the receiver at line 548.
How to reproduce the crash
I built it with
cargo build
and observed this error as I ran./fd
in/fd/target/debug/
under stress testing workload (to better explore concurrency errors). Attached the stack backtrace below.To make this race happen more deterministically, I recommend you to insert sleep operation at the following three locations (with the sleep operations, I could reproduce this crash out of seven test runs on average)
Line 350 in src/walk.rs
Line 406 in src/walk.rs
Line line 547 in src/walk.rs
Stack backtrace
Hope this helps. Please let me know if you need more information.
The text was updated successfully, but these errors were encountered: