-
Notifications
You must be signed in to change notification settings - Fork 38.6k
test: Fix use-after-free in scheduler tests #9186
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make a copy of the boost time-point to wait for, otherwise the head of the queue may be deleted by another thread while this one is waiting, while the boost function still has a reference to it. Although this problem is in non-test code, this is not an actual problem outside of the tests because we use the thread scheduler with only one service thread, so there will never be threads fighting at the head of the queue. The old boost fallback escapes this problem because it passes a scalar value to wait_until instead of a const object reference. Found by running the tests in LLVM-4.0-master asan.
Member
|
utACK 12519bf |
Contributor
|
utACK |
laanwj
added a commit
that referenced
this pull request
Nov 19, 2016
12519bf test: Fix use-after-free in scheduler tests (Wladimir J. van der Laan)
maflcko
pushed a commit
to maflcko/bitcoin-core
that referenced
this pull request
Nov 19, 2016
Make a copy of the boost time-point to wait for, otherwise the head of the queue may be deleted by another thread while this one is waiting, while the boost function still has a reference to it. Although this problem is in non-test code, this is not an actual problem outside of the tests because we use the thread scheduler with only one service thread, so there will never be threads fighting at the head of the queue. The old boost fallback escapes this problem because it passes a scalar value to wait_until instead of a const object reference. Found by running the tests in LLVM-4.0-master asan. Github-Pull: bitcoin#9186 Rebased-From: 12519bf
codablock
pushed a commit
to codablock/dash
that referenced
this pull request
Jan 15, 2018
12519bf test: Fix use-after-free in scheduler tests (Wladimir J. van der Laan)
lateminer
pushed a commit
to lateminer/bitcoin
that referenced
this pull request
Oct 21, 2018
Make a copy of the boost time-point to wait for, otherwise the head of the queue may be deleted by another thread while this one is waiting, while the boost function still has a reference to it. Although this problem is in non-test code, this is not an actual problem outside of the tests because we use the thread scheduler with only one service thread, so there will never be threads fighting at the head of the queue. The old boost fallback escapes this problem because it passes a scalar value to wait_until instead of a const object reference. Found by running the tests in LLVM-4.0-master asan. Github-Pull: bitcoin#9186 Rebased-From: 12519bf
andvgal
pushed a commit
to energicryptocurrency/gen2-energi
that referenced
this pull request
Jan 6, 2019
12519bf test: Fix use-after-free in scheduler tests (Wladimir J. van der Laan)
CryptoCentric
pushed a commit
to absolute-community/absolute
that referenced
this pull request
Feb 24, 2019
12519bf test: Fix use-after-free in scheduler tests (Wladimir J. van der Laan)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make a copy of the boost time-point to wait for, as the head of the queue may be deleted by another thread while this one is waiting, while the boost function still has a reference to it.
Although this problem is in non-test code, this is not an actual problem outside of the tests because we use the thread scheduler with only one service thread, so there will never be threads fighting at the head of the queue.
The old boost fallback escapes this problem because it passes a scalar value to wait_until instead of a const object reference.
Found by running the bitcoin_test in LLVM-4.0-master asan.
See also: https://svn.boost.org/trac/boost/ticket/11097#comment:10