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 force-pushed on Mar 20, 2020
  3. 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:```
    
  4. DrahtBot added the label Tests on Mar 20, 2020
  5. practicalswift force-pushed on Mar 21, 2020
  6. practicalswift commented at 8:25 AM on March 21, 2020: contributor

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

  7. 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.

  8. 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>
    
  9. tests: Don't assume presence of __builtin_mul_overflow in MultiplicationOverflow(...) fuzzing harness 7c1ac70c01
  10. practicalswift force-pushed on Mar 22, 2020
  11. 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? :)

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

    ACK 7c1ac70

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

  15. Fabcien referenced this in commit 2fb7c38be9 on Jan 20, 2021
  16. practicalswift deleted the branch on Apr 10, 2021
  17. kittywhiskers referenced this in commit cc894f53ac on Jun 14, 2022
  18. kittywhiskers referenced this in commit 5cac560089 on Jun 14, 2022
  19. kittywhiskers referenced this in commit 4b973a629d on Jun 14, 2022
  20. kittywhiskers referenced this in commit 50e2ee9263 on Jun 18, 2022
  21. kittywhiskers referenced this in commit a9cdcdf810 on Jun 18, 2022
  22. kittywhiskers referenced this in commit ddbc061c70 on Jul 4, 2022
  23. kittywhiskers referenced this in commit a53c0d47dd on Jul 4, 2022
  24. kittywhiskers referenced this in commit 2638feb429 on Jul 6, 2022
  25. kittywhiskers referenced this in commit 5202b5b133 on Jul 6, 2022
  26. kittywhiskers referenced this in commit 19d80a7756 on Jul 6, 2022
  27. kittywhiskers referenced this in commit b8f47fd2f0 on Jul 13, 2022
  28. kittywhiskers referenced this in commit 3b9bc31c9d on Jul 13, 2022
  29. kittywhiskers referenced this in commit bf04694e73 on Jul 15, 2022
  30. PastaPastaPasta referenced this in commit 30d6584cb6 on Jul 17, 2022
  31. DrahtBot 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-04-16 15:14 UTC

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