This commit is contained in:
Daniil Gentili 2023-10-23 23:42:45 +02:00
parent 14561fd8e1
commit 156c4eb2e9
8 changed files with 87 additions and 4 deletions

View File

@ -3,3 +3,13 @@
Run using `./run.sh`. Run using `./run.sh`.
Edit the branch in `Dockerfile:33` Edit the branch in `Dockerfile:33`
## Tests
Tested on fa218eab4a9b5304afb871a4405546068cb65008
1. Composer: always fails
2. Psalm: always fails
3. MadelineProto: got a single shutdown hang the first time I tried (even with the new closure fixes), then nothing; expecting an assertion crash
4. Infection: used to fail on some older php-src commit, now doesn't, still including it in order to play around with branches
5. Psalm (unit): used to fail on some older php-src commit, now doesn't, still including it in order to play around with branches

25
bugs/1_composer.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash -e
standalone=$PWD/bugs/wrap.php
cd /tmp
rm -rf psalm
git clone https://github.com/vimeo/psalm
cd psalm
git checkout 7428e49b115a2a837aa29cf0fafd0ca902fe2457
git branch -D master || true
git branch master
git checkout master
cp $standalone .
echo "About to run composer"
rm -rf vendor
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /usr/bin/composer update --ignore-platform-reqs
echo "OK, no bugs!"

View File

@ -28,6 +28,6 @@ echo "About to run composer"
rm -rf vendor rm -rf vendor
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /usr/bin/composer update docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /usr/bin/composer update --ignore-platform-reqs
echo "OK, no bugs!" echo "OK, no bugs!"

16
bugs/3_madeline.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash -e
standalone=$PWD/bugs/wrap_madeline.php
cd /tmp
rm -rf jit_test
wget https://paste.daniil.it/jit_1.tar.xz -c
tar -xvf jit_1.tar.xz
cd jit_test
cp $standalone wrap.php
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php -d opcache.blacklist_filename=b.txt -f /app/wrap.php test.php

View File

@ -3,7 +3,7 @@
#!/bin/bash -e #!/bin/bash -e
wrap=$PWD/bugs/wrap.php wrap=$PWD/bugs/wrap.php
standalone=$PWD/bugs/1_infection.php standalone=$PWD/bugs/infection.php
cd /tmp cd /tmp
@ -19,7 +19,7 @@ cp $wrap .
echo "About to run the standalone test" echo "About to run the standalone test"
docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /app/1_infection.php docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /app/infection.php
echo "About to run the testsuite" echo "About to run the testsuite"

32
bugs/wrap_madeline.php Normal file
View File

@ -0,0 +1,32 @@
<?php
var_dump(`rm -rf /tmp/aaa.madeline`);
register_shutdown_function(function () {
$status = opcache_get_status(false);
var_dump($status);
if ($status["memory_usage"]["free_memory"] < 10*1024*1024) {
echo "Not enough free opcache memory!".PHP_EOL;
}
if ($status["interned_strings_usage"]["free_memory"] < 1*1024*1024) {
echo "Not enough free interned strings memory!".PHP_EOL;
}
if ($status["jit"]["buffer_free"] < 10*1024*1024) {
echo "Not enough free JIT memory!".PHP_EOL;
}
if (!$status["jit"]["on"]) {
echo "JIT is not enabled!".PHP_EOL;
}
unset($status);
gc_collect_cycles();
});
$argc--;
array_shift($argv);
$_SERVER['argc']--;
array_shift($_SERVER['argv']);
require $argv[0];