libc/libstdc++ sanity checks #4339

pull theuni wants to merge 3 commits into bitcoin:master from theuni:sanity-checks changing 6 files +137 −4
  1. theuni commented at 11:18 pm on June 14, 2014: member

    Addresses #4081.

    These are always enabled on all platforms, with the exception of the FD_SET test, which is irrelevant on platforms that don’t use select().

    Great care was taken to ensure that the tests (memcpy in particular) are not optimized away by the compiler, which would obviously defeat the purpose of the runtime checks.

  2. in src/compat/glibcxx_sanity.cpp: in 2c51151345 outdated
    47+    catch (const std::out_of_range&)
    48+    {
    49+        return true;
    50+    }
    51+    catch (...){}
    52+   return false;
    


    leofidus commented at 2:35 am on June 16, 2014:
    indentation is slightly off here
  3. in src/init.cpp: in 2c51151345 outdated
    417@@ -417,8 +418,8 @@ bool InitSanityCheck(void)
    418                   "information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries");
    419         return false;
    420     }
    421-
    422-    // TODO: remaining sanity checks, see #4081
    423+    if (!glibc_sanity_test() || !glibcxx_sanity_test())
    424+      return false;
    


    leofidus commented at 2:37 am on June 16, 2014:
    also this indentation
  4. in src/compat/glibcxx_sanity.cpp: in 2c51151345 outdated
    21+{
    22+    std::list<int> test;
    23+    for (unsigned int i = 0; i != size; ++i)
    24+        test.push_back(i+1);
    25+
    26+    while (!test.empty())
    


    leofidus commented at 2:40 am on June 16, 2014:
    maybe verify the length of the list after adding all elements just to be sure?

    theuni commented at 1:44 pm on June 16, 2014:
    agreed. will do.
  5. leofidus commented at 2:41 am on June 16, 2014: none
    Looks good as far as I can tell.
  6. laanwj commented at 1:19 pm on June 16, 2014: member
    ACK when pulltester is happy
  7. theuni commented at 1:24 pm on June 16, 2014: member
    Didn’t get around to cleaning this up over the weekend, but I’ll push a fixed version later today.
  8. jgarzik commented at 1:39 pm on June 16, 2014: contributor
    ACK otherwise, once pulltester is happy
  9. sanity: autoconf check for sys/select.h 11404af34c
  10. sanity: add libc/stdlib sanity checks
    These are meant to test our back-compat stubs, but they are enabled for all
    builds for the sake of consistency.
    679240d0e9
  11. sanity: hook up sanity checks 92a6220711
  12. BitcoinPullTester commented at 10:09 pm on June 16, 2014: none
    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/92a6220711b3f98c3daad8a8dcdf13f09ce484fd for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
  13. laanwj merged this on Jun 18, 2014
  14. laanwj closed this on Jun 18, 2014

  15. laanwj referenced this in commit b8e56aa8ef on Jun 18, 2014
  16. fanquake referenced this in commit 52f0be3a93 on Mar 10, 2021
  17. laanwj referenced this in commit af6ee17545 on Mar 16, 2021
  18. MarcoFalke locked this on Sep 8, 2021

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-12-19 03:12 UTC

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