From de42809fde565318b2c881880027924bfe342015 Mon Sep 17 00:00:00 2001 From: Juan Versolato Lopes Date: Wed, 28 Oct 2026 15:02:18 -0300 Subject: [PATCH] Fix session_write_failure_keeps_data.phpt on gcov builds The test lowers RLIMIT_FSIZE to zero and ignores SIGXFSZ so that the session write fails with EFBIG. It never lifts the limit again, and pcntl's RSHUTDOWN resets SIGXFSZ back to SIG_DFL. On a gcov build the counters are written to .gcda files at exit, which raises SIGXFSZ and kills the process after the expected output has been printed. This fails the master COVERAGE nightly every day since run-tests started waiting for the child to exit before checking how it terminated; before that the signal was missed because the process was still running. Restore the limit right after the failed write. --- ext/session/tests/session_write_failure_keeps_data.phpt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/session/tests/session_write_failure_keeps_data.phpt b/ext/session/tests/session_write_failure_keeps_data.phpt index 7ef38fccea18..09a30f5994e5 100644 --- a/ext/session/tests/session_write_failure_keeps_data.phpt +++ b/ext/session/tests/session_write_failure_keeps_data.phpt @@ -40,6 +40,10 @@ session_start(); $_SESSION['data'] = 'new'; @session_write_close(); +// pcntl puts SIGXFSZ back to SIG_DFL on request shutdown, so lift the limit +// again before anything else (e.g. gcov at exit) writes to a file. +posix_setrlimit(POSIX_RLIMIT_FSIZE, POSIX_RLIMIT_INFINITY, POSIX_RLIMIT_INFINITY); + echo "Contents unchanged after failed write: "; var_dump(file_get_contents($file) === $before);