1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Commit Graph

139721 Commits

Author SHA1 Message Date
Christoph M. Becker
91b7f12cf1 Drop newly added flaky test for now
The test expectations are overly specific, and may not be met.  For
now, we're dropping the test case.
2024-12-17 11:29:41 +01:00
Ilija Tovilo
becf207d0c [skip ci] Ignore snmp test on asan that frequently times out
Not sure why this happens only on master.
2024-12-17 10:49:10 +01:00
David Carlier
4750ce1e6d Merge branch 'PHP-8.4' 2024-12-16 23:00:23 +00:00
David Carlier
eb0e991c5d Merge branch 'PHP-8.3' into PHP-8.4 2024-12-16 22:56:18 +00:00
David Carlier
8a649a8343 ext/sockets: socket_set_option switch from convert_to_long to zval_get_long.
to be explicit when the expected type is not met. Check SO_LINGER values
for possible overflow.

close GH-17135
2024-12-16 22:55:23 +00:00
Gina Peter Banyard
c8bbb2b551 [skip ci] Add upgrading entry for GH-17177 2024-12-16 22:52:14 +00:00
Gina Peter Banyard
d21777d4a2 sapi/cli: Refactor process title setting code (#17177) 2024-12-16 22:50:06 +00:00
Christoph M. Becker
6972612e1e Improve fix for GH-16889
The original patch[1] cared only about pipe handles in the rset, but
would be problematic if there are other handles (e.g. files in the
rset, or pipes/files in the other sets), because `php_select()` would
return immediately, reporting all non read-pipe handles as ready, but
possibly never reporting read-pipe handles.

We fix this by applying different logic for the case where only pipe
handles are supplied in the rset, but no handles in the wset or eset.
In this case `php_select()` only returns when actually one of the
handles is ready, or when the timeout expires.  To avoid busy looping
in this case, we sleep for a short amount of time.  This matches POSIX
behavior.

In all other cases, `php_select()` behaves as before (i.e. prior to the
original fix), that is it returns immediately, reporting all handles as
ready.

We also add a test case that demonstrates multiplexing the output of a
couple of child processes.

See also the discussion on <https://github.com/php/php-src/pull/16917>.

[1] <b614b4a69a>

Closes GH-17174.
2024-12-16 23:25:38 +01:00
Niels Dossche
fadceca448 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17140 (Assertion failure in JIT trace exit with ZEND_FETCH_DIM_FUNC_ARG)
  Fix GH-16255: Unexpected nan value in ext/gd/libgd/gd_filter.c
2024-12-16 19:46:21 +01:00
Niels Dossche
2104097a79 Fix GH-17140 (Assertion failure in JIT trace exit with ZEND_FETCH_DIM_FUNC_ARG)
ZEND_FETCH_DIM_FUNC_ARG should also be repeated on undefined access,
consistent to how ZEND_FETCH_DIM_R is handled. The opcode was just
missing from the assertion list.

Closes GH-17148.

Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2024-12-16 19:46:11 +01:00
Niels Dossche
7b2b2ecab9 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16255: Unexpected nan value in ext/gd/libgd/gd_filter.c
2024-12-16 19:44:50 +01:00
Niels Dossche
6c198e380e Fix GH-16255: Unexpected nan value in ext/gd/libgd/gd_filter.c
Closes GH-17169.
2024-12-16 19:43:44 +01:00
Saki Takamachi
0507b83360 Merge branch 'PHP-8.4'
* PHP-8.4:
  Correctly round rounding mode with zero edge case (#17065)
2024-12-17 00:17:38 +09:00
Saki Takamachi
52ebdfbe00 Correctly round rounding mode with zero edge case (#17065)
Fixes #17064
Closes #17065
2024-12-17 00:17:23 +09:00
Christoph M. Becker
aff044857f Drop superfluous readline test skip conditions
The `--EXTENSIONS--` section already ensures that ext/readline is
available, so there's no need to additionally check for unconditionally
available readline functions.

Closes GH-17170.
2024-12-16 14:31:28 +01:00
Christoph M. Becker
75410eb457 Merge readline tests for POSIX and Windows (GH-17171)
These test cases differ only in some details, so it doesn't make much
sense to have separate test cases, given that POSIX/Windows test pairs
are not unlikely to diverge over time (as can be seen here, where the
POSIX tests are skipped for repeat runs, but the Windows tests are
not).
2024-12-16 13:46:44 +01:00
Christoph M. Becker
7e1a241b09 Reduce excessive stack reserve for testing in CI (GH-17166)
For some reason the stack reserve of php.exe and php-cgi.exe is very
large on Windows (64MB)[1].  While this might not be bad for production
purposes, it causes stack_limit_014.phpt to be unbearably slow; the
test may easily run for a minute, and due to a recent `stream_select()`
improvement[2], that can cause a timeout, what triggers the test to be
run again.  So this single test case may run for two minutes, and still
might fail (happened a couple of times).

Instead of skipping the test in CI, we reduce the stack reserve to 8MB,
what improves the performance of this test case (and maybe others), and
should still be good enough for CI.

[1] <54906c760f>
[2] <b614b4a69a>
2024-12-16 12:37:06 +01:00
Gina Peter Banyard
e02c226725 Merge branch 'PHP-8.4'
* PHP-8.4:
  ext/pcntl: Fix memory leak in cleanup code of pcntl_exec()
2024-12-15 22:14:25 +00:00
Gina Peter Banyard
47b262086a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ext/pcntl: Fix memory leak in cleanup code of pcntl_exec()
2024-12-15 22:13:54 +00:00
Gina Peter Banyard
2df9f32732 ext/pcntl: Fix memory leak in cleanup code of pcntl_exec() 2024-12-15 22:13:27 +00:00
Niels Dossche
1371f50daa Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17162: zend_array_try_init() with dtor can cause engine UAF
2024-12-15 20:12:17 +01:00
Niels Dossche
08b14a57b8 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17162: zend_array_try_init() with dtor can cause engine UAF
2024-12-15 20:12:12 +01:00
Niels Dossche
ee0daa59db Fix GH-17162: zend_array_try_init() with dtor can cause engine UAF
Closes GH-17167.
2024-12-15 20:11:40 +01:00
David Carlier
fa8c6a552d Merge branch 'PHP-8.4' 2024-12-15 16:05:20 +00:00
David Carlier
171cc5c6e0 fix pgsql config inclusion 2024-12-15 16:05:10 +00:00
David Carlier
36d5a0fdcd Merge branch 'PHP-8.4' 2024-12-15 15:22:47 +00:00
David Carlier
1bb4bd657f fix new pgsql test 2024-12-15 15:22:35 +00:00
David Carlier
9ba2667cf5 Merge branch 'PHP-8.4' 2024-12-15 14:56:29 +00:00
David Carlier
2309cac755 Merge branch 'PHP-8.3' into PHP-8.4 2024-12-15 14:55:36 +00:00
David Carlier
0a3442fbe6 ext/pgsql fixing further calls with flexible arguments number.
continuation of GH-17161

close GH-17165
2024-12-15 14:50:59 +00:00
Niels Dossche
fe87ba41b8 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17137: Segmentation fault ext/phar/phar.c
2024-12-15 13:55:50 +01:00
Niels Dossche
57eb399700 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17137: Segmentation fault ext/phar/phar.c
2024-12-15 13:55:44 +01:00
Niels Dossche
142f85e2e1 Fix GH-17137: Segmentation fault ext/phar/phar.c
Commit edae2431 attempted to fix a leak and double free, but didn't
properly understand what was going on, causing a reference count mistake
and subsequent segfault in this case.

The first mistake of that commit is that the reference count should've
been increased because we're reusing a phar object. The error handling
path should've gotten changed instead to undo this refcount increase
instead of not refcounting at all (root cause of this bug).

The second mistake is that the alias isn't supposed to be transferred or
whatever, that just doesn't make sense. The reason the test
bug69958.phpt originally leaked is because in the non-reuse case we
borrowed the alias and otherwise we own the alias. If we own the alias
the alias information shouldn't get deleted anyway as that would desync
the alias map.

Fixing these will reveal a third issue in which the alias memory is not
always properly in sync with the persistence-ness of the phar, fix this
as well.

Closes GH-17150.
2024-12-15 13:50:09 +01:00
Christoph M. Becker
1fd4771e59 Merge branch 'PHP-8.4'
* PHP-8.4:
  Don't run proc_open_cmd.phpt in parallel with other tests
2024-12-15 12:11:24 +01:00
Christoph M. Becker
fd25b79412 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Don't run proc_open_cmd.phpt in parallel with other tests
2024-12-15 12:10:47 +01:00
Christoph M. Becker
aafa6ea386 Don't run proc_open_cmd.phpt in parallel with other tests
This test puts a fake cmd.exe in the CWD and removes it only after the
test has finished.  We need to avoid that other tests are running while
that fake cmd.exe is there, because they may use it instead of the
proper cmd.exe.

We also unlink the fake cmd.exe as soon as possible, regardless of the
test result.

Fixes GH-17098.
Closes GH-17090.
2024-12-15 12:09:42 +01:00
Christoph M. Becker
c14bc7b10f Fail phpize early if config.w32 is missing (GH-17100)
On Windows, phpize happily builds configure even if there is no
config.w32, but running configure then error with "Must be run from the
root of the extension source".  This is confusing.

We bring phpize's behavior on par with POSIX systems, where the missing
config.m4 is detected and reported right away.
2024-12-15 12:02:19 +01:00
Niels Dossche
1ff68f58f7 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17153: SimpleXML crash when using autovivification on document
2024-12-15 11:32:08 +01:00
Niels Dossche
aea64c89f2 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17153: SimpleXML crash when using autovivification on document
2024-12-15 11:32:02 +01:00
Niels Dossche
a57a434f95 Fix GH-17153: SimpleXML crash when using autovivification on document
In the case of a member string, `mynode` may also be a document, which
doesn't have a namespace.

Closes GH-17156.
2024-12-15 11:31:32 +01:00
Niels Dossche
57e9429e73 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17158: pg_fetch_result Shows Incorrect ArgumentCountError Message when Called With 1 Argument
2024-12-14 19:49:12 +01:00
Niels Dossche
e562b8cf8e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17158: pg_fetch_result Shows Incorrect ArgumentCountError Message when Called With 1 Argument
2024-12-14 19:49:04 +01:00
Niels Dossche
388f63c310 Fix GH-17158: pg_fetch_result Shows Incorrect ArgumentCountError Message when Called With 1 Argument
Closes GH-17161.
2024-12-14 19:48:40 +01:00
Jakub Zelenka
7bfd19880f Merge branch 'PHP-8.4' 2024-12-14 15:01:55 +01:00
Jakub Zelenka
0cc0c7c7d9 Merge branch 'PHP-8.3' into PHP-8.4 2024-12-14 15:01:17 +01:00
Jakub Zelenka
3490ac0cb3 Fix GH-13437: FPM: ERROR: scoreboard: failed to lock (already locked)
This changes locking for scoreboard to reduce contention between readers
and adds retries for acquiring scoreboard for read.

Closes GH-15805
2024-12-14 14:59:56 +01:00
Niels Dossche
c015242947 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17145: DOM memory leak
2024-12-14 12:12:52 +01:00
Niels Dossche
4656c22526 Fix GH-17145: DOM memory leak
Because the use of RETURN instead of RETVAL, the freeing code could not
be executed. This only is triggerable if the content of the attribute is
mixed text and entities, so it wasn't noticed earlier.

Closes GH-17147.
2024-12-14 12:12:40 +01:00
Christoph M. Becker
bb6dbdcf94 Fix curl_multi_exec() overflow message (GH-17078)
As is, passing `2147484` as `$timeout`, throws a `ValueError` stating
the `$timeout` needs to be between 0 and 2147484, what is a confusing.
Thus we report the proper threshold as float.

While we're at it we also drop the superfluous `(double)` cast, and
rely on C's usual arithmetic conversions.
2024-12-13 16:06:39 +01:00
Christoph M. Becker
a7cf0725d8 Skip sapi_windows_set_ctrl_handler.phpt under ASan
For some reason, terminating the child process by sending CTRL+C won't
work under ASan instrumentation.  Since termination via CTRL+BREAK
works, there is apparently nothing fundamentally wrong, so we just
skip the test.

Closes GH-17086.
2024-12-13 14:29:40 +01:00