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

TSAN error for send_node_id_handshake test #2060

Merged

Conversation

2 participants
@wezrule
Copy link
Collaborator

commented Jun 5, 2019

When running Clang/TSAN I get the following:
https://gist.github.com/wezrule/279062783ed1ed2a2066ba5c79db0b83

What appears to happen is that the last std::shared_ptr<nano::node> reference gets released by an alarm operation which then calls the ~stat destructor. This modifies the map (unprotected) and at the same time a packet is processed and a stat is trying to be incremented. I don't think this is the fault of stats rather the slightly random nature where the last node shared_ptr reference is released which can cause problems in quite a few areas. But as this is the one that TSAN is warning about I have fixed it. Just adding a stop variable/function to prevent modifying stats when closing down the node. Have moved stats higher up the member list as most things have a dependency on it.

@wezrule wezrule added the sanitizers label Jun 5, 2019

@wezrule wezrule added this to the V19.0 milestone Jun 5, 2019

@wezrule wezrule requested a review from cryptocode Jun 5, 2019

@wezrule wezrule self-assigned this Jun 5, 2019

@wezrule wezrule merged commit 4543260 into nanocurrency:master Jun 5, 2019

2 checks passed

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

@wezrule wezrule deleted the wezrule:send_node_id_handshake_tsan_fix branch Jun 5, 2019

@zhyatt zhyatt added this to RC 4 (TBD) in V19 Jun 6, 2019

argakiig added a commit that referenced this pull request Jun 11, 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.