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

sync: fix panic in broadcast::Receiver drop #3434

Merged
merged 2 commits into from Jan 20, 2021

Commits on Jan 16, 2021

  1. sync: add a loom test that makes broadcast panic on drop

    This test case causes `broadcast::Receiver` to panic on drop
    with "unexpected empty broadcast channel" when the tests are
    executed with this command:
    
    ```
    LOOM_MAX_PREEMPTIONS=1 RUSTFLAGS="--cfg loom" \
        cargo test --lib --release --features full -- --test-threads=1 --nocapture
    ```
    
    Refs: tokio-rs#2533
    oguzbilgener committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    27427c9 View commit details
    Browse the repository at this point in the history
  2. sync: fix panic in broadcast::Receiver drop

    `self.next` can be set to a value greater than `until`
    when the channel overflows with messages but the drop implementation
    does not account for it.
    
    Fixes: tokio-rs#2533
    oguzbilgener committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    ef31c21 View commit details
    Browse the repository at this point in the history