From 792609279d8abc934b6b2749809986fe165daeb6 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 00:48:33 +0200 Subject: [PATCH 01/26] Add ASan support for MSVC --- win32/build/confutils.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index e847417bc77b0..de00d518d5283 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1246,6 +1246,8 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) if (PHP_SANITIZER == "yes") { if (CLANG_TOOLSET) { add_asan_opts("CFLAGS_" + SAPI, "LIBS_" + SAPI, (is_lib ? "ARFLAGS_" : "LDFLAGS_") + SAPI); + } else if (VS_TOOLSET) { + ADD_FLAG("CFLAGS", "/fsanitize=address"); } } @@ -3442,8 +3444,8 @@ function toolset_setup_build_mode() ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf"); } ADD_FLAG("CFLAGS", "/LD /MD"); - if (PHP_SANITIZER == "yes" && CLANG_TOOLSET) { - ADD_FLAG("CFLAGS", "/Od /D NDebug /D NDEBUG /D ZEND_WIN32_NEVER_INLINE /D ZEND_DEBUG=0"); + if (PHP_SANITIZER == "yes") { + ADD_FLAG("CFLAGS", "/Od /D NDebug /D NDEBUG /D ZEND_WIN32_NEVER_INLINE /D ZEND_DEBUG=1"); } else { // Equivalent to Release_TSInline build -> best optimization ADD_FLAG("CFLAGS", "/Ox /D NDebug /D NDEBUG /GF /D ZEND_DEBUG=0"); From 0c90d93cc00112cae487949eba54c4c81f992206 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 00:50:22 +0200 Subject: [PATCH 02/26] Enable ASAN for CI --- .github/scripts/windows/build_task.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index 3c8dc04d59b40..9a004a7985e73 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -40,7 +40,8 @@ cmd /c configure.bat ^ --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^ --with-php-build=%DEPS_DIR% ^ %ADD_CONF% ^ - --disable-test-ini + --disable-test-ini ^ + --enable-sanitizer if %errorlevel% neq 0 exit /b 3 nmake /NOLOGO From 8526cef8ad6c59dcf9b5b13548c7ea1ea193e05c Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 01:56:55 +0200 Subject: [PATCH 03/26] Check for VSVERS >= 1929 According to Microsoft, ASan is already supported as of Visual Studio 16.9, but that support might be limited, and we can't easily check versions prior to 16.11 anyway, so we require 16.10 for now. We also move the `ARG_ENABLE` to the top-level, since `ARG_*` has special treatment by buildconf anyway, so there are no conditionally declared `ARG_*`s. --- win32/build/config.w32 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/win32/build/config.w32 b/win32/build/config.w32 index dd33e595a2ee9..78cfdf10a40d4 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -357,7 +357,13 @@ if (PHP_SECURITY_FLAGS == "yes") { ARG_WITH("uncritical-warn-choke", "Disable some uncritical warnings", "yes"); ARG_ENABLE("sanitizer", "Enable ASan and UBSan extensions", "no"); -if (CLANG_TOOLSET) { +if (VS_TOOLSET) { + if (PHP_SANITIZER == "yes") { + if (COMPILER_NUMERIC_VERSION < 1929) { + ERROR("MSVC at least 16.0 required for sanitation plugins"); + } + } +} else if (CLANG_TOOLSET) { if (PHP_UNCRITICAL_WARN_CHOKE != "no") { ADD_FLAG("CFLAGS", "-Wno-ignored-attributes -Wno-deprecated-declarations -Wno-missing-braces " + "-Wno-logical-op-parentheses -Wno-msvc-include -Wno-invalid-source-encoding -Wno-unknown-pragmas " + From d4f14420efcab959aabad928953fb21a0a3abecc Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 02:00:24 +0200 Subject: [PATCH 04/26] Run without JIT This *might* "solve" the `C00000FF` (`STATUS_BAD_FUNCTION_TABLE`) errors, we're seeing for some tests. --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 0d6117324d63d..8a8fd924d92b6 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -88,7 +88,7 @@ set OPENSSL_CONF= rem set SSLEAY_CONF= rem prepare for OPcache -if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit=tracing +if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 rem prepare for enchant mkdir %~d0\usr\local\lib\enchant-2 From 8dfff7d41fe3c4540f4857ba7970007efd6e96b4 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 02:14:21 +0200 Subject: [PATCH 05/26] Run tests with `--asan` options This is, of course, mandatory. --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 8a8fd924d92b6..234f706faf590 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -135,7 +135,7 @@ set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe mkdir c:\tests_tmp -nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" +nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --asan --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" set EXIT_CODE=%errorlevel% From cda1ac736bf3a3f1b31255b74d75ce0d99dbc89c Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 11:32:51 +0200 Subject: [PATCH 06/26] Only run Zend tests for now --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 234f706faf590..384660eae7a39 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -135,7 +135,7 @@ set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe mkdir c:\tests_tmp -nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --asan --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" +nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --asan --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL% Zend\tests" set EXIT_CODE=%errorlevel% From 04ffecb28ff14c8324e900b9243f909206d7134a Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 11:34:08 +0200 Subject: [PATCH 07/26] Enable optimizations We're in need for speed regarding CI. --- win32/build/confutils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index de00d518d5283..deaa8999ab02a 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3445,7 +3445,7 @@ function toolset_setup_build_mode() } ADD_FLAG("CFLAGS", "/LD /MD"); if (PHP_SANITIZER == "yes") { - ADD_FLAG("CFLAGS", "/Od /D NDebug /D NDEBUG /D ZEND_WIN32_NEVER_INLINE /D ZEND_DEBUG=1"); + ADD_FLAG("CFLAGS", "/Ox /D NDebug /D NDEBUG /D ZEND_DEBUG=1"); } else { // Equivalent to Release_TSInline build -> best optimization ADD_FLAG("CFLAGS", "/Ox /D NDebug /D NDEBUG /GF /D ZEND_DEBUG=0"); From f9e8b4c0b6786e278ab4d3c50fd25a1775bc2565 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 12:14:24 +0200 Subject: [PATCH 08/26] Only run Window CI for now --- .github/workflows/push.yml | 300 ------------------------------------- 1 file changed, 300 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f59fcb8d7badc..9fcf828647f1f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -40,191 +40,6 @@ env: CC: ccache gcc CXX: ccache g++ jobs: - LINUX_X64: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - services: - mysql: - image: mysql:8.3 - ports: - - 3306:3306 - env: - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: root - postgres: - image: postgres - ports: - - 5432:5432 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: test - firebird: - image: jacobalberty/firebird - ports: - - 3050:3050 - env: - ISC_PASSWORD: test - FIREBIRD_DATABASE: test.fdb - FIREBIRD_USER: test - FIREBIRD_PASSWORD: test - strategy: - fail-fast: false - matrix: - include: - - debug: false - zts: false - asan: false - - debug: true - zts: true - asan: true - name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" - runs-on: ubuntu-24.04 - timeout-minutes: 50 - steps: - - name: git checkout - uses: actions/checkout@v4 - - name: apt - uses: ./.github/actions/apt-x64 - - name: System info - run: | - echo "::group::Show host CPU info" - lscpu - echo "::endgroup::" - echo "::group::Show installed package versions" - dpkg -l - echo "::endgroup::" - - name: Create MSSQL container - if: ${{ !matrix.asan }} - uses: ./.github/actions/setup-mssql - - name: Setup Caddy server - uses: ./.github/actions/setup-caddy - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - # This duplicates the "job.name" expression above because - # GitHub has no way to query the job name (github.job is the - # job id, not the job name) - key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} - - name: ./configure - uses: ./.github/actions/configure-x64 - with: - configurationParameters: >- - --${{ matrix.debug && 'enable' || 'disable' }}-debug - --${{ matrix.zts && 'enable' || 'disable' }}-zts - ${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang CXX=clang++' || '' }} - skipSlow: ${{ matrix.asan }} - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux - - name: Setup - if: ${{ !matrix.asan }} - uses: ./.github/actions/setup-x64 - - name: Test - if: matrix.asan == false - uses: ./.github/actions/test-linux - - name: Test Tracing JIT - uses: ./.github/actions/test-linux - with: - jitType: tracing - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - ${{ matrix.asan && '--asan -x' || '' }} - - name: Verify generated files are up to date - if: ${{ !matrix.asan }} - uses: ./.github/actions/verify-generated-files - LINUX_X32: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - name: LINUX_X32_DEBUG_ZTS - runs-on: ubuntu-latest - timeout-minutes: 50 - container: - image: ubuntu:24.04 - env: - MYSQL_TEST_HOST: mysql - PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test - PDO_MYSQL_TEST_HOST: mysql - services: - mysql: - image: mysql:8.3 - ports: - - 3306:3306 - env: - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: root - steps: - - name: git checkout - uses: actions/checkout@v4 - - name: apt - uses: ./.github/actions/apt-x32 - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - - name: ./configure - uses: ./.github/actions/configure-x32 - with: - configurationParameters: >- - --enable-debug - --enable-zts - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux-x32 - - name: Test Tracing JIT - uses: ./.github/actions/test-linux - with: - jitType: tracing - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - MACOS_DEBUG_NTS: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - strategy: - fail-fast: false - matrix: - include: - - os: 13 - arch: X64 - - os: 14 - arch: ARM64 - name: MACOS_${{ matrix.arch }}_DEBUG_NTS - runs-on: macos-${{ matrix.os }} - timeout-minutes: 50 - steps: - - name: git checkout - uses: actions/checkout@v4 - - name: brew - uses: ./.github/actions/brew - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: "${{github.job}}-${{matrix.os}}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} - - name: ./configure - uses: ./.github/actions/configure-macos - with: - configurationParameters: --enable-debug --disable-zts - - name: make - run: |- - export PATH="$(brew --prefix)/opt/bison/bin:$PATH" - make -j$(sysctl -n hw.logicalcpu) >/dev/null - - name: make install - run: sudo make install - - name: Test Tracing JIT - uses: ./.github/actions/test-macos - with: - jitType: tracing - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Verify generated files are up to date - uses: ./.github/actions/verify-generated-files WINDOWS: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' name: WINDOWS_X64_ZTS @@ -252,118 +67,3 @@ jobs: run: .github/scripts/windows/build.bat - name: Test run: .github/scripts/windows/test.bat - BENCHMARKING: - name: BENCHMARKING - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - runs-on: ubuntu-24.04 - timeout-minutes: 50 - steps: - - name: git checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - # ASLR can cause a lot of noise due to missed sse opportunities for memcpy - # and other operations, so we disable it during benchmarking. - - name: Disable ASLR - run: echo 0 | sudo tee /proc/sys/kernel/randomize_va_space - - name: apt - run: | - set -x - sudo apt-get update - sudo apt-get install \ - bison \ - libgmp-dev \ - libonig-dev \ - libsqlite3-dev \ - openssl \ - re2c \ - valgrind - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} - - name: ./configure - run: | - set -x - ./buildconf --force - ./configure \ - --disable-debug \ - --enable-mbstring \ - --enable-opcache \ - --enable-option-checking=fatal \ - --enable-sockets \ - --enable-werror \ - --prefix=/usr \ - --with-config-file-scan-dir=/etc/php.d \ - --with-gmp \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-sqlite \ - --with-valgrind - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - run: | - set -x - sudo make install - sudo mkdir -p /etc/php.d - sudo chmod 777 /etc/php.d - echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini - echo zend_extension=opcache.so >> /etc/php.d/opcache.ini - echo opcache.enable=1 >> /etc/php.d/opcache.ini - echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini - - name: Setup - run: | - git config --global user.name "Benchmark" - git config --global user.email "benchmark@php.net" - sudo service mysql start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS wordpress" - mysql -uroot -proot -e "CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress'; FLUSH PRIVILEGES;" - mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'wordpress'@'localhost' WITH GRANT OPTION;" - - name: git checkout benchmarking-data - uses: actions/checkout@v4 - with: - repository: php/benchmarking-data - ssh-key: ${{ secrets.BENCHMARKING_DATA_DEPLOY_KEY }} - path: benchmark/repos/data - - name: Benchmark - run: php benchmark/benchmark.php true - - name: Store result - if: github.event_name == 'push' - run: | - set -x - cd benchmark/repos/data - git pull --autostash - if [ -e ".git/MERGE_HEAD" ]; then - echo "Merging, can't proceed" - exit 1 - fi - git add . - if git diff --cached --quiet; then - exit 0 - fi - git commit -m "Add result for ${{ github.repository }}@${{ github.sha }}" - git push - - name: Show diff - if: github.event_name == 'pull_request' - run: |- - set -x - php benchmark/generate_diff.php \ - ${{ github.sha }} \ - $(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) \ - > $GITHUB_STEP_SUMMARY - - uses: actions/upload-artifact@v4 - with: - name: profiles - path: ${{ github.workspace }}/benchmark/profiles - retention-days: 30 - FREEBSD: - name: FREEBSD - runs-on: ubuntu-latest - steps: - - name: git checkout - uses: actions/checkout@v4 - - name: FreeBSD - uses: ./.github/actions/freebsd From 692debf83c9e06add117793dcfe01bcaf790f354 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 12:14:53 +0200 Subject: [PATCH 09/26] Revert "Run without JIT" This reverts commit a261b4cf46091e4586ffdcb340cb3b17e633ca89. --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 384660eae7a39..4c619e03c39f6 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -88,7 +88,7 @@ set OPENSSL_CONF= rem set SSLEAY_CONF= rem prepare for OPcache -if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 +if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit=tracing rem prepare for enchant mkdir %~d0\usr\local\lib\enchant-2 From 7f4887593c178b9be17d215160fe5f8804bf773d Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 12:46:30 +0200 Subject: [PATCH 10/26] Run all tests, but show progress --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 4c619e03c39f6..e7be0f5a80e40 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -135,7 +135,7 @@ set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe mkdir c:\tests_tmp -nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --asan --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL% Zend\tests" +nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --asan --progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" set EXIT_CODE=%errorlevel% From 8b801e37d0327bcc39305ba6b69b43f97fa84394 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 22 Sep 2024 12:47:16 +0200 Subject: [PATCH 11/26] Reapply "Run without JIT" This reverts commit 5c420a52960dffe2f42ac36edd8bc6abefa39580. --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index e7be0f5a80e40..9637519a42d96 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -88,7 +88,7 @@ set OPENSSL_CONF= rem set SSLEAY_CONF= rem prepare for OPcache -if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit=tracing +if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 rem prepare for enchant mkdir %~d0\usr\local\lib\enchant-2 From e3a833285cf9f52d77311fa2e3372ce0dd0797ed Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 13:58:02 +0100 Subject: [PATCH 12/26] Fix NDEBUG --- win32/build/confutils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index deaa8999ab02a..6fa61a3ab7bdb 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3445,7 +3445,7 @@ function toolset_setup_build_mode() } ADD_FLAG("CFLAGS", "/LD /MD"); if (PHP_SANITIZER == "yes") { - ADD_FLAG("CFLAGS", "/Ox /D NDebug /D NDEBUG /D ZEND_DEBUG=1"); + ADD_FLAG("CFLAGS", "/Ox /U NDebug /U NDEBUG /D ZEND_DEBUG=1"); } else { // Equivalent to Release_TSInline build -> best optimization ADD_FLAG("CFLAGS", "/Ox /D NDebug /D NDEBUG /GF /D ZEND_DEBUG=0"); From fd149e9d711b857aafc107eb77a126b68caa03d1 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 13:58:59 +0100 Subject: [PATCH 13/26] Disable CirclCI for now --- .circleci/config.yml | 188 ------------------------------------------- 1 file changed, 188 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 78520332dfc7e..0000000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,188 +0,0 @@ -version: 2.1 - -jobs: - arm: - resource_class: arm.medium - docker: - - image: cimg/base:current-22.04 - - image: mysql:8.3 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: true - MYSQL_ROOT_PASSWORD: '' - MYSQL_DATABASE: test - - image: postgres:16 - environment: - POSTGRES_PASSWORD: postgres - POSTGRES_DB: test - environment: - LANGUAGE: '' - LANG: en_US.UTF-8 - MYSQL_TEST_HOST: '127.0.0.1' - MYSQL_TEST_PASSWD: '' - MYSQL_TEST_USER: root - PDO_MYSQL_TEST_DSN: 'mysql:host=127.0.0.1;dbname=test' - PDO_MYSQL_TEST_PASS: '' - PDO_MYSQL_TEST_USER: root - PDO_PGSQL_TEST_DSN: 'pgsql:host=127.0.0.1 port=5432 dbname=test user=postgres password=postgres' - steps: - - checkout - - run: - name: apt - command: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update -y - sudo apt-get install -y \ - gcc \ - g++ \ - autoconf \ - bison \ - re2c \ - locales \ - locales-all \ - ldap-utils \ - openssl \ - slapd \ - libgmp-dev \ - libicu-dev \ - libtidy-dev \ - libenchant-2-dev \ - libsasl2-dev \ - libxpm-dev \ - libzip-dev \ - libbz2-dev \ - libsqlite3-dev \ - libwebp-dev \ - libonig-dev \ - libcurl4-openssl-dev \ - libxml2-dev \ - libxslt1-dev \ - libpq-dev \ - libreadline-dev \ - libldap2-dev \ - libsodium-dev \ - libargon2-0-dev \ - libmm-dev \ - libsnmp-dev \ - snmpd \ - `#snmp-mibs-downloader` \ - freetds-dev \ - `#unixodbc-dev` \ - dovecot-core \ - dovecot-pop3d \ - dovecot-imapd \ - sendmail \ - firebird-dev \ - liblmdb-dev \ - libtokyocabinet-dev \ - libdb-dev \ - libqdbm-dev \ - libjpeg-dev \ - libpng-dev \ - libfreetype6-dev - - run: - name: ./configure - command: | - ./buildconf -f - ./configure \ - --enable-debug \ - --enable-zts \ - --enable-option-checking=fatal \ - --prefix=/usr \ - --enable-phpdbg \ - --enable-fpm \ - --enable-opcache \ - --with-pdo-mysql=mysqlnd \ - --with-mysqli=mysqlnd \ - --with-pgsql \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ - --enable-intl \ - --without-pear \ - --enable-gd \ - --with-jpeg \ - --with-webp \ - --with-freetype \ - --with-xpm \ - --enable-exif \ - --with-zip \ - --with-zlib \ - --enable-soap \ - --enable-xmlreader \ - --with-xsl \ - --with-tidy \ - --enable-sysvsem \ - --enable-sysvshm \ - --enable-shmop \ - --enable-pcntl \ - --with-readline \ - --enable-mbstring \ - --with-curl \ - --with-gettext \ - --enable-sockets \ - --with-bz2 \ - --with-openssl \ - --with-gmp \ - --enable-bcmath \ - --enable-calendar \ - --enable-ftp \ - --with-enchant=/usr \ - --enable-sysvmsg \ - --with-ffi \ - --enable-zend-test \ - --enable-dl-test=shared \ - --with-ldap \ - --with-ldap-sasl \ - --with-password-argon2 \ - --with-mhash \ - --with-sodium \ - --enable-dba \ - --with-cdb \ - --enable-flatfile \ - --enable-inifile \ - --with-tcadb \ - --with-lmdb \ - --with-qdbm \ - --with-snmp \ - `#--with-unixODBC` \ - `#--with-pdo-odbc=unixODBC,/usr` \ - --with-config-file-path=/etc \ - --with-config-file-scan-dir=/etc/php.d \ - --with-pdo-firebird \ - `#--with-pdo-dblib` \ - --disable-phpdbg \ - `#--enable-werror` - - run: - name: make - command: make -j2 > /dev/null - - run: - name: make install - command: | - sudo make install - sudo mkdir -p /etc/php.d - sudo chmod 777 /etc/php.d - echo opcache.enable_cli=1 > /etc/php.d/opcache.ini - echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini - - run: - name: Test - no_output_timeout: 30m - command: | - sapi/cli/php run-tests.php \ - -d zend_extension=opcache.so \ - -d opcache.enable_cli=1 \ - -d opcache.jit_buffer_size=64M \ - -d opcache.jit=tracing \ - -d zend_test.observer.enabled=1 \ - -d zend_test.observer.show_output=0 \ - -P -q -x -j2 \ - -g FAIL,BORK,LEAK,XLEAK \ - --no-progress \ - --offline \ - --show-diff \ - --show-slow 1000 \ - --set-timeout 120 \ - --repeat 2 - -workflows: - push-workflow: - jobs: - - arm From 8cb731111e979909bc347c3e647cae6be35c91c1 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 14:11:20 +0100 Subject: [PATCH 14/26] --enable-debug-pack --- .github/scripts/windows/build_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index 9a004a7985e73..fc449c7fe2bbe 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -35,7 +35,7 @@ set CFLAGS=/W1 /WX /w14013 cmd /c configure.bat ^ --enable-snapshot-build ^ - --disable-debug-pack ^ + --enable-debug-pack ^ --without-analyzer ^ --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^ --with-php-build=%DEPS_DIR% ^ From 572748ea51d7dfcf5f12bab01019410c46ddeb91 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 15:00:33 +0100 Subject: [PATCH 15/26] Revert "Reapply "Run without JIT"" This reverts commit 2339153350991347155921ddbe68f3e2a14b00f8. --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 9637519a42d96..e7be0f5a80e40 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -88,7 +88,7 @@ set OPENSSL_CONF= rem set SSLEAY_CONF= rem prepare for OPcache -if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 +if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit=tracing rem prepare for enchant mkdir %~d0\usr\local\lib\enchant-2 From 0b3ed4ca36f5151d007ef78017b311f5e7e46452 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 15:02:04 +0100 Subject: [PATCH 16/26] Don't show progress --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index e7be0f5a80e40..8dc02c141dbd4 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -135,7 +135,7 @@ set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe mkdir c:\tests_tmp -nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --asan --progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" +nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --asan --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" set EXIT_CODE=%errorlevel% From 944d603d15bfe087aa4955b69c99391d42692249 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 15:03:06 +0100 Subject: [PATCH 17/26] Increase timeout --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 9fcf828647f1f..0cf906db8e04f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -44,7 +44,7 @@ jobs: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' name: WINDOWS_X64_ZTS runs-on: windows-2022 - timeout-minutes: 50 + timeout-minutes: 90 env: PHP_BUILD_CACHE_BASE_DIR: C:\build-cache PHP_BUILD_OBJ_DIR: C:\obj From eea8ec1259a0ceb46aca1c57a5df0dbc818f7921 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 15:06:17 +0100 Subject: [PATCH 18/26] Stick with old flags for clang --- win32/build/confutils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 6fa61a3ab7bdb..da89f0e68b67d 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3445,7 +3445,11 @@ function toolset_setup_build_mode() } ADD_FLAG("CFLAGS", "/LD /MD"); if (PHP_SANITIZER == "yes") { - ADD_FLAG("CFLAGS", "/Ox /U NDebug /U NDEBUG /D ZEND_DEBUG=1"); + if (VS_TOOLSET) { + ADD_FLAG("CFLAGS", "/Ox /U NDebug /U NDEBUG /D ZEND_DEBUG=1"); + } else if (CLANG_TOOLSET) { + ADD_FLAG("CFLAGS", "/Od /D NDebug /D NDEBUG /D ZEND_WIN32_NEVER_INLINE /D ZEND_DEBUG=0"); + } } else { // Equivalent to Release_TSInline build -> best optimization ADD_FLAG("CFLAGS", "/Ox /D NDebug /D NDEBUG /GF /D ZEND_DEBUG=0"); From e6665edc869f5479de522e91280ac9655f407f47 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 15:08:48 +0100 Subject: [PATCH 19/26] Fix help text --- win32/build/config.w32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 78cfdf10a40d4..e3e34f5880f2e 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -356,7 +356,7 @@ if (PHP_SECURITY_FLAGS == "yes") { } ARG_WITH("uncritical-warn-choke", "Disable some uncritical warnings", "yes"); -ARG_ENABLE("sanitizer", "Enable ASan and UBSan extensions", "no"); +ARG_ENABLE("sanitizer", "Enable ASan (and UBSan) extensions", "no"); if (VS_TOOLSET) { if (PHP_SANITIZER == "yes") { if (COMPILER_NUMERIC_VERSION < 1929) { From 6c7e3df7950f3ca144a4bab7d70914063b7a4a09 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 17:23:42 +0100 Subject: [PATCH 20/26] Avoid sanitizer/debug/debug-pack conflicts --- win32/build/config.w32 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/win32/build/config.w32 b/win32/build/config.w32 index e3e34f5880f2e..b0aa35ca3295f 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -357,6 +357,12 @@ if (PHP_SECURITY_FLAGS == "yes") { ARG_WITH("uncritical-warn-choke", "Disable some uncritical warnings", "yes"); ARG_ENABLE("sanitizer", "Enable ASan (and UBSan) extensions", "no"); +if (PHP_SANITIZER == "yes" && PHP_DEBUG == "yes") { + ERROR("Use of both --enable-sanitizer and --enable-debug not allowed."); +} +if (PHP_SANITIZER == "yes" && PHP_DEBUG_PACK == "no") { + ERROR("--enable-sanitizer requires --enable-debug-pack"); +} if (VS_TOOLSET) { if (PHP_SANITIZER == "yes") { if (COMPILER_NUMERIC_VERSION < 1929) { From ec8fe7f2a381ee9a161f071829e345266dad710d Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 18:06:51 +0100 Subject: [PATCH 21/26] disable JIT again --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 8dc02c141dbd4..234f706faf590 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -88,7 +88,7 @@ set OPENSSL_CONF= rem set SSLEAY_CONF= rem prepare for OPcache -if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit=tracing +if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 rem prepare for enchant mkdir %~d0\usr\local\lib\enchant-2 From dee3e5381bc86ea486d5516b05b12b6c478cce38 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Nov 2024 18:07:21 +0100 Subject: [PATCH 22/26] Increase timeout --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 0cf906db8e04f..812e48d2299a9 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -44,7 +44,7 @@ jobs: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' name: WINDOWS_X64_ZTS runs-on: windows-2022 - timeout-minutes: 90 + timeout-minutes: 180 env: PHP_BUILD_CACHE_BASE_DIR: C:\build-cache PHP_BUILD_OBJ_DIR: C:\obj From 2b894408b5592fa3a8e5549fdf447747da14683d Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 29 Nov 2024 20:16:02 +0100 Subject: [PATCH 23/26] Unblock tests under ASan on Windows These tests execute php.exe without passing the PATH, what might be a more general issues, but at least with ASan enabled, the required DLLs could usually not be found, resulting in the tests stalling. --- ext/standard/tests/file/bug72035.phpt | 2 +- ext/standard/tests/file/proc_open01.phpt | 2 +- ext/standard/tests/general_functions/proc_open_array.phpt | 2 +- ext/standard/tests/streams/proc_open_bug60120.phpt | 2 +- ext/standard/tests/streams/proc_open_bug64438.phpt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/standard/tests/file/bug72035.phpt b/ext/standard/tests/file/bug72035.phpt index 6ed7fe470fce2..7162a804d5238 100644 --- a/ext/standard/tests/file/bug72035.phpt +++ b/ext/standard/tests/file/bug72035.phpt @@ -21,7 +21,7 @@ $cmd = "$cgi -n -C $fl"; /* Need to run CGI with the env reset. */ $desc = array(0 => array("pipe", "r")); -$proc = proc_open($cmd, $desc, $pipes, getcwd(), array()); +$proc = proc_open($cmd, $desc, $pipes, getcwd(), array('PATH' => getenv('PATH'))); if (is_resource($proc)) { echo stream_get_contents($pipes[0]); diff --git a/ext/standard/tests/file/proc_open01.phpt b/ext/standard/tests/file/proc_open01.phpt index 5ebfc72351b6d..a26e4331433ca 100644 --- a/ext/standard/tests/file/proc_open01.phpt +++ b/ext/standard/tests/file/proc_open01.phpt @@ -11,7 +11,7 @@ if ($php === false) { $proc = proc_open( "$php -n", array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')), - $pipes, getcwd(), array(), array() + $pipes, getcwd(), array('PATH' => getenv('PATH')), array() ); if ($proc === false) { print "something went wrong.\n"; diff --git a/ext/standard/tests/general_functions/proc_open_array.phpt b/ext/standard/tests/general_functions/proc_open_array.phpt index 239dc116cd601..a9f1e6f2e3825 100644 --- a/ext/standard/tests/general_functions/proc_open_array.phpt +++ b/ext/standard/tests/general_functions/proc_open_array.phpt @@ -44,7 +44,7 @@ fpassthru($pipes[1]); proc_close($proc); putenv('ENV_1=ENV_1'); -$env = ['ENV_2' => 'ENV_2']; +$env = ['ENV_2' => 'ENV_2', 'PATH' => getenv('PATH')]; $cmd = [$php, '-n', '-r', 'var_dump(getenv("ENV_1"), getenv("ENV_2"));']; echo "\nEnvironment inheritance:\n"; diff --git a/ext/standard/tests/streams/proc_open_bug60120.phpt b/ext/standard/tests/streams/proc_open_bug60120.phpt index fc98913c4cc3f..df80bfe4ebe40 100644 --- a/ext/standard/tests/streams/proc_open_bug60120.phpt +++ b/ext/standard/tests/streams/proc_open_bug60120.phpt @@ -30,7 +30,7 @@ $process = proc_open( ], $pipes, getcwd(), - [], + ['PATH' => getenv('PATH')], [ 'suppress_errors' => true, 'bypass_shell' => false diff --git a/ext/standard/tests/streams/proc_open_bug64438.phpt b/ext/standard/tests/streams/proc_open_bug64438.phpt index df06ff8163873..76cb6dbe87cba 100644 --- a/ext/standard/tests/streams/proc_open_bug64438.phpt +++ b/ext/standard/tests/streams/proc_open_bug64438.phpt @@ -14,7 +14,7 @@ $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')) $stdin = str_repeat('*', 4097); $options = array_merge(array('suppress_errors' => true, 'bypass_shell' => false)); -$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); +$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array('PATH' => getenv('PATH')), $options); foreach ($pipes as $pipe) { stream_set_blocking($pipe, false); From 771c4672cc816af96f4053eb25651dfcf938d136 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 29 Nov 2024 22:02:32 +0100 Subject: [PATCH 24/26] Skip sapi_windows_set_ctrl_handler.phpt under ASan For some reason, terminating the child process by sending CTRL+C won't work under ASan instrumentation. Since termination via CTRL+BREAK works, there is apparently nothing fundamentally wrong, so we just skip the test. --- sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt b/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt index 3d93a82733464..0faafc7908dc7 100644 --- a/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt +++ b/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt @@ -7,6 +7,7 @@ include "skipif.inc"; if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') die("skip this test is for Windows platforms only"); +if (getenv('SKIP_ASAN')) die('skip child process cannot be stopped under ASan'); ?> --FILE-- Date: Fri, 29 Nov 2024 22:23:52 +0100 Subject: [PATCH 25/26] Revert "disable JIT again" This reverts commit ec8fe7f2a381ee9a161f071829e345266dad710d. --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 234f706faf590..8dc02c141dbd4 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -88,7 +88,7 @@ set OPENSSL_CONF= rem set SSLEAY_CONF= rem prepare for OPcache -if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 +if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit=tracing rem prepare for enchant mkdir %~d0\usr\local\lib\enchant-2 From b7037742e175ea29b8a7f64daa35213904d965c8 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sat, 30 Nov 2024 10:46:35 +0100 Subject: [PATCH 26/26] xfail STATUS_BAD_FUNCTION_TABLE tests These look related to #15709, but apparently only fail with ASan instrumentation. Let's xfail these for now. --- Zend/tests/gh12073.phpt | 8 ++++++++ ext/standard/tests/gh14643_longname.phpt | 11 +++++++++++ tests/basic/timeout_variation_0.phpt | 8 ++++++++ tests/basic/timeout_variation_7.phpt | 8 ++++++++ tests/func/005a.phpt | 8 ++++++++ 5 files changed, 43 insertions(+) diff --git a/Zend/tests/gh12073.phpt b/Zend/tests/gh12073.phpt index ef115685ce7d4..efcbd9db3f1e2 100644 --- a/Zend/tests/gh12073.phpt +++ b/Zend/tests/gh12073.phpt @@ -5,6 +5,14 @@ GH-12073: Freeing of non-ZMM pointer of incompletely allocated closure if (getenv("USE_ZEND_ALLOC") === "0" && getenv("USE_TRACKED_ALLOC") !== "1") { die("skip Zend MM disabled"); } +$tracing = extension_loaded("Zend OPcache") + && ($conf = opcache_get_configuration()["directives"]) + && array_key_exists("opcache.jit", $conf) + && $conf["opcache.jit"] === "tracing"; +if (PHP_OS_FAMILY === "Windows" && PHP_INT_SIZE == 8 && $tracing && getenv('SKIP_ASAN')) { + $url = "https://github.com/php/php-src/issues/15709"; + die("xfail Test fails on Windows x64 (VS17) and tracing JIT with ASan; see $url"); +} ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE--