ci: Remove unused errtrace trap ERR #27667

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2305-ci-trap-err- changing 1 files +0 −3
  1. maflcko commented at 8:10 am on May 16, 2023: member

    This was added in commit 069752b72613b772a9536a3e7f15fa75097f2946, presumably at a time when the functional tests wouldn’t capture stderr.

    Now that all tests capture and print stderr on failure, it can be removed. Reference:

    • Unit tests capture via 2>&1:

    https://github.com/bitcoin/bitcoin/blob/d7700d3a26478d9b1648463c188648c7047b1c60/src/Makefile.test.include#L421

    • Functional tests capture as well:

    https://github.com/bitcoin/bitcoin/blob/d7700d3a26478d9b1648463c188648c7047b1c60/test/functional/test_framework/test_node.py#L356

  2. ci: Remove unused errtrace trap ERR fad09b703f
  3. DrahtBot commented at 8:10 am on May 16, 2023: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK fanquake, hebasto

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on May 16, 2023
  5. fanquake approved
  6. fanquake commented at 9:19 am on May 16, 2023: member
    ACK fad09b703f5c6d8524a09eef771eb4525f9f3225
  7. maflcko commented at 9:34 am on May 16, 2023: member

    Can be tested with a diff injecting a fault:

     0diff --git a/src/init.cpp b/src/init.cpp
     1index 52c5780..95839c0 100644
     2--- a/src/init.cpp
     3+++ b/src/init.cpp
     4@@ -891,6 +891,9 @@ bool AppInitParameterInteraction(const ArgsManager& args, bool use_syscall_sandb
     5 
     6     // Signal NODE_COMPACT_FILTERS if peerblockfilters and basic filters index are both enabled.
     7     if (args.GetBoolArg("-peerblockfilters", DEFAULT_PEERBLOCKFILTERS)) {
     8+           int a{-1};
     9+           unsigned b = a;
    10+           (void)b;
    11         if (g_enabled_filter_types.count(BlockFilterType::BASIC) != 1) {
    12             return InitError(_("Cannot set -peerblockfilters without -blockfilterindex."));
    13         }
    14diff --git a/src/test/util_threadnames_tests.cpp b/src/test/util_threadnames_tests.cpp
    15index ae91393..9b7ad55 100644
    16--- a/src/test/util_threadnames_tests.cpp
    17+++ b/src/test/util_threadnames_tests.cpp
    18@@ -68,6 +68,9 @@ BOOST_AUTO_TEST_CASE(util_threadnames_test_rename_threaded)
    19         BOOST_CHECK(names.find(TEST_THREAD_NAME_BASE + ToString(i)) != names.end());
    20     }
    21 
    22+    int a{-1};
    23+    unsigned b = a;
    24+    (void)b;
    25 }
    26 
    27 BOOST_AUTO_TEST_SUITE_END()
    

    To test for the unit tests:

    0podman kill ci_native_asan || true && MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_native_asan.sh" ./ci/test_run_all.sh
    

    With result:

     0test/prevector_tests.cpp(17): Test suite "prevector_tests" is skipped because disabled
     1test/util_threadnames_tests.cpp(20): Entering test suite "util_threadnames_tests"
     2test/util_threadnames_tests.cpp(55): Entering test case "util_threadnames_test_rename_threaded"
     3test/util_threadnames_tests.cpp:72:18: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
     4    [#0](/bitcoin-bitcoin/0/) 0xaaaadddc5720 in util_threadnames_tests::util_threadnames_test_rename_threaded::test_method() src/test/util_threadnames_tests.cpp:72:18
     5    [#1](/bitcoin-bitcoin/1/) 0xaaaadddc38b8 in util_threadnames_tests::util_threadnames_test_rename_threaded_invoker() src/test/util_threadnames_tests.cpp:55:1
     6    [#2](/bitcoin-bitcoin/2/) 0xaaaadcbe5304 in boost::function0<void>::operator()() const /usr/include/boost/function/function_template.hpp:763:14
     7    [#3](/bitcoin-bitcoin/3/) 0xaaaadcc62fd0 in boost::detail::forward::operator()() /usr/include/boost/test/impl/execution_monitor.ipp:1388:32
     8    [#4](/bitcoin-bitcoin/4/) 0xaaaadcc62fd0 in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:137:18
     9    [#5](/bitcoin-bitcoin/5/) 0xaaaadcc5c438 in boost::function0<int>::operator()() const /usr/include/boost/function/function_template.hpp:763:14
    10    [#6](/bitcoin-bitcoin/6/) 0xaaaadcb32318 in int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()>>(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:301:30
    11    [#7](/bitcoin-bitcoin/7/) 0xaaaadcb32318 in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:903:16
    12    [#8](/bitcoin-bitcoin/8/) 0xaaaadcb32748 in boost::execution_monitor::execute(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1301:16
    13    [#9](/bitcoin-bitcoin/9/) 0xaaaadcb24758 in boost::execution_monitor::vexecute(boost::function<void ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1397:5
    14    [#10](/bitcoin-bitcoin/10/) 0xaaaadcb2b444 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /usr/include/boost/test/impl/unit_test_monitor.ipp:49:9
    15    [#11](/bitcoin-bitcoin/11/) 0xaaaadcba4eac in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:815:44
    16    [#12](/bitcoin-bitcoin/12/) 0xaaaadcba3e90 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:784:58
    17    [#13](/bitcoin-bitcoin/13/) 0xaaaadcba3e90 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:784:58
    18    [#14](/bitcoin-bitcoin/14/) 0xaaaadcb297fc in boost::unit_test::framework::run(unsigned long, bool) /usr/include/boost/test/impl/framework.ipp:1721:29
    19    [#15](/bitcoin-bitcoin/15/) 0xaaaadcb5a9a8 in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /usr/include/boost/test/impl/unit_test_main.ipp:250:9
    20    [#16](/bitcoin-bitcoin/16/) 0xffff9fb66dbc  (/lib/aarch64-linux-gnu/libc.so.6+0x26dbc) (BuildId: 9efe43e32e614cad22a180ef036eea6154eafdc2)
    21    [#17](/bitcoin-bitcoin/17/) 0xffff9fb66e94 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x26e94) (BuildId: 9efe43e32e614cad22a180ef036eea6154eafdc2)
    22    [#18](/bitcoin-bitcoin/18/) 0xaaaadca2bf6c in _start (/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/test/test_bitcoin+0x107bf6c) (BuildId: e6232accf8d12124a11d947626dab631bc8c9c37)
    23
    24SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change test/util_threadnames_tests.cpp:72:18 in 
    25make[3]: *** [Makefile:22120: test/util_threadnames_tests.cpp.test] Error 1
    26make[3]: *** Waiting for unfinished jobs....
    27make[3]: Leaving directory '/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src'
    28make[2]: *** [Makefile:20096: check-am] Error 2
    29make[2]: Leaving directory '/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src'
    30make[1]: *** [Makefile:19761: check-recursive] Error 1
    31make[1]: Leaving directory '/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src'
    32make: *** [Makefile:816: check-recursive] Error 1
    

    To test for the functional tests (skip unit tests):

    0podman kill ci_native_asan || true && RUN_UNIT_TESTS=false TEST_RUNNER_EXTRA="p2p_blockfilters" MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_native_asan.sh" ./ci/test_run_all.sh
    

    With result:

      0Ran 11 tests in 2.543s
      1
      2OK
      3Running Unit Tests for Test Framework Modules
      4Remaining jobs: [p2p_blockfilters.py]
      51/1 - p2p_blockfilters.py failed, Duration: 2 s
      6
      7stdout:
      82023-05-16T09:23:21.794000Z TestFramework (INFO): PRNG seed is: 5743461567751360021
      92023-05-16T09:23:21.795000Z TestFramework (INFO): Initializing test directory /root/b-c-ci/ci/scratch/test_runner/test_runner__🏃_20230516_092319/p2p_blockfilters_0
     102023-05-16T09:23:23.801000Z TestFramework (ERROR): Assertion failed
     11Traceback (most recent call last):
     12  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 560, in start_nodes
     13    node.wait_for_rpc_connection()
     14  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_node.py", line 231, in wait_for_rpc_connection
     15    raise FailedToStartError(self._node_msg(
     16test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization
     17
     18During handling of the above exception, another exception occurred:
     19
     20Traceback (most recent call last):
     21  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 131, in main
     22    self.setup()
     23  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 298, in setup
     24    self.setup_network()
     25  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 392, in setup_network
     26    self.setup_nodes()
     27  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 414, in setup_nodes
     28    self.start_nodes()
     29  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 563, in start_nodes
     30    self.stop_nodes()
     31  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 578, in stop_nodes
     32    node.stop_node(wait=wait, wait_until_stopped=False)
     33  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_node.py", line 342, in stop_node
     34    self.stop(wait=wait)
     35    ^^^^^^^^^
     36  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_node.py", line 190, in __getattr__
     37    assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
     38                                  ^^^^^^^^^^^^^^^^^^^^
     39AssertionError: [node 0] Error: no RPC connection
     402023-05-16T09:23:23.854000Z TestFramework (INFO): Stopping nodes
     41[node 1] Cleaning up leftover process
     42[node 0] Cleaning up leftover process
     43
     44
     45stderr:
     46Traceback (most recent call last):
     47  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/p2p_blockfilters.py", line 274, in <module>
     48    CompactFiltersTest().main()
     49  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 155, in main
     50    exit_code = self.shutdown()
     51                ^^^^^^^^^^^^^^^
     52  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 314, in shutdown
     53    self.stop_nodes()
     54  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 578, in stop_nodes
     55    node.stop_node(wait=wait, wait_until_stopped=False)
     56  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_node.py", line 342, in stop_node
     57    self.stop(wait=wait)
     58    ^^^^^^^^^
     59  File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_node.py", line 190, in __getattr__
     60    assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
     61                                  ^^^^^^^^^^^^^^^^^^^^
     62AssertionError: [node 0] Error: no RPC connection
     63
     64
     65Combine the logs and print the last 99999999 lines ...
     66
     67============
     68Combined log for /root/b-c-ci/ci/scratch/test_runner//test_runner__🏃_20230516_092319/p2p_blockfilters_0:
     69============
     70
     71 test  2023-05-16T09:23:21.794000Z TestFramework (INFO): PRNG seed is: 5743461567751360021
     72 test  2023-05-16T09:23:21.794000Z TestFramework (DEBUG): Setting up network thread
     73 test  2023-05-16T09:23:21.795000Z TestFramework (INFO): Initializing test directory /root/b-c-ci/ci/scratch/test_runner/test_runner__🏃_20230516_092319/p2p_blockfilters_0
     74 test  2023-05-16T09:23:21.797000Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up
     75 test  2023-05-16T09:23:21.797000Z TestFramework.node1 (DEBUG): bitcoind started, waiting for RPC to come up
     76 test  2023-05-16T09:23:23.801000Z TestFramework.node0 (DEBUG): Stopping node
     77 test  2023-05-16T09:23:23.801000Z TestFramework (ERROR): Assertion failed
     78                                   Traceback (most recent call last):
     79                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 560, in start_nodes
     80                                       node.wait_for_rpc_connection()
     81                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_node.py", line 231, in wait_for_rpc_connection
     82                                       raise FailedToStartError(self._node_msg(
     83                                   test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization
     84                                   During handling of the above exception, another exception occurred:
     85                                   Traceback (most recent call last):
     86                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 131, in main
     87                                       self.setup()
     88                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 298, in setup
     89                                       self.setup_network()
     90                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 392, in setup_network
     91                                       self.setup_nodes()
     92                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 414, in setup_nodes
     93                                       self.start_nodes()
     94                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 563, in start_nodes
     95                                       self.stop_nodes()
     96                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 578, in stop_nodes
     97                                       node.stop_node(wait=wait, wait_until_stopped=False)
     98                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_node.py", line 342, in stop_node
     99                                       self.stop(wait=wait)
    100                                       ^^^^^^^^^
    101                                     File "/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/functional/test_framework/test_node.py", line 190, in __getattr__
    102                                       assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
    103                                                                     ^^^^^^^^^^^^^^^^^^^^
    104                                   AssertionError: [node 0] Error: no RPC connection
    105 test  2023-05-16T09:23:23.804000Z TestFramework (DEBUG): Closing down network thread
    106 test  2023-05-16T09:23:23.854000Z TestFramework (INFO): Stopping nodes
    107 test  2023-05-16T09:23:23.855000Z TestFramework.node0 (DEBUG): Stopping node
    108
    109 node0 stderr init.cpp:895:25: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
    110    [#0](/bitcoin-bitcoin/0/) 0xaaaac678ca58 in AppInitParameterInteraction(ArgsManager const&, bool) src/init.cpp:895:25
    111    [#1](/bitcoin-bitcoin/1/) 0xaaaac6758c44 in AppInit(node::NodeContext&, int, char**) src/bitcoind.cpp:176:14
    112    [#2](/bitcoin-bitcoin/2/) 0xaaaac6758c44 in main src/bitcoind.cpp:267:13
    113    [#3](/bitcoin-bitcoin/3/) 0xffff96676dbc  (/lib/aarch64-linux-gnu/libc.so.6+0x26dbc) (BuildId: 9efe43e32e614cad22a180ef036eea6154eafdc2)
    114    [#4](/bitcoin-bitcoin/4/) 0xffff96676e94 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x26e94) (BuildId: 9efe43e32e614cad22a180ef036eea6154eafdc2)
    115    [#5](/bitcoin-bitcoin/5/) 0xaaaac667f06c in _start (/root/b-c-ci/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/bitcoind+0x98f06c) (BuildId: 5e23ce6e2e3afe05858f3446a0371be08b6d268a)
    116
    117SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change init.cpp:895:25 in
    118
    119TEST                | STATUS    | DURATION
    120
    121p2p_blockfilters.py |  Failed  | 2 s
    122
    123ALL                 |  Failed  | 2 s (accumulated) 
    124Runtime: 2 s
    
  8. hebasto approved
  9. hebasto commented at 1:37 pm on May 16, 2023: member
    ACK fad09b703f5c6d8524a09eef771eb4525f9f3225, tested on Ubuntu 22.04: I can still see warnings from the sanitizers in both unit and functional tests.
  10. fanquake merged this on May 16, 2023
  11. fanquake closed this on May 16, 2023

  12. maflcko deleted the branch on May 16, 2023
  13. sidhujag referenced this in commit 40e595df17 on May 17, 2023
  14. fanquake referenced this in commit b8b0d64765 on Mar 27, 2024
  15. bitcoin locked this on May 15, 2024

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-07-03 10:13 UTC

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