Repository navigation
Conversation
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.
Contributor
|
Thank you for report, but it's duplicate #24401 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The master COVERAGE nightly has failed every day since Oct 22 on ext/session/tests/session_write_failure_keeps_data.phpt. The expected output matches, but the test ends with Termsig=25 (SIGXFSZ).
The test sets RLIMIT_FSIZE to 0 and ignores SIGXFSZ so the session write fails with EFBIG. The limit is never lifted, and pcntl's RSHUTDOWN puts SIGXFSZ back to SIG_DFL. On a gcov build the process then writes its .gcda files at exit, gets SIGXFSZ and dies.
It has been broken since the test was added. It only started showing up after the Oct 21 security merge changed run-tests to wait for the child to exit before checking how it ended. Before that, proc_get_status() ran while gcov was still dumping, so the signal was never seen.
The fix restores the soft limit right after the failed write. The test already raises the hard limit to RLIMIT_INFINITY, so this works without privileges.
I targeted PHP-8.4 because the test is identical there and on every branch up to master.
Tested on PHP-8.4 debug+gcov: ext/session/tests went from 1 failure to 0, with and without opcache. On a master gcov build the test fails 10 out of 10 runs without the change and passes 10 out of 10 with it. The ASan suite passes both ways. I also checked that the test still catches the truncation bug it was written for, by reverting the mod_files.c part of c2b02f2.