diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 65cdf72f3caf3..4c79365a14e31 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -40,8 +40,6 @@ jobs: matrix: include: - debug: true - zts: false - - debug: false zts: true name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" runs-on: ubuntu-22.04 @@ -68,6 +66,9 @@ jobs: configurationParameters: >- --${{ matrix.debug && 'enable' || 'disable' }}-debug --${{ matrix.zts && 'enable' || 'disable' }}-zts + --enable-address-sanitizer + --enable-undefined-sanitizer + CFLAGS="-DZEND_TRACK_ARENA_ALLOC" - name: make run: make -j$(/usr/bin/nproc) >/dev/null - name: make install @@ -78,6 +79,7 @@ jobs: uses: ./.github/actions/test-linux with: testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} + runTestsParameters: --asan - name: Test Tracing JIT uses: ./.github/actions/test-linux with: @@ -86,6 +88,7 @@ jobs: -d zend_extension=opcache.so -d opcache.enable_cli=1 -d opcache.jit_buffer_size=16M + --asan - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files LINUX_X32: diff --git a/ext/enchant/tests/dict_quick_check.phpt b/ext/enchant/tests/dict_quick_check.phpt index 3cc45079f245a..b14a009af4cf4 100644 --- a/ext/enchant/tests/dict_quick_check.phpt +++ b/ext/enchant/tests/dict_quick_check.phpt @@ -6,7 +6,7 @@ marcosptf - enchant --SKIPIF-- --FILE-- --CONFLICTS-- defaultmailbox diff --git a/ext/imap/tests/imap_lsub_basic.phpt b/ext/imap/tests/imap_lsub_basic.phpt index e88aa6a8de4b8..bff521624e700 100644 --- a/ext/imap/tests/imap_lsub_basic.phpt +++ b/ext/imap/tests/imap_lsub_basic.phpt @@ -7,7 +7,7 @@ imap --SKIPIF-- --CONFLICTS-- defaultmailbox diff --git a/ext/imap/tests/imap_open_error.phpt b/ext/imap/tests/imap_open_error.phpt index 02ba0006e8c44..18f0f2ef0fa2d 100644 --- a/ext/imap/tests/imap_open_error.phpt +++ b/ext/imap/tests/imap_open_error.phpt @@ -8,7 +8,7 @@ imap --SKIPIF-- --FILE-- --INI-- oci8.privileged_connect=1 diff --git a/ext/opcache/tests/gh9259_003.phpt b/ext/opcache/tests/gh9259_003.phpt index 1666f93257ecf..04dc46b1906bb 100644 --- a/ext/opcache/tests/gh9259_003.phpt +++ b/ext/opcache/tests/gh9259_003.phpt @@ -4,7 +4,7 @@ Bug GH-9259 003 (Setting opcache.interned_strings_buffer to a very high value le opcache --SKIPIF-- --INI-- opcache.interned_strings_buffer=500 diff --git a/ext/opcache/tests/log_verbosity_bug.phpt b/ext/opcache/tests/log_verbosity_bug.phpt index 6b7e04e2b8c87..8467e4b3b8e67 100644 --- a/ext/opcache/tests/log_verbosity_bug.phpt +++ b/ext/opcache/tests/log_verbosity_bug.phpt @@ -14,7 +14,7 @@ opcache.log_verbosity_level=-1 opcache --SKIPIF-- --FILE-- --FILE-- --FILE-- OK diff --git a/ext/pdo_oci/tests/pecl_bug_6364.phpt b/ext/pdo_oci/tests/pecl_bug_6364.phpt index 9a97496fd0fb2..afd3685a5b613 100644 --- a/ext/pdo_oci/tests/pecl_bug_6364.phpt +++ b/ext/pdo_oci/tests/pecl_bug_6364.phpt @@ -5,7 +5,7 @@ pdo pdo_oci --SKIPIF-- diff --git a/ext/posix/tests/posix_getgrgid_error.phpt b/ext/posix/tests/posix_getgrgid_error.phpt index 952a3894ef8c3..f0d49a7860f8a 100644 --- a/ext/posix/tests/posix_getgrgid_error.phpt +++ b/ext/posix/tests/posix_getgrgid_error.phpt @@ -4,7 +4,7 @@ Test posix_getgrgid() function : error conditions posix --SKIPIF-- --FILE-- --FILE-- --FILE-- + --FILE-- --FILE-- setSection('XFAIL', ltrim(substr($output, 5))); + } elseif (!strncasecmp('xleak', $output, 5)) { + // Pretend we have an XLEAK section + $test->setSection('XLEAK', ltrim(substr($output, 5))); } elseif ($output !== '') { show_result("BORK", $output, $tested_file, 'reason: invalid output from SKIPIF', $temp_filenames); $PHP_FAILED_TESTS['BORKED'][] = [ @@ -2461,6 +2464,10 @@ function run_test(string $php, $file, array $env): string $cmd = $valgrind->wrapCommand($cmd, $memcheck_filename, strpos($test_file, "pcre") !== false); } + if ($test->hasSection('XLEAK') && isset($env['SKIP_ASAN'])) { + $env['LSAN_OPTIONS'] = 'detect_leaks=0'; + } + if ($DETAILED) { echo " CONTENT_LENGTH = " . $env['CONTENT_LENGTH'] . " @@ -2657,7 +2664,8 @@ function run_test(string $php, $file, array $env): string if ($test->hasSection('XFAIL')) { $warn = true; $info = " (warn: XFAIL section but test passes)"; - } elseif ($test->hasSection('XLEAK')) { + } elseif ($test->hasSection('XLEAK') && !isset($env['SKIP_ASAN'])) { + // XLEAK with ASAN completely disables LSAN so the test is expected to pass $warn = true; $info = " (warn: XLEAK section but test passes)"; } else { @@ -2694,7 +2702,8 @@ function run_test(string $php, $file, array $env): string if ($test->hasSection('XFAIL')) { $restype[] = 'XFAIL'; $info = ' XFAIL REASON: ' . rtrim($test->getSection('XFAIL')); - } elseif ($test->hasSection('XLEAK')) { + } elseif ($test->hasSection('XLEAK') && !isset($env['SKIP_ASAN'])) { + // XLEAK with ASAN completely disables LSAN so the test is expected to pass $restype[] = 'XLEAK'; $info = ' XLEAK REASON: ' . rtrim($test->getSection('XLEAK')); } else {