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: member

    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. fanquake added the label P2P on Jan 10, 2020
  4. naumenkogs commented at 10:00 pm on January 10, 2020: member
    ACK
  5. promag commented at 10:41 pm on January 10, 2020: member
    ACK 8313fa8e8112e429e104b7e7fd48e5e6e359b82e. @practicalswift there was some work to catch these right?
  6. DrahtBot commented at 10:45 pm on January 10, 2020: member

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

    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.

  7. emilengler commented at 2:59 pm on January 13, 2020: contributor
    ACK
  8. 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.

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

  12. MarkLTZ referenced this in commit ad22bb5940 on Jan 21, 2020
  13. jasonbcox referenced this in commit a4571e1aed on Nov 17, 2020
  14. PastaPastaPasta referenced this in commit ad910b69d2 on Jun 27, 2021
  15. PastaPastaPasta referenced this in commit 2522674f57 on Jun 28, 2021
  16. PastaPastaPasta referenced this in commit 6a15a84ec2 on Jun 29, 2021
  17. PastaPastaPasta referenced this in commit f9725dd7e0 on Jul 1, 2021
  18. PastaPastaPasta referenced this in commit d22032554c on Jul 1, 2021
  19. PastaPastaPasta referenced this in commit 9c05a6328a on Jul 14, 2021
  20. PastaPastaPasta referenced this in commit 08b9cb8ecf on Jul 14, 2021
  21. PastaPastaPasta referenced this in commit ac4670e62d on Jul 15, 2021
  22. fluksurasak approved
  23. gades referenced this in commit 05372e9c30 on May 18, 2022
  24. DrahtBot 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: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me