From 7bc61b2232bb44a4345acb5b265cb879751159ef Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 19 Nov 2024 13:29:53 +0100 Subject: [PATCH] Add pipeline reproducer --- Dockerfile | 2 +- bugs/14_pipeline.sh | 23 +++++++++++++++++++++++ bugs/wrap.php | 1 + composer.lock | 22 +++++++++++----------- php.ini | 8 ++++---- 5 files changed, 40 insertions(+), 16 deletions(-) create mode 100755 bugs/14_pipeline.sh diff --git a/Dockerfile b/Dockerfile index 4b08e65..2a0f4c7 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive diff --git a/bugs/14_pipeline.sh b/bugs/14_pipeline.sh new file mode 100755 index 0000000..28851aa --- /dev/null +++ b/bugs/14_pipeline.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e + +composer update + +standalone=$PWD/bugs/wrap.php +refactor=$PWD/refactor.php + +cd /tmp + +rm -rf pipeline + +git clone https://github.com/amphp/pipeline +cd pipeline + +cp $standalone . + +composer i --ignore-platform-reqs + +sleep 3 + +docker run -v $PWD:/app --rm --privileged -it asan_tests bash -c 'export USE_ZEND_ALLOC=0; /usr/bin/php -d opcache.jit=tracing --repeat 2 -f /app/wrap.php /app/vendor/bin/phpunit' + +echo "OK, no bugs!" diff --git a/bugs/wrap.php b/bugs/wrap.php index a7b4c49..ff6c570 100644 --- a/bugs/wrap.php +++ b/bugs/wrap.php @@ -19,6 +19,7 @@ register_shutdown_function(function () use ($pid) { } if (!$status["jit"]["on"]) { echo "JIT is not enabled!".PHP_EOL; + var_dump($status); $ok = false; } diff --git a/composer.lock b/composer.lock index fa38174..d2849bc 100755 --- a/composer.lock +++ b/composer.lock @@ -8,25 +8,25 @@ "packages": [ { "name": "nikic/php-parser", - "version": "v4.18.0", + "version": "v4.19.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.1" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -58,18 +58,18 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" }, - "time": "2023-12-10T21:03:43+00:00" + "time": "2024-09-29T15:01:53+00:00" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/php.ini b/php.ini index e81b53d..e05edc1 100755 --- a/php.ini +++ b/php.ini @@ -9,15 +9,15 @@ opcache.enable=1 opcache.enable_cli=1 opcache.jit=tracing opcache.validate_timestamps=0 -opcache.jit_buffer_size=1G +opcache.jit_buffer_size=128M opcache.file_update_protection=0 opcache.max_accelerated_files=1000000 opcache.interned_strings_buffer=64 opcache.jit_prof_threshold=0.000000001 -opcache.jit_max_root_traces= 10000000 -opcache.jit_max_side_traces= 10000000 -opcache.jit_max_exit_counters=10000000 +opcache.jit_max_root_traces= 100000 +opcache.jit_max_side_traces= 100000 +opcache.jit_max_exit_counters=100000 opcache.jit_hot_loop=1 opcache.jit_hot_func=1 opcache.jit_hot_return=1