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

worker: fix race condition in node_messaging.cc #33429

Closed

Commits on May 16, 2020

  1. worker: fix race condition in node_messaging.cc

    `AddToIncomingQueue()` relies on `owner_` only being modified with
    `mutex_` being locked, but in these two places, that didn’t happen.
    
    Modify them to use `Detach()` instead, which has the same effect
    as setting `owner_ = nullptr` here, but does it with proper locking.
    
    This race condition probably only shows up in practice when Node.js
    is compiled in debug mode, because the compiler eliminates the
    duplicate load in `AddToIncomingQueue()` when compiling with
    optimizations enabled.
    addaleax committed May 16, 2020
    Copy the full SHA
    4f144eb View commit details
    Browse the repository at this point in the history