bitcoin/ci/test
MarcoFalke 4aaeb04497
Merge #17205: ci: Enable address sanitizer (ASan) stack-use-after-return checking
8d22ab0e50 ci: Enable address sanitizer (ASan) stack-use-after-return checking (practicalswift)

Pull request description:

  Enable address sanitizer (ASan) stack-use-after-return checking (`detect_stack_use_after_return=1`).

  Example:

  ```
  #include <iostream>
  #include <string>

  const std::string& get_string(int i) {
      return std::to_string(i);
  }

  int main() {
      std::cout << get_string(41) << "\n";
  }
  ```

  Without address sanitizer (ASan) stack-use-after-return checking:

  ```
  $ ./stack-use-after-return

  $
  ```

  With address sanitizer (ASan) stack-use-after-return checking:

  ```
  $ ASAN_OPTIONS="detect_stack_use_after_return=1" ./stack-use-after-return
  =================================================================
  ==10400==ERROR: AddressSanitizer: stack-use-after-return on address 0x7f7fa0400030 at pc 0x00000049d2cc bp 0x7ffcbd617070 sp 0x7ffcbd616820
  READ of size 2 at 0x7f7abbecd030 thread T0
      #0 0x439781 in fwrite
      #1 0x7f7ac0504cb3 in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x113cb3)
      #2 0x4f9b5f in main stack-use-after-return.cpp:9:15
      #3 0x7f7abf440b96 in __libc_start_main
      #4 0x41bbc9 in _start
  …
  $
  ```

Top commit has no ACKs.

Tree-SHA512: 6557a9ff184023380fd9aa433cdf413e01a928ea99dbc59ec138e5d69cb9e13592e8bb5951612f231ff17a37a895bec5c0940c8db5f328a5c840a5771bdeeba5
2019-10-22 13:14:16 -04:00
..
00_setup_env_amd64_asan.sh build: disable BIP70 support by default 2019-09-12 20:28:17 +10:00
00_setup_env_amd64_fuzz.sh Enable UBSan for Travis fuzzer job 2019-10-01 08:23:34 +00:00
00_setup_env_amd64_nowallet.sh ci: Add environment files for all settings 2019-08-16 08:46:37 -04:00
00_setup_env_amd64_qt5.sh build: disable BIP70 support by default 2019-09-12 20:28:17 +10:00
00_setup_env_amd64_trusty.sh build: disable BIP70 support by default 2019-09-12 20:28:17 +10:00
00_setup_env_amd64_tsan.sh build: disable BIP70 support by default 2019-09-12 20:28:17 +10:00
00_setup_env_arm.sh ci: Run tests on arm 2019-10-09 09:33:07 -04:00
00_setup_env_i686.sh build: make protobuf optional in depends 2019-09-14 12:58:59 +08:00
00_setup_env_mac_functional.sh ci: Remove redundant check for TRAVIS_OS_NAME 2019-10-17 11:30:36 -04:00
00_setup_env_mac.sh ci: Add environment files for all settings 2019-08-16 08:46:37 -04:00
00_setup_env_win64.sh ci: Add environment files for all settings 2019-08-16 08:46:37 -04:00
00_setup_env.sh ci: Use busybox utils for one build 2019-10-02 10:01:04 -04:00
03_before_install.sh ci: Use ./ci/ on non-travis host 2019-08-15 11:13:09 -04:00
04_install.sh ci: Enable address sanitizer (ASan) stack-use-after-return checking 2019-10-21 10:04:28 +00:00
05_before_script.sh ci: Remove redundant check for TRAVIS_OS_NAME 2019-10-17 11:30:36 -04:00
06_script_a.sh travis: run tests on macOS native 2019-10-14 23:00:49 +02:00
06_script_b.sh travis: run tests on macOS native 2019-10-14 23:00:49 +02:00