Skip to content

Conversation

TheBlueMatt
Copy link
Contributor

This fixes some benign races reported by helgrind. It makes some things atomic that need it, and fixes locking in addrman so that some log statements cant print garbage.

@morcos
Copy link
Contributor

morcos commented Nov 27, 2016

Thanks! The fDisconnect race was bothering me.

utACK

@gmaxwell
Copy link
Contributor

utACK. All looks good to me.

@laanwj
Copy link
Member

laanwj commented Nov 29, 2016

utACK dfed983

@laanwj laanwj merged commit dfed983 into bitcoin:master Nov 29, 2016
laanwj added a commit that referenced this pull request Nov 29, 2016
dfed983 Fix unlocked access to vNodes.size() (Matt Corallo)
3033522 Remove double brackets in addrman (Matt Corallo)
dbfaade Fix AddrMan locking (Matt Corallo)
047ea10 Make fImporting an std::atomic (Matt Corallo)
42071ca Make fDisconnect an std::atomic (Matt Corallo)
codablock pushed a commit to codablock/dash that referenced this pull request Jan 17, 2018
dfed983 Fix unlocked access to vNodes.size() (Matt Corallo)
3033522 Remove double brackets in addrman (Matt Corallo)
dbfaade Fix AddrMan locking (Matt Corallo)
047ea10 Make fImporting an std::atomic (Matt Corallo)
42071ca Make fDisconnect an std::atomic (Matt Corallo)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
dfed983 Fix unlocked access to vNodes.size() (Matt Corallo)
3033522 Remove double brackets in addrman (Matt Corallo)
dbfaade Fix AddrMan locking (Matt Corallo)
047ea10 Make fImporting an std::atomic (Matt Corallo)
42071ca Make fDisconnect an std::atomic (Matt Corallo)
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 25, 2019
dfed983 Fix unlocked access to vNodes.size() (Matt Corallo)
3033522 Remove double brackets in addrman (Matt Corallo)
dbfaade Fix AddrMan locking (Matt Corallo)
047ea10 Make fImporting an std::atomic (Matt Corallo)
42071ca Make fDisconnect an std::atomic (Matt Corallo)
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Aug 2, 2020
b954796 include missing atomic to make CMake linux happy. (furszy)
c452676 Make the cs_sendProcessing a LOCK instead of a TRY_LOCK (Matt Corallo)
ec23964 Split CNode::cs_vSend: message processing and message sending (Matt Corallo)
f9c458a Remove double brackets in addrman (Matt Corallo)
e48c0d3 Fix AddrMan locking (Matt Corallo)
2d71f05 Make fDisconnect an std::atomic (Matt Corallo)
0544cc6 net: fix a few cases where messages were sent rather than dropped upon disconnection (furszy)

Pull request description:

  Running 4.2 branch with `enable-debug`.
  Fixing:
  ```
  POTENTIAL DEADLOCK DETECTED
  Previous lock order was:
  pnode->cs_vRecvMsg net.cpp:1830 (TRY) (in thread )
  (1) cs_main main.cpp:5275 (in thread )
  (2) cs_vSend net.cpp:2465 (in thread )
  Current lock order is:
  (2) pnode->cs_vSend net.cpp:1846 (TRY) (in thread )
  (1) cs_main main.cpp:6018 (TRY) (in thread )
  ```

  Plus, added few more minor possible races fixes too.

  Back porting:
  bitcoin#8862
  bitcoin#9225
  bitcoin#9535

ACKs for top commit:
  Fuzzbawls:
    ACK b954796
  random-zebra:
    ACK b954796

Tree-SHA512: e15bd81e51282771ca4cb40689229d54787d72d7ed0ebc5f6f0058d3e252cc6691d8ebfc4670207bcd835d32b7898863651fd2ac74704d6cb4fdd30554d8a83a
zkbot added a commit to zcash/zcash that referenced this pull request Jan 28, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants