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 warning with nano::logger_mt #1892

merged 4 commits into from Apr 22, 2019


2 participants
Copy link

commented Apr 10, 2019

Multiple threads can call try_log and so it should be thread safe to do so (as the _mt name implies!), however last_log_time can be modified while another is trying to read it. The important change is in nano/lib/logger_mt.hpp, the rest are because logging is no longer copyable because of the mutex and it is copied by the node_config, but that doesn't care about logging. So instead of trying to get around this (for example by making the mutex member mutable and creating a copy constructor), I have removed the use of logger_mt from the logging class, which is what the rest of the changes are.

This was found in the system.generate_send_new test

@wezrule wezrule added the sanitizers label Apr 10, 2019

@wezrule wezrule added this to the V19.0 milestone Apr 10, 2019

@wezrule wezrule requested a review from argakiig Apr 10, 2019

@wezrule wezrule self-assigned this Apr 10, 2019

@zhyatt zhyatt added this to CP3 (2019-04-10) in V19 Apr 10, 2019

wezrule added some commits Apr 10, 2019

@wezrule wezrule merged commit e73cc04 into nanocurrency:master Apr 22, 2019

2 checks passed

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

@wezrule wezrule deleted the wezrule:fix_tsan_logger_mt branch Apr 22, 2019

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.