diff --git a/Dockerfile b/Dockerfile index 2e7c701..de181ea 100755 --- a/Dockerfile +++ b/Dockerfile @@ -33,8 +33,7 @@ RUN true \ libpcre2-dev libargon2-dev libedit-dev libsodium-dev llvm-16 libonig-dev \ gdb libcapstone-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 \ --includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc \ @@ -57,7 +56,7 @@ RUN git clone https://github.com/php/php-src -b master --depth 1 && cd php-src \ && export LDFLAGS='-g -fsanitize=address -shared-libasan -Wl,-rpath=/usr/lib/llvm-16/lib/clang/16/lib/linux/' \ \ && make -j100 \ - && make install && echo owo + && make install RUN php -r "readfile('https://getcomposer.org/installer');" | php \ && mv composer.phar /usr/bin/composer diff --git a/README.md b/README.md index d5b293b..0ea6b7d 100755 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ Tested on fa218eab4a9b5304afb871a4405546068cb65008 1. Composer: Fixed 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 (patched): always fails +3. MadelineProto: Fixed +4. Infection (patched): Fixed 5. Psalm (unit): ? -6. php-parser (unit): always fails +6. php-parser (unit): Fixed 7. Psalm (master, unit): always fails 8. Psalm (patched master, unit): always fails 9. Composer: always fails diff --git a/bugs/2_psalm_new.sh b/bugs/2_psalm_new.sh index 6292b98..5753bca 100755 --- a/bugs/2_psalm_new.sh +++ b/bugs/2_psalm_new.sh @@ -20,9 +20,13 @@ cp $standalone . composer i --ignore-platform-reqs +sed 's:findUnusedCode=:cacheDirectory="/tmp/psalm" findUnusedCode=:g' -i psalm.xml.dist + echo "About to run psalm" -docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/wrap.php /app/psalm --no-cache +sleep 3 + +docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php --repeat 2 -f /app/wrap.php /app/psalm --no-cache echo "About to run composer" @@ -30,4 +34,4 @@ 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!" \ No newline at end of file +echo "OK, no bugs!" diff --git a/bugs/7_psalm_master.sh b/bugs/7_psalm_master.sh index 2dde4b6..1957d65 100755 --- a/bugs/7_psalm_master.sh +++ b/bugs/7_psalm_master.sh @@ -14,6 +14,9 @@ git branch -D master || true git branch master git checkout master +sed 's:findUnusedCode=:cacheDirectory="/tmp/psalm" findUnusedCode=:g' -i psalm.xml.dist +sed 's/error_log[(]/exit(/g' -i src/Psalm/Internal/Fork/Pool.php + export PSALM_ALLOW_XDEBUG=1 cp $standalone . @@ -22,6 +25,8 @@ composer i --ignore-platform-reqs echo "About to run psalm" -docker run -v $PWD:/app --rm --privileged -it asan_tests bash -c 'export USE_ZEND_ALLOC=1; /usr/bin/php --repeat 2 -f /app/wrap.php /app/psalm --no-cache --threads=100' +sleep 3 + +docker run -v $PWD:/app --rm --privileged -it asan_tests bash -c 'export USE_ZEND_ALLOC=1; /usr/bin/php --repeat 2 -f /app/wrap.php /app/psalm --no-cache' echo "OK, no bugs!" diff --git a/bugs/8_psalm_master_refactor.sh b/bugs/8_psalm_master_refactor.sh index e8438d1..5265cb6 100755 --- a/bugs/8_psalm_master_refactor.sh +++ b/bugs/8_psalm_master_refactor.sh @@ -27,6 +27,11 @@ echo "About to run psalm" php $refactor -docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php --repeat 2 -f /app/wrap.php /app/psalm --no-cache +sed 's:findUnusedCode=:cacheDirectory="/tmp/psalm" findUnusedCode=:g' -i psalm.xml.dist +sed 's/error_log[(]/exit(/g' -i src/Psalm/Internal/Fork/Pool.php + +sleep 3 + +docker run -v $PWD:/app --rm --privileged -it asan_tests bash -c 'export USE_ZEND_ALLOC=1; /usr/bin/php --repeat 2 -f /app/wrap.php /app/psalm --no-cache' echo "OK, no bugs!" diff --git a/bugs/9_composer.sh b/bugs/9_composer.sh index ed7fa09..a8699b7 100755 --- a/bugs/9_composer.sh +++ b/bugs/9_composer.sh @@ -18,6 +18,6 @@ cp $c composer.json echo "About to run composer" -docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php --repeat 2 -f /app/wrap.php /usr/bin/composer update +docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php --repeat 2 -f /app/wrap.php /usr/bin/composer update --ignore-platform-reqs -echo "OK, no bugs!" \ No newline at end of file +echo "OK, no bugs!" diff --git a/bugs/wrap.php b/bugs/wrap.php index 120b39d..a7b4c49 100644 --- a/bugs/wrap.php +++ b/bugs/wrap.php @@ -1,8 +1,8 @@