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

Fix potential deadlock in state_key::Entry::drop #14670

Merged
merged 1 commit into from
Sep 20, 2024

Commits on Sep 20, 2024

  1. Fix potential deadlock in state_key::Entry::drop

    If before Entry::drop() calls Registry::maybe_remove, the weak ref under
    the same key1 and key2 is replaced, Entry::drop can be called
    recursively resulting in a deadlock. The crux is we try to see if the
    entry has been replaced by trying to upgrading it to a strong ref, and
    it possible that the upgrade is successful and the result becomes a only
    ref to the new entry.
    
    This tries to fix it by determining the same thing by seeing if
    Weak::strong_count() is 0 instead of upgrading the weak ref.
    msmouse committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    a67cf58 View commit details
    Browse the repository at this point in the history