This commit is contained in:
Daniil Gentili 2023-10-24 10:23:08 +02:00
parent e6f1f34e1a
commit 0530dcac3b
5 changed files with 27 additions and 10 deletions

View File

@ -30,7 +30,7 @@ RUN true \
systemtap-sdt-dev libssl-dev \
libpcre2-dev libargon2-dev libedit-dev libsodium-dev llvm-16 libonig-dev
RUN git clone https://github.com/php/php-src -b master --depth 1 && cd php-src \
RUN git clone https://github.com/php/php-src -b PHP-8.3 --depth 1 && cd php-src \
\
&& ./buildconf \
&& ./configure --prefix=/usr \
@ -67,4 +67,4 @@ ENV USE_ZEND_ALLOC=0
ENV PSALM_ALLOW_XDEBUG=1
ENV ASAN_OPTIONS="detect_leaks=0:exitcode=139"
WORKDIR /app
WORKDIR /app

View File

@ -19,13 +19,21 @@ cp $wrap .
echo "About to run the standalone test"
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /app/infection.php
EXIT_CODE=0
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /app/infection.php || EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "Failed, exit code $EXIT_CODE"
exit $EXIT_CODE
fi
echo "About to run the testsuite"
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php vendor/bin/phpunit || EXIT_CODE=$?
EXIT_CODE=0
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php --repeat 2 -f /app/wrap.php vendor/bin/phpunit || EXIT_CODE=$?
if [ $EXIT_CODE -gt 128 ]; then
echo "Failed, exit code $EXIT_CODE"
exit $EXIT_CODE
fi

View File

@ -77,4 +77,6 @@ for ($x = 0; $x < 10000; $x++) {
foreach (provideRawConfig() as [$a]) {
test_it_can_create_a_config($a);
}
}
}
echo "OK, done!";

View File

@ -4,21 +4,28 @@ register_shutdown_function(function () {
$status = opcache_get_status(false);
var_dump($status);
$ok = true;
if ($status["memory_usage"]["free_memory"] < 10*1024*1024) {
echo "Not enough free opcache memory!".PHP_EOL;
$ok = false;
}
if ($status["interned_strings_usage"]["free_memory"] < 1*1024*1024) {
echo "Not enough free interned strings memory!".PHP_EOL;
$ok = false;
}
if ($status["jit"]["buffer_free"] < 10*1024*1024) {
echo "Not enough free JIT memory!".PHP_EOL;
$ok = false;
}
if (!$status["jit"]["on"]) {
echo "JIT is not enabled!".PHP_EOL;
$ok = false;
}
unset($status);
gc_collect_cycles();
if (!$ok) die(139);
});
$argc--;
@ -27,4 +34,4 @@ array_shift($argv);
$_SERVER['argc']--;
array_shift($_SERVER['argv']);
require $argv[0];
require $argv[0];

View File

@ -15,9 +15,9 @@ opcache.max_accelerated_files=1000000
opcache.interned_strings_buffer=64
opcache.jit_prof_threshold=0.000000001
opcache.jit_max_root_traces= 30000000
opcache.jit_max_side_traces= 30000000
opcache.jit_max_exit_counters=30000000
opcache.jit_max_root_traces= 10000000
opcache.jit_max_side_traces= 10000000
opcache.jit_max_exit_counters=10000000
opcache.jit_hot_loop=1
opcache.jit_hot_func=1
opcache.jit_hot_return=1
@ -26,4 +26,4 @@ opcache.jit_hot_side_exit=1
opcache.jit_blacklist_root_trace=255
opcache.jit_blacklist_side_trace=255
opcache.protect_memory=1
opcache.protect_memory=1