build: Run functional tests and benchmarks under the undefined behaviour sanitizer (UBSan) #14252

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:ubsan changing 3 files +31 −12
  1. practicalswift commented at 8:51 AM on September 18, 2018: contributor

    Run functional tests and benchmarks under the undefined behaviour sanitizer (UBSan).

    This will make Travis automatically detect issues such as:

    • #14242: Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid string is passed to DecodeSecret(...)
    • #14239: Avoid dividing by zero (undefined behaviour) in EstimateMedianVal (policy)/ConnectTip (validation)/CreateTransaction (wallet)
    • #13546: wallet: Avoid potential use of uninitialized value bnb_used in CWallet::CreateTransaction(...)

    Addresses issue #14059.

  2. practicalswift force-pushed on Sep 18, 2018
  3. DrahtBot commented at 10:04 AM on September 18, 2018: 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:

    • #14528 (travis: Compile once on xenial by MarcoFalke)
    • #14489 (refactor: Drop boost::thread and boost::chrono by ken2812221)
    • #14092 (tests: Dry run bench_bitcoin as part "make check" to allow for quick identification of assertion/sanitizer failures in benchmarking code by practicalswift)
    • #12134 (Build previous releases and run functional tests by Sjors)

    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.

  4. DrahtBot cross-referenced this on Sep 18, 2018 from issue Document intentional and unintentional unsigned integer overflows (wraparounds) using annotations by practicalswift
  5. fanquake added the label Tests on Sep 18, 2018
  6. DrahtBot cross-referenced this on Sep 18, 2018 from issue build: Add address sanitizer (ASan) Travis job by practicalswift
  7. in .travis.yml:114 in e931169591 outdated
     105 | -        HOST=x86_64-unknown-linux-gnu
     106 | -        PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libssl1.0-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libprotobuf-dev protobuf-compiler libqrencode-dev"
     107 | -        NO_DEPENDS=1
     108 | -        GOAL="install"
     109 | -        BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER"
     110 | -# x86_64 Linux (sanitizers)
    


    ken2812221 commented at 1:22 AM on September 19, 2018:

    Why do you remove this job?


    practicalswift commented at 7:18 AM on September 19, 2018:

    It is not removed - the two jobs are merged in accordance to this comment:

    Disabled for now, can be combined with the other x86_64 linux NO_DEPENDS job
    when functional tests pass the sanitizers
    

    Let me know if you see any technical reasons for not doing that job merge :-)

  8. practicalswift cross-referenced this on Sep 20, 2018 from issue functional tests fail --with-sanitizers=undefined by MarcoFalke
  9. practicalswift commented at 9:36 PM on September 27, 2018: contributor

    @MarcoFalke Would you mind reviewing? :-) This would help solve the issue #14059 which you posted :-)

  10. DrahtBot commented at 7:36 AM on September 28, 2018: contributor

    <!--32850dd3fdea838b4049e64f46995ea2-->

    Coverage Change (pull 14252) Reference (master)
    Lines +0.0022 % 87.0361 %
    Functions +0.0463 % 84.1130 %
    Branches -0.0076 % 51.5451 %
  11. practicalswift cross-referenced this on Oct 4, 2018 from issue fix assert crash when specified change output spend size is unknown by instagibbs
  12. practicalswift cross-referenced this on Oct 18, 2018 from issue Avoid 1 << 31 (UB) in calculation of SEQUENCE_LOCKTIME_DISABLE_FLAG by practicalswift
  13. DrahtBot cross-referenced this on Oct 20, 2018 from issue refactor: Drop boost::thread and boost::chrono by ken2812221
  14. DrahtBot cross-referenced this on Oct 20, 2018 from issue travis: Compile once on xenial by MarcoFalke
  15. DrahtBot cross-referenced this on Oct 20, 2018 from issue Build previous releases and run functional tests by Sjors
  16. DrahtBot added the label Needs rebase on Nov 2, 2018
  17. practicalswift force-pushed on Nov 5, 2018
  18. practicalswift commented at 12:53 PM on November 5, 2018: contributor

    Rebased!

  19. DrahtBot removed the label Needs rebase on Nov 5, 2018
  20. DrahtBot added the label Needs rebase on Nov 5, 2018
  21. practicalswift force-pushed on Nov 5, 2018
  22. practicalswift force-pushed on Nov 5, 2018
  23. in .travis.yml:120 in 9528a910fc outdated
     117 |        env: >-
     118 |          HOST=x86_64-unknown-linux-gnu
     119 |          PACKAGES="clang python3-zmq qtbase5-dev qttools5-dev-tools libssl1.0-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libprotobuf-dev protobuf-compiler libqrencode-dev"
     120 |          NO_DEPENDS=1
     121 | -        RUN_FUNCTIONAL_TESTS=false # Disabled for now, can be combined with the other x86_64 linux NO_DEPENDS job when functional tests pass the sanitizers
     122 | +        RUN_BENCH=true
    


    MarcoFalke commented at 4:22 PM on November 5, 2018:

    why?

    Also could be combined with the above job?


    practicalswift commented at 4:29 PM on November 5, 2018:

    Incorrect merge resolved. Please re-review :-)

  24. practicalswift force-pushed on Nov 5, 2018
  25. DrahtBot removed the label Needs rebase on Nov 5, 2018
  26. Enable functional tests in UBSAN job. Enable -fsanitize=integer (part of UBSAN). Merge UBSAN Travis job with no depends. 9f49db7335
  27. in .travis.yml:112 in 78cb1cd7d7 outdated
     117 |        env: >-
     118 |          HOST=x86_64-unknown-linux-gnu
     119 |          PACKAGES="clang python3-zmq qtbase5-dev qttools5-dev-tools libssl1.0-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libprotobuf-dev protobuf-compiler libqrencode-dev"
     120 |          NO_DEPENDS=1
     121 | -        RUN_FUNCTIONAL_TESTS=false # Disabled for now, can be combined with the other x86_64 linux NO_DEPENDS job when functional tests pass the sanitizers
     122 | +        RUN_FUNCTIONAL_TESTS=true
    


    MarcoFalke commented at 4:43 PM on November 5, 2018:

    The default is already true. Could remove this line?


    practicalswift commented at 7:10 PM on November 5, 2018:

    Done! Please re-review :-)

  28. practicalswift force-pushed on Nov 5, 2018
  29. MarcoFalke commented at 7:32 PM on November 5, 2018: member

    utACK 9f49db7335cbcd9d3c726d965604ff3316bc38e5

  30. MarcoFalke merged this on Nov 5, 2018
  31. MarcoFalke closed this on Nov 5, 2018

  32. MarcoFalke referenced this in commit 1ba5583646 on Nov 5, 2018
  33. practicalswift cross-referenced this on Nov 6, 2018 from issue travis: Fail the UBSan Travis build in case of newly introduced UBSan errors by practicalswift
  34. MarcoFalke referenced this in commit d864e45730 on Nov 6, 2018
  35. practicalswift cross-referenced this on Mar 7, 2020 from issue build: Add MemorySanitizer (MSan) in Travis to detect use of uninitialized memory by practicalswift
  36. MarcoFalke referenced this in commit 7027c67cac on Jul 2, 2020
  37. practicalswift deleted the branch on Apr 10, 2021
  38. PastaPastaPasta referenced this in commit 1197a1f392 on Aug 16, 2021
  39. PastaPastaPasta referenced this in commit 3159471f89 on Aug 16, 2021
  40. PastaPastaPasta referenced this in commit 857fae9277 on Aug 16, 2021
  41. PastaPastaPasta referenced this in commit 847192d1f5 on Aug 16, 2021
  42. PastaPastaPasta referenced this in commit 009f0059b9 on Aug 17, 2021
  43. PastaPastaPasta referenced this in commit ad29f7f495 on Aug 17, 2021
  44. PastaPastaPasta referenced this in commit b98e643250 on Aug 18, 2021
  45. PastaPastaPasta referenced this in commit 0643014cb2 on Aug 18, 2021
  46. vijaydasmp referenced this in commit dfa262c93f on Oct 4, 2021
  47. gades referenced this in commit 7c4d74079c on Apr 20, 2022
  48. gades referenced this in commit d4d6aafea7 on Apr 20, 2022
  49. bitcoin locked this on Aug 16, 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