diff --git a/.circleci/config.yml b/.circleci/config.yml index a5b0a6117..a73770798 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,14 +165,14 @@ jobs: - test/soltest - test/tools/solfuzzer - build_x86_clang7: + build_x86_clang7_asan: docker: - image: buildpack-deps:cosmic environment: TERM: xterm CC: /usr/bin/clang-7 CXX: /usr/bin/clang++-7 - CMAKE_OPTIONS: -DLLL=ON + CMAKE_OPTIONS: -DSANITIZE=address -DCMAKE_BUILD_TYPE=Debug steps: - checkout - run: @@ -183,6 +183,13 @@ jobs: ./scripts/install_obsolete_jsoncpp_1_7_4.sh - run: *setup_prerelease_commit_hash - run: *run_build + - store_artifacts: *solc_artifact + - persist_to_workspace: + root: build + paths: + - solc/solc + - test/soltest + - test/tools/solfuzzer build_x86_mac: macos: @@ -283,6 +290,36 @@ jobs: path: test_results/ destination: test_results/ + test_x86_clang7_asan: + docker: + - image: buildpack-deps:cosmic + environment: + TERM: xterm + steps: + - checkout + - attach_workspace: + at: build + - run: + name: Install dependencies + command: | + apt-get -qq update + apt-get -qy install llvm-7-dev libcvc4-dev libleveldb1v5 python-pip + # This is needed to resolve the symbols. Since we're using clang7 in the build, we must use the appropriate symbolizer. + update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-7 1 + - run: mkdir -p test_results + - run: + name: Run tests with ASAN + command: | + ulimit -a + # Increase stack size because ASan makes stack frames bigger and that breaks our assumptions (in tests). + ulimit -s 16384 + build/test/soltest --logger=JUNIT,test_suite,test_results/result.xml -- --no-ipc --testpath test + - store_test_results: + path: test_results/ + - store_artifacts: + path: test_results/ + destination: test_results/ + test_x86_archlinux: docker: - image: archlinux/base @@ -366,12 +403,18 @@ workflows: - build_emscripten - build_x86_linux: *build_on_tags - build_x86_linux_cxx17: *build_on_tags - - build_x86_clang7: *build_on_tags + - build_x86_clang7_asan: *build_on_tags - build_x86_mac: *build_on_tags - test_x86_linux: <<: *build_on_tags requires: - build_x86_linux + - test_x86_clang7_asan: + filters: + branches: + only: develop + requires: + - build_x86_clang7_asan - test_x86_mac: <<: *build_on_tags requires: diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 99c03af00..60ebe8863 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -74,7 +74,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # into errors, which makes sense. # http://stackoverflow.com/questions/21617158/how-to-silence-unused-command-line-argument-error-with-clang-without-disabling-i add_compile_options(-Qunused-arguments) - elseif(EMSCRIPTEN) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --memory-init-file 0") # Leave only exported symbols as public and aggressively remove others