dash/ci/test
MarcoFalke 4929913f0d Merge #17674: tests: Add initialization order fiasco detection in Travis
1f9d5af4f197e7cc0469a0bb25dcbc51dfa537f4 tests: Add initialization order fiasco detection in Travis (practicalswift)

Pull request description:

  Add initialization order fiasco detection in Travis :)

  Context: https://github.com/bitcoin/bitcoin/pull/17670#issuecomment-562035813

  This would have caught the `events_hasher` initialization order issue introduced in #17573  and fixed in #17670.

  Output in case of an initialization order fiasco:

  ```
  ==7934==ERROR: AddressSanitizer: initialization-order-fiasco on address 0x557098d79200 at pc 0x55709796b9a3 bp 0x7ffde524dc30 sp 0x7ffde524dc28
  READ of size 8 at 0x557098d79200 thread T0
      #0 0x55709796b9a2 in CSHA256::Finalize(unsigned char*) src/crypto/sha256.cpp:667:25
      #1 0x5570978150e9 in SeedEvents(CSHA512&) src/random.cpp:462:19
      #2 0x5570978145e1 in SeedSlow(CSHA512&) src/random.cpp:482:5
      #3 0x5570978149a3 in SeedStartup(CSHA512&, (anonymous namespace)::RNGState&) src/random.cpp:527:5
      #4 0x55709781102d in ProcRand(unsigned char*, int, RNGLevel) src/random.cpp:571:9
      #5 0x557097810d19 in GetRandBytes(unsigned char*, int) src/random.cpp:576:59
      #6 0x557096c2f9d5 in (anonymous namespace)::CSignatureCache::CSignatureCache() src/script/sigcache.cpp:34:9
      #7 0x557096511977 in __cxx_global_var_init.7 src/script/sigcache.cpp:67:24
      #8 0x5570965119f8 in _GLOBAL__sub_I_sigcache.cpp src/script/sigcache.cpp
      #9 0x557097bba4ac in __libc_csu_init (src/bitcoind+0x18554ac)
      #10 0x7f214b1c2b27 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:266
      #11 0x5570965347d9 in _start (src/bitcoind+0x1cf7d9)

  0x557098d79200 is located 96 bytes inside of global variable 'events_hasher' defined in 'random.cpp:456:16' (0x557098d791a0) of size 104
    registered at:
      #0 0x557096545dfd in __asan_register_globals compiler-rt/lib/asan/asan_globals.cpp:360:3
      #1 0x557097817f8b in asan.module_ctor (src/bitcoind+0x14b2f8b)

  SUMMARY: AddressSanitizer: initialization-order-fiasco src/crypto/sha256.cpp:667:25 in CSHA256::Finalize(unsigned char*)
  ```

ACKs for top commit:
  promag:
    Tested ACK 1f9d5af4f197e7cc0469a0bb25dcbc51dfa537f4, got
  MarcoFalke:
    ACK 1f9d5af4f197e7cc0469a0bb25dcbc51dfa537f4 👔

Tree-SHA512: f24ac0a313df7549193bd7f4fcfdf9b72bdfc6a6ee31d0b08e6d0752e5108fbd532106b6c86377ae0641258c9adb4921872e5d9a0154c0284e03315e0777102c
2023-04-25 23:14:25 +03:00
..
00_setup_env_arm.sh ci: reconcile differences between ci setups 2022-07-01 09:04:01 +05:30
00_setup_env_i686_ubsan.sh ci: reconcile differences between ci setups 2022-07-01 09:04:01 +05:30
00_setup_env_i686.sh ci: reconcile differences between ci setups 2022-07-01 09:04:01 +05:30
00_setup_env_mac_host.sh ci: reconcile differences between ci setups 2022-07-01 09:04:01 +05:30
00_setup_env_mac.sh partial Merge bitcoin/bitcoin#19817: build: macOS toolchain bump 2023-03-26 16:50:26 -05:00
00_setup_env_native_centos.sh Merge #17635: ci: Add CentOS 7 build 2022-08-30 09:08:16 -05:00
00_setup_env_native_cxx20.sh ci: reconcile differences between ci setups 2022-07-01 09:04:01 +05:30
00_setup_env_native_fuzz_with_valgrind.sh Merge #18901: fuzz: use std::optional for sep_pos_opt variable 2023-01-23 11:21:05 -06:00
00_setup_env_native_fuzz.sh Merge #18901: fuzz: use std::optional for sep_pos_opt variable 2023-01-23 11:21:05 -06:00
00_setup_env_native_nowallet.sh ci: reconcile differences between ci setups 2022-07-01 09:04:01 +05:30
00_setup_env_native_qt5.sh ci: align TEST_RUNNER_EXTRA with INTEGRATION_TESTS_ARGS 2022-07-01 09:04:01 +05:30
00_setup_env_native_sqlite.sh ci: add sqlite-only linux64 test build 2023-02-17 14:21:19 -06:00
00_setup_env_native_tsan.sh Merge #14092: tests: Dry run bench_bitcoin as part "make check" to allow for quick identification of assertion/sanitizer failures in benchmarking code 2023-04-06 20:14:58 +03:00
00_setup_env_s390x.sh Merge #17661: ci: use depends for s390x 2023-04-25 23:14:25 +03:00
00_setup_env_win64.sh ci: reconcile differences between ci setups 2022-07-01 09:04:01 +05:30
00_setup_env.sh Partial Merge #17517: ci: Bump to clang-8 for asan build to avoid segfaults on ppc64le 2022-10-17 15:41:14 -05:00
03_before_install.sh
04_install.sh Merge #17674: tests: Add initialization order fiasco detection in Travis 2023-04-25 23:14:25 +03:00
05_before_script.sh merge bitcoin#17176: Cleanup macOS runs 2022-07-01 08:59:38 +05:30