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 TSAN error with test confirmation_height.conflict_rollback_cemented #2002

Merged
merged 2 commits into from
May 21, 2019

Conversation

wezrule
Copy link
Contributor

@wezrule wezrule commented May 21, 2019

The std::stringstream used to redirect cerr is not thread safe as it can be modifed when logging is done in the background while we are trying to read from it. I've wrapped it in a boost sink which gives exclusive access now with a mutex, this is only used in tests. I also don't think it is thread-safe to add a sink on the fly so am doing this at the start of the test as well.

Add more blocks to use in rpc.confirmation_height_currently_processing to prevent it failing when run under ASAN.

@wezrule wezrule added unit test Related to a new, changed or fixed unit test sanitizers Related to thread, address or undefined sanitizers labels May 21, 2019
@wezrule wezrule added this to the V19.0 milestone May 21, 2019
@wezrule wezrule requested a review from SergiySW May 21, 2019 13:57
@wezrule wezrule self-assigned this May 21, 2019
@wezrule wezrule merged commit f230c88 into nanocurrency:master May 21, 2019
@wezrule wezrule deleted the fix_asan_tsan_tests branch May 21, 2019 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sanitizers Related to thread, address or undefined sanitizers unit test Related to a new, changed or fixed unit test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants