Repository navigation
Conversation
| var_dump(session_write_close()); | ||
|
|
||
| $fp = fopen($file, 'r'); | ||
| $fp = fopen($file, 'r+'); |
There was a problem hiding this comment.
but then this test will always "succeed" on solaris, flock is emulated on solaris and is in the same process as session_write_close. Probably best to skip solaris instead.
There was a problem hiding this comment.
But it's not the point of the test. It's testing ext/session, not the fopen or flock. Those handlers here are for manipulating session file.
There was a problem hiding this comment.
can you make rerun the CI for solaris ? it was skipped
9882ddb to
298d857
Compare
|
The fixed test doesn't fail anymore. There are still two failures related to |
likely because. |
|
That's true, I did not cover them. I checked only |
Exclusive flock() requires a writable descriptor on Solaris.
298d857 to
b0ee52a
Compare
|
This is covered by 96cbae8, which skips the test on Solaris on PHP-8.6 and master as devnexen suggested: the fcntl() emulation can't see a lock held by the same process, with 'r' or 'r+'. I think this can be closed. |
|
That's not true. The test passes on Solaris with my fix. The test shouldn't be skipped. |
|
It passes, but it would also pass if the save handler never released the lock: on Solaris both locks are fcntl() locks owned by the same process, so the probe can't conflict with it. Only a probe from another process can see the lock, which is why it's skipped there. |
The test checks the session lock with
flock($fp, LOCK_EX | LOCK_NB)on a file opened withfopen($file, 'r'). On platforms withoutflock(), such as Solaris, PHP falls back tofcntl()locks.fcntl()refuses an exclusive lock on a read-only file, so the check returns false even though the lock was released. Itsflock()goes through thefcntl()wrapper inext/standard/flock_compat.c, which is why the test fails.Should fix Solaris issue in nigthly: https://github.com/php/php-src/actions/runs/38990675359/job/117272412935