diff --git a/.cirrus.yml b/.cirrus.yml index c9d6342b50f8a..13b9f33ea44e3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -206,6 +206,7 @@ arm_task: -d opcache.enable_cli=1 -d opcache.jit_buffer_size=64M -d opcache.jit=function + -d opcache.file_update_protection=0 -P -q -x -j2 -g FAIL,BORK,LEAK,XLEAK --no-progress @@ -218,13 +219,16 @@ arm_task: -d zend_extension=opcache.so -d opcache.enable_cli=1 -d opcache.jit_buffer_size=64M - -d opcache.jit_max_root_traces=1000000 - -d opcache.jit_max_side_traces=1000000 - -d opcache.jit_max_exit_counters=1000000 + -d opcache.jit_max_root_traces=100000 + -d opcache.jit_max_side_traces=100000 + -d opcache.jit_max_exit_counters=100000 -d opcache.jit_hot_loop=1 -d opcache.jit_hot_func=1 -d opcache.jit_hot_return=1 -d opcache.jit_hot_side_exit=1 + -d opcache.file_update_protection=0 + -d opcache.jit_blacklist_root_trace=255 + -d opcache.jit_blacklist_side_trace=255 -d opcache.jit=tracing -P -q -x -j2 -g FAIL,BORK,LEAK,XLEAK diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml index c3c6953692e35..3e4e5864aef5c 100644 --- a/.github/actions/test-linux/action.yml +++ b/.github/actions/test-linux/action.yml @@ -44,13 +44,16 @@ runs: -d opcache.jit=${{ inputs.jitType }} \ -d opcache.protect_memory=1 \ -d opcache.jit_buffer_size=64M \ - -d opcache.jit_max_root_traces=1000000 \ - -d opcache.jit_max_side_traces=1000000 \ - -d opcache.jit_max_exit_counters=1000000 \ + -d opcache.jit_max_root_traces=100000 \ + -d opcache.jit_max_side_traces=100000 \ + -d opcache.jit_max_exit_counters=100000 \ -d opcache.jit_hot_loop=1 \ -d opcache.jit_hot_func=1 \ -d opcache.jit_hot_return=1 \ -d opcache.jit_hot_side_exit=1 \ + -d opcache.jit_blacklist_root_trace=255 \ + -d opcache.jit_blacklist_side_trace=255 \ + -d opcache.file_update_protection=0 \ -j$(/usr/bin/nproc) \ -g FAIL,BORK,LEAK,XLEAK \ --no-progress \ diff --git a/.github/actions/test-macos/action.yml b/.github/actions/test-macos/action.yml index c9d403773007c..577af5b3bd31a 100644 --- a/.github/actions/test-macos/action.yml +++ b/.github/actions/test-macos/action.yml @@ -23,13 +23,16 @@ runs: -d opcache.jit=${{ inputs.jitType }} \ -d opcache.protect_memory=1 \ -d opcache.jit_buffer_size=64M \ - -d opcache.jit_max_root_traces=1000000 \ - -d opcache.jit_max_side_traces=1000000 \ - -d opcache.jit_max_exit_counters=1000000 \ + -d opcache.jit_max_root_traces=100000 \ + -d opcache.jit_max_side_traces=100000 \ + -d opcache.jit_max_exit_counters=100000 \ -d opcache.jit_hot_loop=1 \ -d opcache.jit_hot_func=1 \ -d opcache.jit_hot_return=1 \ -d opcache.jit_hot_side_exit=1 \ + -d opcache.jit_blacklist_root_trace=255 \ + -d opcache.jit_blacklist_side_trace=255 \ + -d opcache.file_update_protection=0 \ -j$(sysctl -n hw.ncpu) \ -g FAIL,BORK,LEAK,XLEAK \ --no-progress \ diff --git a/.github/patch.php b/.github/patch.php new file mode 100644 index 0000000000000..3c76dd1a9649b --- /dev/null +++ b/.github/patch.php @@ -0,0 +1,37 @@ +> /etc/php.d/opcache.ini echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini - echo opcache.jit_max_root_traces=1000000 >> /etc/php.d/opcache.ini - echo opcache.jit_max_side_traces=1000000 >> /etc/php.d/opcache.ini - echo opcache.jit_max_exit_counters=1000000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_exit_counters=100000 >> /etc/php.d/opcache.ini echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini + echo opcache.jit_blacklist_root_trace=255 >> /etc/php.d/opcache.ini + echo opcache.jit_blacklist_side_trace=255 >> /etc/php.d/opcache.ini + echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini + echo opcache.memory_consumption=2G >> /etc/php.d/opcache.ini + echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini + echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini echo memory_limit=-1 >> /etc/php.d/opcache.ini php -v + - name: Test Psalm + if: matrix.branch.ref != 'PHP-8.0' + run: | + git clone https://github.com/vimeo/psalm --branch=master + cd psalm + git checkout 7428e49b115a2a837aa29cf0fafd0ca902fe2457 + export ASAN_OPTIONS=exitcode=139 + # Needed to avoid overwriting JIT config + export PSALM_ALLOW_XDEBUG=1 + php /usr/bin/composer install --no-progress --ignore-platform-reqs + php $GITHUB_WORKSPACE/.github/patch.php ./psalm --no-cache || exit $? + - name: Test PHPStan + if: matrix.branch.ref != 'PHP-8.0' + run: | + git clone https://github.com/phpstan/phpstan-src + cd phpstan-src + git checkout d02cc99d4480a203a2dbe54a5ded2da016266b11 + sed 's/80399/89999/g' -i conf/parametersSchema.neon + php /usr/bin/composer install --no-progress --ignore-platform-reqs + export ASAN_OPTIONS=exitcode=139 + php $GITHUB_WORKSPACE/.github/patch.php bin/phpstan clear-result-cache + php $GITHUB_WORKSPACE/.github/patch.php bin/phpstan || exit $? - name: Test AMPHP if: matrix.branch.ref != 'PHP-8.0' run: | @@ -401,7 +429,7 @@ jobs: git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs export ASAN_OPTIONS=exitcode=139 - vendor/bin/phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/patch.php vendor/bin/phpunit || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then X=1; fi @@ -418,7 +446,7 @@ jobs: # Hack to disable a test that hangs php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("*/\n public function testSharedGet()", "* @group skip\n */\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);' export ASAN_OPTIONS=exitcode=139 - php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/patch.php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then exit 1 fi @@ -434,7 +462,7 @@ jobs: git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs export ASAN_OPTIONS=exitcode=139 - vendor/bin/phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/patch.php vendor/bin/phpunit || EXIT_CODE=$? if [ $[EXIT_CODE:-0} -gt 128 ]; then X=1; fi @@ -449,7 +477,7 @@ jobs: git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs export ASAN_OPTIONS=exitcode=139 - vendor/bin/phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/patch.php vendor/bin/phpunit || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then exit 1 fi @@ -469,12 +497,22 @@ jobs: export SYMFONY_DEPRECATIONS_HELPER=max[total]=999 X=0 for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do - php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/patch.php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then X=1; fi done exit $X + - name: Test PHPSeclib + if: always() + run: | + git clone https://github.com/phpseclib/phpseclib --branch=master + cd phpseclib + git checkout 259bd9f1e8af11726ed74acf527c2c046549061b + export ASAN_OPTIONS=exitcode=139 + export PHPSECLIB_ALLOW_JIT=1 + php /usr/bin/composer install --no-progress --ignore-platform-reqs + php $GITHUB_WORKSPACE/.github/patch.php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? - name: Test PHPUnit if: always() run: | @@ -483,7 +521,7 @@ jobs: git rev-parse HEAD export ASAN_OPTIONS=exitcode=139 php /usr/bin/composer install --no-progress --ignore-platform-reqs - php ./phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/patch.php ./phpunit || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then exit 1 fi @@ -507,7 +545,7 @@ jobs: sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php sed -i 's/yourusernamehere/root/g' wp-tests-config.php sed -i 's/yourpasswordhere/root/g' wp-tests-config.php - php vendor/bin/phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/patch.php vendor/bin/phpunit || EXIT_CODE=$? if [ $EXIT_CODE -gt 128 ]; then exit 1 fi diff --git a/.travis.yml b/.travis.yml index 2d7a82f7d88af..4f95bea8bca03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,7 +85,7 @@ before_script: # Run PHPs run-tests.php script: - - travis_wait 60 ./travis/test.sh -d opcache.jit=tracing -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=1000000 -d opcache.jit_max_side_traces=1000000 -d opcache.jit_max_exit_counters=1000000 -d opcache.jit_hot_loop=1 -d opcache.jit_hot_func=1 -d opcache.jit_hot_return=1 -d opcache.jit_hot_side_exit=1 + - travis_wait 60 ./travis/test.sh -d opcache.jit=tracing -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=100000 -d opcache.jit_max_side_traces=100000 -d opcache.jit_max_exit_counters=100000 -d opcache.jit_hot_loop=1 -d opcache.jit_hot_func=1 -d opcache.jit_hot_return=1 -d opcache.jit_hot_side_exit=1 -d opcache.file_update_protection=0 -d opcache.jit_blacklist_root_trace=255 -d opcache.jit_blacklist_side_trace=255 - sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");' after_success: diff --git a/run-tests.php b/run-tests.php index e12912ca4aa71..f2d526cbdf470 100755 --- a/run-tests.php +++ b/run-tests.php @@ -306,6 +306,8 @@ function main(): void 'opcache.jit_hot_func=1', 'opcache.jit_hot_return=1', 'opcache.jit_hot_side_exit=1', + 'opcache.jit_blacklist_root_trace=255', + 'opcache.jit_blacklist_side_trace=255', 'zend.assertions=1', 'zend.exception_ignore_args=0', 'zend.exception_string_param_max_len=15',