tests: Don't assume presence of __builtin_mul_overflow(…) in MultiplicationOverflow(…) fuzzing harness #18393

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:multiplication-overflow-fixup changing 1 files +14 −1
  1. practicalswift commented at 4:18 PM on March 20, 2020: contributor

    Don't assume presence of __builtin_mul_overflow(…) in MultiplicationOverflow(…) fuzzing harness.

    Fixes #18389.

  2. practicalswift cross-referenced this on Mar 20, 2020 from issue fuzzing: compilation error ‘__builtin_mul_overflow’ does not have pointer to integer type by naumenkogs
  3. practicalswift force-pushed on Mar 20, 2020
  4. naumenkogs commented at 4:44 PM on March 20, 2020: member

    Using 3748e1daec3f3b597e642d5eb86adb21fade6e36, got this with gcc:

     #if defined(__has_builtin) && __has_builtin(__builtin_mul_overflow)
                                                ^
    In file included from ./util/system.h:22:0,
                     from ./addrman.h:15,
                     from test/fuzz/deserialize.cpp:6:```
    
  5. DrahtBot added the label Tests on Mar 20, 2020
  6. practicalswift force-pushed on Mar 21, 2020
  7. practicalswift commented at 8:25 AM on March 21, 2020: contributor

    @naumenkogs Oh, thanks! Clang-isms now removed :) Please re-review!

  8. naumenkogs commented at 4:49 PM on March 21, 2020: member
    test/fuzz/multiplication_overflow.cpp: In instantiation of ‘void {anonymous}::TestMultiplicationOverflow(FuzzedDataProvider&) [with T = bool]’:
    test/fuzz/multiplication_overflow.cpp:55:58:   required from here
    test/fuzz/multiplication_overflow.cpp:30:75: error: argument 3 in call to function ‘__builtin_mul_overflow’ does not have pointer to integer type
         const bool is_multiplication_overflow_builtin = __builtin_mul_overflow(i, j, &result_builtin);
                                                                               ^
    afl-as 2.52b by <lcamtuf@google.com>
    

    I also noticed that I have gcc 5.4.0. Perhaps I should just update my compilers? I dunno what are the expectations.

  9. naumenkogs commented at 5:50 PM on March 21, 2020: member

    Updated both compilers, didn't help with this particular issue I mention above.

    Update: Alright, got gcc-9.2.1. Seeing this instead:

    [+] Instrumented 2039 locations (64-bit, hardened mode, ratio 100%).
    test/fuzz/multiplication_overflow.cpp: In instantiation of ‘void {anonymous}::TestMultiplicationOverflow(FuzzedDataProvider&) [with T = bool]’:
    test/fuzz/multiplication_overflow.cpp:55:58:   required from here
    test/fuzz/multiplication_overflow.cpp:30:83: error: argument 3 in call to function ‘__builtin_mul_overflow’ has pointer to boolean type
       30 |     const bool is_multiplication_overflow_builtin = __builtin_mul_overflow(i, j, &result_builtin);
          |                                                                                   ^~~~~~~~~~~~~~
    afl-as 2.52b by <lcamtuf@google.com>
    
  10. tests: Don't assume presence of __builtin_mul_overflow in MultiplicationOverflow(...) fuzzing harness 7c1ac70c01
  11. practicalswift force-pushed on Mar 22, 2020
  12. practicalswift commented at 1:33 PM on March 22, 2020: contributor

    @naumenkogs Thanks for testing! Hopefully fixed now. Would you mind testing the latest version? :)

  13. naumenkogs commented at 6:10 PM on March 22, 2020: member

    ACK 7c1ac70

  14. MarcoFalke merged this on Mar 23, 2020
  15. MarcoFalke closed this on Mar 23, 2020

  16. MarkLTZ cross-referenced this on Apr 4, 2020 from issue Bitcoin PR tracking by MarkLTZ
  17. Fabcien referenced this in commit 2fb7c38be9 on Jan 20, 2021
  18. practicalswift deleted the branch on Apr 10, 2021
  19. kwvg referenced this in commit cc894f53ac on Jun 14, 2022
  20. kwvg referenced this in commit 5cac560089 on Jun 14, 2022
  21. kwvg referenced this in commit 4b973a629d on Jun 14, 2022
  22. kwvg referenced this in commit 50e2ee9263 on Jun 18, 2022
  23. kwvg referenced this in commit a9cdcdf810 on Jun 18, 2022
  24. kwvg referenced this in commit ddbc061c70 on Jul 4, 2022
  25. kwvg referenced this in commit a53c0d47dd on Jul 4, 2022
  26. kwvg referenced this in commit 2638feb429 on Jul 6, 2022
  27. kwvg referenced this in commit 5202b5b133 on Jul 6, 2022
  28. kwvg referenced this in commit 19d80a7756 on Jul 6, 2022
  29. kwvg referenced this in commit b8f47fd2f0 on Jul 13, 2022
  30. kwvg referenced this in commit 3b9bc31c9d on Jul 13, 2022
  31. kwvg referenced this in commit bf04694e73 on Jul 15, 2022
  32. PastaPastaPasta referenced this in commit 30d6584cb6 on Jul 17, 2022
  33. bitcoin locked this on Aug 18, 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