gui: Set CConnman byte counters earlier to avoid uninitialized reads #17906

pull ryanofsky wants to merge 1 commits into bitcoin:master from ryanofsky:pr/ipc-count changing 1 files +2 −2
  1. ryanofsky commented at 8:42 PM on January 10, 2020: contributor

    Initialize CConnman byte counters during construction, so GetTotalBytesRecv() and GetTotalBytesSent() methods don't return garbage before Start() is called.

    Change shouldn't have any effect outside of the GUI. It just fixes a race condition during a qt test that was observed on travis: https://travis-ci.org/bitcoin/bitcoin/jobs/634989685

  2. gui: Set CConnman byte counters earlier to avoid uninitialized reads
    Initialize CConnman byte counters during construction, so GetTotalBytesRecv()
    and GetTotalBytesSent() methods don't return garbage before Start() is called.
    
    Change shouldn't have any effect outside of the GUI. It just fixes a race
    condition during a qt test that was observed on travis:
    https://travis-ci.org/bitcoin/bitcoin/jobs/634989685
    8313fa8e81
  3. ryanofsky cross-referenced this on Jan 10, 2020 from issue Multiprocess bitcoin by ryanofsky
  4. fanquake added the label P2P on Jan 10, 2020
  5. naumenkogs commented at 10:00 PM on January 10, 2020: member

    ACK

  6. promag commented at 10:41 PM on January 10, 2020: member

    ACK 8313fa8e8112e429e104b7e7fd48e5e6e359b82e. @practicalswift there was some work to catch these right?

  7. DrahtBot commented at 10:45 PM on January 10, 2020: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #17891 (scripted-diff: Replace CCriticalSection with RecursiveMutex by MarcoFalke)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. emilengler commented at 2:59 PM on January 13, 2020: contributor

    ACK

  9. MarcoFalke commented at 6:26 PM on January 13, 2020: member

    ACK 8313fa8e8112e429e104b7e7fd48e5e6e359b82e

    I'd say to also remove the nTotalBytesRecv = 0 from the Start method to reduce the amount of code and make the values persist even if Start is called twice on the same object.

  10. fanquake referenced this in commit a4a93a0bad on Jan 14, 2020
  11. fanquake merged this on Jan 14, 2020
  12. fanquake closed this on Jan 14, 2020

  13. fanquake cross-referenced this on Jan 14, 2020 from issue scripted-diff: Replace CCriticalSection with RecursiveMutex by MarcoFalke
  14. MarkLTZ referenced this in commit ad22bb5940 on Jan 21, 2020
  15. MarkLTZ cross-referenced this on Apr 4, 2020 from issue Bitcoin PR tracking by MarkLTZ
  16. jasonbcox referenced this in commit a4571e1aed on Nov 17, 2020
  17. PastaPastaPasta referenced this in commit ad910b69d2 on Jun 27, 2021
  18. PastaPastaPasta referenced this in commit 2522674f57 on Jun 28, 2021
  19. PastaPastaPasta referenced this in commit 6a15a84ec2 on Jun 29, 2021
  20. PastaPastaPasta referenced this in commit f9725dd7e0 on Jul 1, 2021
  21. PastaPastaPasta referenced this in commit d22032554c on Jul 1, 2021
  22. PastaPastaPasta referenced this in commit 9c05a6328a on Jul 14, 2021
  23. PastaPastaPasta referenced this in commit 08b9cb8ecf on Jul 14, 2021
  24. PastaPastaPasta referenced this in commit ac4670e62d on Jul 15, 2021
  25. CharesFang cross-referenced this on Dec 8, 2021 from issue Backports from Bitcoin by CharesFang
  26. CharesFang cross-referenced this on Dec 8, 2021 from issue Backports from Bitcoin by CharesFang
  27. fluksurasak approved
  28. CharesFang cross-referenced this on Dec 9, 2021 from issue Backports from Bitcoin by CharesFang
  29. CharesFang cross-referenced this on Dec 9, 2021 from issue Backports from Bitcoin by CharesFang
  30. CharesFang cross-referenced this on Dec 9, 2021 from issue Backports from Bitcoin by CharesFang
  31. CharesFang cross-referenced this on Dec 9, 2021 from issue Backports from Bitcoin by CharesFang
  32. CharesFang cross-referenced this on Dec 11, 2021 from issue Backports from Bitcoin by CharesFang
  33. CharesFang cross-referenced this on Dec 12, 2021 from issue Backports from Bitcoin by CharesFang
  34. CharesFang cross-referenced this on Dec 13, 2021 from issue [Backport] Backports from Bitcoin by CharesFang
  35. alamshafil cross-referenced this on Dec 23, 2021 from issue Bitcoin Backports by alamshafil
  36. gades referenced this in commit 05372e9c30 on May 18, 2022
  37. bitcoin locked this on Dec 8, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:54 UTC