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

rpc: Fix data race (UB) in InterruptRPC() #14993

Merged
merged 1 commit into from Dec 19, 2018

Conversation

Projects
None yet
6 participants
@practicalswift
Copy link
Member

commented Dec 18, 2018

Fix data race (UB) in InterruptRPC().

Before:

$ ./configure --with-sanitizers=thread
$ make
$ test/functional/test_runner.py feature_shutdown.py
…
SUMMARY: ThreadSanitizer: data race rpc/server.cpp:314 in InterruptRPC()
…
ALL                 | ✖ Failed  | 2 s (accumulated)

After:

$ ./configure --with-sanitizers=thread
$ make
$ test/functional/test_runner.py feature_shutdown.py
…
ALL                 | ✓ Passed  | 3 s (accumulated)
@laanwj

This comment has been minimized.

Copy link
Member

commented Dec 18, 2018

utACK 10f8244a777392f87c2671d743b14201d24351be

I don't think this can actually result in a data race but an atomic is certainly more appropriate here.

Show resolved Hide resolved src/rpc/server.cpp Outdated

@practicalswift practicalswift force-pushed the practicalswift:rpc-datarace branch Dec 18, 2018

@promag

This comment has been minimized.

Copy link
Member

commented Dec 18, 2018

utACK 9ed8713.

@MarcoFalke
Copy link
Member

left a comment

Remove from the suppressions file?

Show resolved Hide resolved src/rpc/server.cpp Outdated

@practicalswift practicalswift force-pushed the practicalswift:rpc-datarace branch Dec 18, 2018

@practicalswift practicalswift force-pushed the practicalswift:rpc-datarace branch to 6c10037 Dec 18, 2018

@practicalswift

This comment has been minimized.

Copy link
Member Author

commented Dec 18, 2018

@MarcoFalke Done! Please re-review :-)

@promag

This comment has been minimized.

Copy link
Member

commented Dec 18, 2018

utACK 6c10037.

@laanwj laanwj merged commit 6c10037 into bitcoin:master Dec 19, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Dec 19, 2018

Merge #14993: rpc: Fix data race (UB) in InterruptRPC()
6c10037 rpc: Fix data race (UB) in InterruptRPC() (practicalswift)

Pull request description:

  Fix data race (UB) in `InterruptRPC()`.

  Before:

  ```
  $ ./configure --with-sanitizers=thread
  $ make
  $ test/functional/test_runner.py feature_shutdown.py
  …
  SUMMARY: ThreadSanitizer: data race rpc/server.cpp:314 in InterruptRPC()
  …
  ALL                 | ✖ Failed  | 2 s (accumulated)
  ```

  After:

  ```
  $ ./configure --with-sanitizers=thread
  $ make
  $ test/functional/test_runner.py feature_shutdown.py
  …
  ALL                 | ✓ Passed  | 3 s (accumulated)
  ```

Tree-SHA512: b139ca1a0480258f8caa7730cabd7783a821d906630f51487750a6b15b7842675ed679747e1ff1bdade77d248807e9d77bae7bb88da54d1df84a179cd9b9b987
@Sjors

This comment has been minimized.

Copy link
Member

commented Dec 21, 2018

I'm still getting feature_shutdown.py failures on Travis, see e.g. https://travis-ci.org/bitcoin/bitcoin/jobs/470997593#L3104

@promag

This comment has been minimized.

Copy link
Member

commented Dec 21, 2018

@Sjors that's fixed by #14958 which depends on #14982.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.