Skip to content

Fix GH-14798: Valgrind and address sanitizer are not compatible #14826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1555,12 +1555,18 @@ if test "$PHP_MEMORY_SANITIZER" = "yes"; then
], [AC_MSG_ERROR([MemorySanitizer is not available])])
fi

if test "$PHP_ADDRESS_SANITIZER" = "yes"; then
AS_VAR_IF([PHP_ADDRESS_SANITIZER], [yes],
[AS_VAR_IF([PHP_VALGRIND], [no],, [AC_MSG_ERROR([m4_normalize([
Valgrind and address sanitizer are not compatible. Either disable Valgrind
(remove --with-valgrind) or disable address sanitizer (remove
--enable-address-sanitizer).
])])])

AX_CHECK_COMPILE_FLAG([-fsanitize=address], [
CFLAGS="$CFLAGS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC"
CXXFLAGS="$CXXFLAGS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC"
], [AC_MSG_ERROR([AddressSanitizer is not available])])
fi
])

if test "$PHP_UNDEFINED_SANITIZER" = "yes"; then
AX_CHECK_COMPILE_FLAG([-fsanitize=undefined], [
Expand Down
Loading