From 99076ebfb01cbef619263656684eb025fc87de2d Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 21 Oct 2025 17:52:04 +0200 Subject: [PATCH 1/4] [skip ci] Auto-mark SKIP_PERF_SENSITIVE tests as flaky These can occasionally fail in CI. --- run-tests.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/run-tests.php b/run-tests.php index 070229ec1d6aa..07496d31a567c 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2881,6 +2881,11 @@ function is_flaky(TestFile $test): bool if ($test->hasSection('FLAKY')) { return true; } + if ($test->hasSection('SKIPIF')) { + if (strpos($test->getSection('SKIPIF'), 'SKIP_PERF_SENSITIVE') !== false) { + return true; + } + } if (!$test->hasSection('FILE')) { return false; } From 7877de29e0204203b8d83ae9256ee9fb331ca43b Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 21 Oct 2025 17:56:17 +0200 Subject: [PATCH 2/4] [skip ci] Fix nightly notification workflow url jobs_url is a link to the api, rather than the website. Also tweak wording, as we now only send one notification per workflow, rather than per failed job. --- .github/workflows/nightly-results.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-results.yml b/.github/workflows/nightly-results.yml index c1c4da72ca56a..a222582da1c6f 100644 --- a/.github/workflows/nightly-results.yml +++ b/.github/workflows/nightly-results.yml @@ -13,4 +13,4 @@ jobs: - run: | export DEBIAN_FRONTEND=noninteractive sudo apt-get install -y curl - curl -X POST -H 'Content-type: application/json' --data '{"attachments": [{"text": "Job in *nightly* failed", "footer": "<${{ github.event.workflow_run.jobs_url }}|View Run>", "color": "danger", "mrkdwn_in": ["text"]}]}' ${{ secrets.ACTION_MONITORING_SLACK }} + curl -X POST -H 'Content-type: application/json' --data '{"attachments": [{"text": "Job(s) in *nightly* failed", "footer": "<${{ github.event.workflow_run.html_url }}|View Run>", "color": "danger", "mrkdwn_in": ["text"]}]}' ${{ secrets.ACTION_MONITORING_SLACK }} From cc837614163084ce522b7c5a3cf241c388f38311 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 19 Oct 2025 22:13:12 +0200 Subject: [PATCH 3/4] phar: Fix file descriptor leak in phar_zip_flush() on failure. Closes GH-20228. --- NEWS | 1 + ext/phar/zip.c | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 020927bb5ff6e..4345f86f98ec9 100644 --- a/NEWS +++ b/NEWS @@ -56,6 +56,7 @@ PHP NEWS . Fix potential buffer length truncation due to usage of type int instead of type size_t. (Girgias) . Fix memory leak when openssl polyfill returns garbage. (nielsdos) + . Fix file descriptor leak in phar_zip_flush() on failure. (nielsdos) - Random: . Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos) diff --git a/ext/phar/zip.c b/ext/phar/zip.c index f1d0edd5bdff8..63c56108ed985 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -1246,6 +1246,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int return EOF; } if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) { + php_stream_close(entry.fp); if (error) { spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname); } From ce0df1a9d82dbb3166a889327ebb1c59a640f95f Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 19 Oct 2025 00:11:34 +0200 Subject: [PATCH 4/4] phar: Fix memory leak when opening temp file fails while trying to open gzip-compressed archive `filterparams` can leak if `php_stream_fopen_tmpfile()` fails. To solve this, move the temp file creation first. Closes GH-20220. --- NEWS | 2 ++ ext/phar/phar.c | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 4345f86f98ec9..27214db0b90e5 100644 --- a/NEWS +++ b/NEWS @@ -57,6 +57,8 @@ PHP NEWS of type size_t. (Girgias) . Fix memory leak when openssl polyfill returns garbage. (nielsdos) . Fix file descriptor leak in phar_zip_flush() on failure. (nielsdos) + . Fix memory leak when opening temp file fails while trying to open + gzip-compressed archive. (nielsdos) - Random: . Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index b7baf9e69ce4f..a9aff9489df01 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1672,6 +1672,12 @@ static int phar_open_from_fp(php_stream* fp, char *fname, size_t fname_len, char if (!PHAR_G(has_zlib)) { MAPPHAR_ALLOC_FAIL("unable to decompress gzipped phar archive \"%s\" to temporary file, enable zlib extension in php.ini") } + + /* entire file is gzip-compressed, uncompress to temporary file */ + if (!(temp = php_stream_fopen_tmpfile())) { + MAPPHAR_ALLOC_FAIL("unable to create temporary file for decompression of gzipped phar archive \"%s\"") + } + array_init(&filterparams); /* this is defined in zlib's zconf.h */ #ifndef MAX_WBITS @@ -1679,11 +1685,6 @@ static int phar_open_from_fp(php_stream* fp, char *fname, size_t fname_len, char #endif add_assoc_long_ex(&filterparams, "window", sizeof("window") - 1, MAX_WBITS + 32); - /* entire file is gzip-compressed, uncompress to temporary file */ - if (!(temp = php_stream_fopen_tmpfile())) { - MAPPHAR_ALLOC_FAIL("unable to create temporary file for decompression of gzipped phar archive \"%s\"") - } - php_stream_rewind(fp); filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp));