From cb70c269c316e63293067ae6c79cf2af68d6870e Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Fri, 9 Jul 2021 17:18:29 -0400 Subject: [PATCH 01/12] Setup CI for ASAN --- .buildkite/sanitizers.yml | 29 ++++++++++++ contrib/asan.sh | 83 +++++++++++++++++++++++++++++++++++ contrib/check-asan.jl | 92 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 204 insertions(+) create mode 100644 .buildkite/sanitizers.yml create mode 100755 contrib/asan.sh create mode 100755 contrib/check-asan.jl diff --git a/.buildkite/sanitizers.yml b/.buildkite/sanitizers.yml new file mode 100644 index 0000000000000..f943316234313 --- /dev/null +++ b/.buildkite/sanitizers.yml @@ -0,0 +1,29 @@ +# These steps should only run on `sandbox.jl` machines, not `docker`-isolated ones +# since we need nestable sandboxing. The rootfs images being used here are built from +# the `.buildkite/rootfs_images/llvm-passes.jl` file. +agents: + queue: "julia" + # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing + sandbox.jl: "true" + os: "linux" + +steps: + - label: "asan" + key: asan + plugins: + - JuliaCI/julia#v1: + version: 1.6 + - staticfloat/sandbox#v1: + rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v1/llvm-passes.tar.gz + rootfs_treehash: "f3ed53f159e8f13edfba8b20ebdb8ece73c1b8a8" + uid: 1000 + gid: 1000 + workspaces: + - "/cache/repos:/cache/repos" + commands: | + contrib/asan.sh /tmp/test-asan -j$${JULIA_NUM_CORES} debug + contrib/check-asan.jl /tmp/test-asan/usr/bin/julia-debug + timeout_in_minutes: 60 + notify: + - github_commit_status: + context: "asan" diff --git a/contrib/asan.sh b/contrib/asan.sh new file mode 100755 index 0000000000000..98a4e460714b0 --- /dev/null +++ b/contrib/asan.sh @@ -0,0 +1,83 @@ +#!/bin/sh +# This file is a part of Julia. License is MIT: https://julialang.org/license +# +# Usage: +# contrib/asan.sh [...] +# +# Build ASAN-enabled julia checked out in the current directory. Given a +# workspace directory , build ASAN-enabled julia in /asan. Required +# toolss are install under /toolchain. This scripts also takes optional +# arguments which are passed to `make`. The default make target +# is `debug`. + +set -ue + +# `$WORKSPACE` is a directory in which we careate `toolchain` and `asan` +# sub-directories. +WORKSPACE="$1" +shift +if [ "$WORKSPACE" = "" ]; then + echo "Workspace directory must be specified as the first argument" >&2 + exit 2 +fi + +mkdir -pv "$WORKSPACE" +WORKSPACE="$(cd "$WORKSPACE" && pwd)" +if [ "$WORKSPACE" = "" ]; then + echo "Failed to create the workspace directory." >&2 + exit 2 +fi + +echo +echo "Installing toolchain..." + +TOOLCHAIN="$WORKSPACE/toolchain" +if [ ! -d "$TOOLCHAIN" ]; then + make configure O=$TOOLCHAIN + + cat < "$TOOLCHAIN/Make.user" + USE_BINARYBUILDER_LLVM=1 + BUILD_LLVM_CLANG=1 +EOD +fi + +make -C "$TOOLCHAIN/deps" install-clang install-llvm-tools + +echo +echo "Building Julia..." + +BUILD="$WORKSPACE/asan" +if [ ! -d "$BUILD" ]; then + make configure O="$BUILD" + + cat <<'EOD' | sed 's/^ *//' > "$BUILD/Make.user" + TOOLCHAIN=$(BUILDROOT)/../toolchain/usr/tools + + # use our new toolchain + USECLANG=1 + override CC=$(TOOLCHAIN)/clang + override CXX=$(TOOLCHAIN)/clang++ + export ASAN_SYMBOLIZER_PATH=$(TOOLCHAIN)/llvm-symbolizer + + USE_BINARYBUILDER_LLVM=1 + + override SANITIZE=1 + override SANITIZE_ADDRESS=1 + + # make the GC use regular malloc/frees, which are hooked by ASAN + override WITH_GC_DEBUG_ENV=1 + + # default to a debug build for better line number reporting + override JULIA_BUILD_MODE=debug + + # make ASAN consume less memory + export ASAN_OPTIONS=detect_leaks=0:fast_unwind_on_malloc=0:allow_user_segv_handler=1:malloc_context_size=2 + + JULIA_PRECOMPILE=1 + + # tell libblastrampoline to not use RTLD_DEEPBIND + export LBT_USE_RTLD_DEEPBIND=0 +EOD +fi + +make -C "$BUILD" "$@" diff --git a/contrib/check-asan.jl b/contrib/check-asan.jl new file mode 100755 index 0000000000000..8568705e311c7 --- /dev/null +++ b/contrib/check-asan.jl @@ -0,0 +1,92 @@ +#!/bin/bash +# -*- mode: julia -*- +# This file is a part of Julia. License is MIT: https://julialang.org/license +# +# Usage: +# contrib/check-asan.jl +# +# Check that is built with ASAN. +# +#= +JULIA="${JULIA:-julia}" +exec "$JULIA" --startup-file=no --compile=min "${BASH_SOURCE[0]}" "$@" +=# + +function main(args = ARGS)::Int + if length(args) != 1 + @error "Expect a single argument" args + return 2 + end + julia, = args + + # It looks like double-free is easy to robustly trigger. + code = """ + @info "Testing a pattern that would trigger ASAN" + write(ARGS[1], "started") + + ptr = ccall(:malloc, Ptr{UInt}, (Csize_t,), 256) + ccall(:free, Cvoid, (Ptr{UInt},), ptr) + ccall(:free, Cvoid, (Ptr{UInt},), ptr) + + @error "Failed to trigger ASAN" + """ + + local proc + timeout = Threads.Atomic{Bool}(false) + isstarted = false + mktemp() do tmppath, tmpio + cmd = setenv( + `$julia -e $code $tmppath`, + "ASAN_OPTIONS" => + "detect_leaks=0:fast_unwind_on_malloc=0:allow_user_segv_handler=1:malloc_context_size=2", + "LBT_USE_RTLD_DEEPBIND" => "0", + ) + # Note: Ideally, we set ASAN_SYMBOLIZER_PATH here. But there is no easy + # way to find out the path from just a Julia binary. + + @debug "Starting a process" cmd + proc = run(pipeline(cmd; stdout, stderr); wait = false) + timer = Timer(10) + @sync try + @async begin + try + wait(timer) + true + catch err + err isa EOFError || rethrow() + false + end && begin + timeout[] = true + kill(proc) + end + end + wait(proc) + finally + close(timer) + end + + # At the very beginning of the process, the `julia` subprocess put a + # marker that it is successfully started. This is to avoid mixing + # non-functional `julia` binary (or even non-`julia` command) and + # correctly working `julia` with ASAN: + isstarted = read(tmpio, String) == "started" + end + + if timeout[] + @error "Timeout waiting for the subprocess" + return 1 + elseif success(proc) + @error "ASAN was not triggered" + return 1 + elseif !isstarted + @error "Failed to start the process" + return 1 + else + @info "ASAN is functional in the Julia binary `$julia`" + return 0 + end +end + +if abspath(PROGRAM_FILE) == @__FILE__ + exit(main()) +end From 0d288640723441949662a6a77427f307cd544656 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Fri, 9 Jul 2021 21:21:13 -0400 Subject: [PATCH 02/12] Launch the `sanitizers.yml` unsigned pipeline --- .buildkite/pipeline.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 0dee5f2aaa3f7..99473055f2eeb 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -14,8 +14,11 @@ steps: - label: ":buildkite: Launch unsigned pipelines" commands: | + # We launch whitespace first, because we want that pipeline to finish as quickly as possible. + # The remaining unsigned pipelines are launched in alphabetical order. buildkite-agent pipeline upload .buildkite/whitespace.yml - buildkite-agent pipeline upload .buildkite/llvm_passes.yml buildkite-agent pipeline upload .buildkite/embedding.yml + buildkite-agent pipeline upload .buildkite/llvm_passes.yml + buildkite-agent pipeline upload .buildkite/sanitizers.yml agents: queue: julia From ff9c97890512578985142eaa54a26276525b930c Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Fri, 9 Jul 2021 21:30:40 -0400 Subject: [PATCH 03/12] Use a workspace directory in ./tmp --- .buildkite/sanitizers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/sanitizers.yml b/.buildkite/sanitizers.yml index f943316234313..d7e7632c44a75 100644 --- a/.buildkite/sanitizers.yml +++ b/.buildkite/sanitizers.yml @@ -21,8 +21,8 @@ steps: workspaces: - "/cache/repos:/cache/repos" commands: | - contrib/asan.sh /tmp/test-asan -j$${JULIA_NUM_CORES} debug - contrib/check-asan.jl /tmp/test-asan/usr/bin/julia-debug + contrib/asan.sh ./tmp/test-asan -j$${JULIA_NUM_CORES} debug + contrib/check-asan.jl ./tmp/test-asan/usr/bin/julia-debug timeout_in_minutes: 60 notify: - github_commit_status: From f462fb1dc021566a316c5ab373e78d96e1ff47da Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Fri, 9 Jul 2021 21:48:06 -0400 Subject: [PATCH 04/12] Add some log group headers to make the logs easier to navigate --- .buildkite/sanitizers.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.buildkite/sanitizers.yml b/.buildkite/sanitizers.yml index d7e7632c44a75..b35019994d3bc 100644 --- a/.buildkite/sanitizers.yml +++ b/.buildkite/sanitizers.yml @@ -21,7 +21,9 @@ steps: workspaces: - "/cache/repos:/cache/repos" commands: | + echo "--- contrib/asan.sh" contrib/asan.sh ./tmp/test-asan -j$${JULIA_NUM_CORES} debug + echo "--- contrib/check-asan.jl" contrib/check-asan.jl ./tmp/test-asan/usr/bin/julia-debug timeout_in_minutes: 60 notify: From 61c77cb2fbcc35832b50e5c4ba9e2c95c6a981d6 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sat, 10 Jul 2021 01:25:35 -0400 Subject: [PATCH 05/12] Install `julia` binary inside sandbox --- .buildkite/sanitizers.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.buildkite/sanitizers.yml b/.buildkite/sanitizers.yml index b35019994d3bc..75acbf313e32e 100644 --- a/.buildkite/sanitizers.yml +++ b/.buildkite/sanitizers.yml @@ -20,6 +20,9 @@ steps: gid: 1000 workspaces: - "/cache/repos:/cache/repos" + # `contrib/check-asan.jl` needs a `julia` binary: + - JuliaCI/julia#v1: + version: 1.6 commands: | echo "--- contrib/asan.sh" contrib/asan.sh ./tmp/test-asan -j$${JULIA_NUM_CORES} debug From dc6408e488ff6c087d4cb8308de71a2bac3bc534 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sat, 10 Jul 2021 01:26:02 -0400 Subject: [PATCH 06/12] Double timeout --- .buildkite/sanitizers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/sanitizers.yml b/.buildkite/sanitizers.yml index 75acbf313e32e..2d489b540a9a9 100644 --- a/.buildkite/sanitizers.yml +++ b/.buildkite/sanitizers.yml @@ -28,7 +28,7 @@ steps: contrib/asan.sh ./tmp/test-asan -j$${JULIA_NUM_CORES} debug echo "--- contrib/check-asan.jl" contrib/check-asan.jl ./tmp/test-asan/usr/bin/julia-debug - timeout_in_minutes: 60 + timeout_in_minutes: 120 notify: - github_commit_status: context: "asan" From 0b004ab30432ad5a6278f1a6d3a7899fc04c0252 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sat, 10 Jul 2021 01:53:17 -0400 Subject: [PATCH 07/12] More descriptive message from sanitizer CI --- .buildkite/sanitizers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/sanitizers.yml b/.buildkite/sanitizers.yml index 2d489b540a9a9..15d6bd3a5ce00 100644 --- a/.buildkite/sanitizers.yml +++ b/.buildkite/sanitizers.yml @@ -24,9 +24,9 @@ steps: - JuliaCI/julia#v1: version: 1.6 commands: | - echo "--- contrib/asan.sh" + echo "--- Build julia-debug with ASAN" contrib/asan.sh ./tmp/test-asan -j$${JULIA_NUM_CORES} debug - echo "--- contrib/check-asan.jl" + echo "--- Test that ASAN is enabled" contrib/check-asan.jl ./tmp/test-asan/usr/bin/julia-debug timeout_in_minutes: 120 notify: From cd295fef0132059f4a12157a7ab358165a62a6ed Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sat, 10 Jul 2021 02:26:21 -0400 Subject: [PATCH 08/12] Fix the path to the binary --- .buildkite/sanitizers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/sanitizers.yml b/.buildkite/sanitizers.yml index 15d6bd3a5ce00..9bc9c2d60cafc 100644 --- a/.buildkite/sanitizers.yml +++ b/.buildkite/sanitizers.yml @@ -27,7 +27,7 @@ steps: echo "--- Build julia-debug with ASAN" contrib/asan.sh ./tmp/test-asan -j$${JULIA_NUM_CORES} debug echo "--- Test that ASAN is enabled" - contrib/check-asan.jl ./tmp/test-asan/usr/bin/julia-debug + contrib/check-asan.jl ./tmp/test-asan/asan/usr/bin/julia-debug timeout_in_minutes: 120 notify: - github_commit_status: From eee4cf36a52b32521e236082c1188f969f045e89 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sat, 10 Jul 2021 03:27:53 -0400 Subject: [PATCH 09/12] Use addenv --- contrib/check-asan.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/check-asan.jl b/contrib/check-asan.jl index 8568705e311c7..1cce67a91c9a7 100755 --- a/contrib/check-asan.jl +++ b/contrib/check-asan.jl @@ -35,7 +35,7 @@ function main(args = ARGS)::Int timeout = Threads.Atomic{Bool}(false) isstarted = false mktemp() do tmppath, tmpio - cmd = setenv( + cmd = addenv( `$julia -e $code $tmppath`, "ASAN_OPTIONS" => "detect_leaks=0:fast_unwind_on_malloc=0:allow_user_segv_handler=1:malloc_context_size=2", From a64a62ecc97fcba9b0507e45ee7bbc2ac6037434 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Mon, 12 Jul 2021 15:22:31 -0400 Subject: [PATCH 10/12] Apply suggestions from code review Co-authored-by: Elliot Saba --- contrib/asan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/asan.sh b/contrib/asan.sh index 98a4e460714b0..7d4bf4a8f3bf6 100755 --- a/contrib/asan.sh +++ b/contrib/asan.sh @@ -12,7 +12,7 @@ set -ue -# `$WORKSPACE` is a directory in which we careate `toolchain` and `asan` +# `$WORKSPACE` is a directory in which we create `toolchain` and `asan` # sub-directories. WORKSPACE="$1" shift From 32d436f6e9de4b44a8d1184aa1d4de3ea2215c6f Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 12 Jul 2021 18:43:38 -0400 Subject: [PATCH 11/12] Group ASAN related files under contrib/asan/ --- .buildkite/sanitizers.yml | 4 +- contrib/asan.sh | 83 ------------------------ contrib/asan/Make.user.asan | 26 ++++++++ contrib/asan/Make.user.tools | 2 + contrib/asan/build.sh | 53 +++++++++++++++ contrib/{check-asan.jl => asan/check.jl} | 2 +- 6 files changed, 84 insertions(+), 86 deletions(-) delete mode 100755 contrib/asan.sh create mode 100644 contrib/asan/Make.user.asan create mode 100644 contrib/asan/Make.user.tools create mode 100755 contrib/asan/build.sh rename contrib/{check-asan.jl => asan/check.jl} (98%) diff --git a/.buildkite/sanitizers.yml b/.buildkite/sanitizers.yml index 9bc9c2d60cafc..f29ed4e42a4a6 100644 --- a/.buildkite/sanitizers.yml +++ b/.buildkite/sanitizers.yml @@ -25,9 +25,9 @@ steps: version: 1.6 commands: | echo "--- Build julia-debug with ASAN" - contrib/asan.sh ./tmp/test-asan -j$${JULIA_NUM_CORES} debug + contrib/asan/build.sh ./tmp/test-asan -j$${JULIA_NUM_CORES} debug echo "--- Test that ASAN is enabled" - contrib/check-asan.jl ./tmp/test-asan/asan/usr/bin/julia-debug + contrib/asan/check.jl ./tmp/test-asan/asan/usr/bin/julia-debug timeout_in_minutes: 120 notify: - github_commit_status: diff --git a/contrib/asan.sh b/contrib/asan.sh deleted file mode 100755 index 7d4bf4a8f3bf6..0000000000000 --- a/contrib/asan.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# This file is a part of Julia. License is MIT: https://julialang.org/license -# -# Usage: -# contrib/asan.sh [...] -# -# Build ASAN-enabled julia checked out in the current directory. Given a -# workspace directory , build ASAN-enabled julia in /asan. Required -# toolss are install under /toolchain. This scripts also takes optional -# arguments which are passed to `make`. The default make target -# is `debug`. - -set -ue - -# `$WORKSPACE` is a directory in which we create `toolchain` and `asan` -# sub-directories. -WORKSPACE="$1" -shift -if [ "$WORKSPACE" = "" ]; then - echo "Workspace directory must be specified as the first argument" >&2 - exit 2 -fi - -mkdir -pv "$WORKSPACE" -WORKSPACE="$(cd "$WORKSPACE" && pwd)" -if [ "$WORKSPACE" = "" ]; then - echo "Failed to create the workspace directory." >&2 - exit 2 -fi - -echo -echo "Installing toolchain..." - -TOOLCHAIN="$WORKSPACE/toolchain" -if [ ! -d "$TOOLCHAIN" ]; then - make configure O=$TOOLCHAIN - - cat < "$TOOLCHAIN/Make.user" - USE_BINARYBUILDER_LLVM=1 - BUILD_LLVM_CLANG=1 -EOD -fi - -make -C "$TOOLCHAIN/deps" install-clang install-llvm-tools - -echo -echo "Building Julia..." - -BUILD="$WORKSPACE/asan" -if [ ! -d "$BUILD" ]; then - make configure O="$BUILD" - - cat <<'EOD' | sed 's/^ *//' > "$BUILD/Make.user" - TOOLCHAIN=$(BUILDROOT)/../toolchain/usr/tools - - # use our new toolchain - USECLANG=1 - override CC=$(TOOLCHAIN)/clang - override CXX=$(TOOLCHAIN)/clang++ - export ASAN_SYMBOLIZER_PATH=$(TOOLCHAIN)/llvm-symbolizer - - USE_BINARYBUILDER_LLVM=1 - - override SANITIZE=1 - override SANITIZE_ADDRESS=1 - - # make the GC use regular malloc/frees, which are hooked by ASAN - override WITH_GC_DEBUG_ENV=1 - - # default to a debug build for better line number reporting - override JULIA_BUILD_MODE=debug - - # make ASAN consume less memory - export ASAN_OPTIONS=detect_leaks=0:fast_unwind_on_malloc=0:allow_user_segv_handler=1:malloc_context_size=2 - - JULIA_PRECOMPILE=1 - - # tell libblastrampoline to not use RTLD_DEEPBIND - export LBT_USE_RTLD_DEEPBIND=0 -EOD -fi - -make -C "$BUILD" "$@" diff --git a/contrib/asan/Make.user.asan b/contrib/asan/Make.user.asan new file mode 100644 index 0000000000000..3ea3a1f7ca061 --- /dev/null +++ b/contrib/asan/Make.user.asan @@ -0,0 +1,26 @@ +TOOLCHAIN=$(BUILDROOT)/../toolchain/usr/tools + +# use our new toolchain +USECLANG=1 +override CC=$(TOOLCHAIN)/clang +override CXX=$(TOOLCHAIN)/clang++ +export ASAN_SYMBOLIZER_PATH=$(TOOLCHAIN)/llvm-symbolizer + +USE_BINARYBUILDER_LLVM=1 + +override SANITIZE=1 +override SANITIZE_ADDRESS=1 + +# make the GC use regular malloc/frees, which are hooked by ASAN +override WITH_GC_DEBUG_ENV=1 + +# default to a debug build for better line number reporting +override JULIA_BUILD_MODE=debug + +# make ASAN consume less memory +export ASAN_OPTIONS=detect_leaks=0:fast_unwind_on_malloc=0:allow_user_segv_handler=1:malloc_context_size=2 + +JULIA_PRECOMPILE=1 + +# tell libblastrampoline to not use RTLD_DEEPBIND +export LBT_USE_RTLD_DEEPBIND=0 diff --git a/contrib/asan/Make.user.tools b/contrib/asan/Make.user.tools new file mode 100644 index 0000000000000..1bd6f97e39111 --- /dev/null +++ b/contrib/asan/Make.user.tools @@ -0,0 +1,2 @@ +USE_BINARYBUILDER_LLVM=1 +BUILD_LLVM_CLANG=1 diff --git a/contrib/asan/build.sh b/contrib/asan/build.sh new file mode 100755 index 0000000000000..d124e0a92f1e0 --- /dev/null +++ b/contrib/asan/build.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# This file is a part of Julia. License is MIT: https://julialang.org/license +# +# Usage: +# contrib/asan/build.sh [...] +# +# Build ASAN-enabled julia. Given a workspace directory , build +# ASAN-enabled julia in /asan. Required toolss are install under +# /toolchain. This scripts also takes optional arguments +# which are passed to `make`. The default make target is `debug`. + +set -ue + +# `$WORKSPACE` is a directory in which we create `toolchain` and `asan` +# sub-directories. +WORKSPACE="$1" +shift +if [ "$WORKSPACE" = "" ]; then + echo "Workspace directory must be specified as the first argument" >&2 + exit 2 +fi + +mkdir -pv "$WORKSPACE" +WORKSPACE="$(cd "$WORKSPACE" && pwd)" +if [ "$WORKSPACE" = "" ]; then + echo "Failed to create the workspace directory." >&2 + exit 2 +fi + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +JULIA_HOME="$HERE/../../" + +echo +echo "Installing toolchain..." + +TOOLCHAIN="$WORKSPACE/toolchain" +if [ ! -d "$TOOLCHAIN" ]; then + make -C "$JULIA_HOME" configure O=$TOOLCHAIN + cp "$HERE/Make.user.tools" "$TOOLCHAIN/Make.user" +fi + +make -C "$TOOLCHAIN/deps" install-clang install-llvm-tools + +echo +echo "Building Julia..." + +BUILD="$WORKSPACE/asan" +if [ ! -d "$BUILD" ]; then + make -C "$JULIA_HOME" configure O="$BUILD" + cp "$HERE/Make.user.asan" "$BUILD/Make.user" +fi + +make -C "$BUILD" "$@" diff --git a/contrib/check-asan.jl b/contrib/asan/check.jl similarity index 98% rename from contrib/check-asan.jl rename to contrib/asan/check.jl index 1cce67a91c9a7..0c1e12f7f471a 100755 --- a/contrib/check-asan.jl +++ b/contrib/asan/check.jl @@ -3,7 +3,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license # # Usage: -# contrib/check-asan.jl +# contrib/asan/check.jl # # Check that is built with ASAN. # From cde6cef3090e89110c66bc677496d04cd9fadf5e Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Tue, 13 Jul 2021 15:08:22 -0400 Subject: [PATCH 12/12] Remove redundant JULIA_PRECOMPILE=1 --- contrib/asan/Make.user.asan | 2 -- 1 file changed, 2 deletions(-) diff --git a/contrib/asan/Make.user.asan b/contrib/asan/Make.user.asan index 3ea3a1f7ca061..3bcc34df68323 100644 --- a/contrib/asan/Make.user.asan +++ b/contrib/asan/Make.user.asan @@ -20,7 +20,5 @@ override JULIA_BUILD_MODE=debug # make ASAN consume less memory export ASAN_OPTIONS=detect_leaks=0:fast_unwind_on_malloc=0:allow_user_segv_handler=1:malloc_context_size=2 -JULIA_PRECOMPILE=1 - # tell libblastrampoline to not use RTLD_DEEPBIND export LBT_USE_RTLD_DEEPBIND=0