Skip to content

Commit 0b395b3

Browse files
committed
Disable ASAN by default
1 parent 7aaf9dc commit 0b395b3

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/compilation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ jobs:
6161
export PS2DEV=$PWD/ps2dev
6262
export PATH="$PS2DEV/bin:$PATH"
6363
if [ "${{ matrix.sanitizer }}" = "asan" ]; then
64-
# ASAN is enabled by default in CMakeLists.txt, just add UBSan
64+
# Enable ASAN and also add UBSan
6565
export SAN="-fsanitize=undefined"
66-
export EXTRA_CMAKE_FLAGS="-DCMAKE_C_FLAGS='$SAN' -DCMAKE_EXE_LINKER_FLAGS='$SAN'"
66+
export EXTRA_CMAKE_FLAGS="-DENABLE_ASAN=ON -DCMAKE_C_FLAGS='$SAN' -DCMAKE_EXE_LINKER_FLAGS='$SAN'"
6767
else
68-
# Explicitly disable ASAN for non-sanitizer builds to test without it
68+
# Build without sanitizers
6969
export EXTRA_CMAKE_FLAGS="-DENABLE_ASAN=OFF"
7070
fi
7171
cmake -B build-cmake -DCMAKE_BUILD_TYPE=${{ matrix.debug }} -DCMAKE_INSTALL_PREFIX=$PS2DEV ${EXTRA_CMAKE_FLAGS}

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ project(masp C)
55
set(CMAKE_C_STANDARD 99)
66
set(CMAKE_C_STANDARD_REQUIRED ON)
77

8-
# Enable AddressSanitizer by default to fix intermittent crashes
9-
# ASAN prevents memory corruption issues that cause SIGABRT crashes
10-
# Can be disabled with -DENABLE_ASAN=OFF if needed
11-
option(ENABLE_ASAN "Enable AddressSanitizer for memory safety" ON)
8+
# AddressSanitizer support (disabled by default)
9+
# Enable with -DENABLE_ASAN=ON when needed
10+
option(ENABLE_ASAN "Enable AddressSanitizer for memory safety" OFF)
1211
if(ENABLE_ASAN)
1312
add_compile_options(-fsanitize=address)
1413
add_link_options(-fsanitize=address)

0 commit comments

Comments
 (0)