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

130358 Commits

Author SHA1 Message Date
Dmitry Stogov
29efbe593d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix possible exit_counters memory leak in ZTS build
2023-02-06 18:37:24 +03:00
Dmitry Stogov
a21195650e Fix possible exit_counters memory leak in ZTS build 2023-02-06 18:35:06 +03:00
David Carlier
c6f0e89f16 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-05 16:41:34 +00:00
Niels Dossche
49551d7c29 Sync boost/context assembly files for fibers
Fixes GH-10398

The stack was misaligned upon entering the trampoline function [1], this
causes a CPU trap when the SSE instruction is executed to copy data from
the stack. This was fixed upstream [2]. This commit syncs all upstream
changes from the boost/context assembly files to our copy.

[1] https://github.com/php/php-src/pull/10407#issuecomment-1404180877
[2] https://github.com/boostorg/context/pull/219

Closes GH-10407.
2023-02-05 16:40:54 +00:00
Jakub Zelenka
2b71fa6952 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-05 13:10:19 +00:00
Niels Dossche
5b13e83074 Fix GH-10385: FPM successful config test early exit
This introduces an enum `fpm_init_return_status` to propagate the status
up to fpm_main. This also makes the code clearer by not using magic
integer return numbers.

Closes GH-10388
2023-02-05 13:07:29 +00:00
Jakub Zelenka
aa9b5ed1e4 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-05 12:37:40 +00:00
Jakub Zelenka
4199b72c50 Fix GH-10315: FPM unknown child alert not valid
This changes the log level for an unknown child during wait as this is
not unuasual if FPM master has pid 1 and also possible in some cases
for higher pid processes. Based on that and the fact that this is not
really a problem, there is just a debug level message emitted for pid 1
and for higher pid a warning is emitted.

Closes GH-10319
2023-02-05 12:36:02 +00:00
Tyson Andre
e3f04ddb0b Merge branch 'PHP-8.1' into PHP-8.2 2023-02-03 09:18:03 -05:00
Tyson Andre
fe2dc2b481 Avoid crash for reset/end/next/prev() on ffi classes (#9711)
(And any PECLs returning `zend_empty_array` in the handler->get_properties
overrides)

Closes GH-9697

This is similar to the fix used in d9651a9419
for array_walk.

This should make it safer for php-src (and PECLs, long-term) to return
the empty immutable array in `handler->get_properties` to avoid wasting memory.
See https://github.com/php/php-src/issues/9697#issuecomment-1273613175

The only possible internal iterator position for the empty array is at the end
of the empty array (nInternalPointer=0).
The `zend_hash*del*` helpers will always set nInternalPointer to 0 when an
array becomes empty,
regardless of previous insertions/deletions/updates to the array.
2023-02-03 09:17:33 -05:00
Ilija Tovilo
9f966183eb Merge branch 'PHP-8.1' into PHP-8.2 2023-02-02 18:59:20 +01:00
Max Kellermann
f7e678476f .github/workflows/push.yml: enable ccache
This reduces the LINUX_X64_RELEASE_ZTS build time from 9-10 minutes to
less than 3 minutes.

Closes GH-10395
2023-02-02 18:58:30 +01:00
Derick Rethans
cb907d50a8 Merge branch 'PHP-8.1' into PHP-8.2 2023-01-31 13:00:06 +00:00
Derick Rethans
d17175cb08 Merge remote-tracking branch 'derickr/GH-10447-p-format-specifier' into PHP-8.1 2023-01-31 12:59:39 +00:00
Derick Rethans
a42bf93308 Fixed GH-10447: 'p' format specifier does not yield 'Z' for 00:00 2023-01-31 12:58:21 +00:00
Derick Rethans
322425eb5b Merge remote-tracking branch 'derickr/GH-10152-serialise-datetime' into PHP-8.2 2023-01-31 12:54:00 +00:00
Derick Rethans
85fbc6eaa6 Fix GH-10152: Custom properties of Date's child classes are not serialised 2023-01-31 12:53:03 +00:00
Bob Weinand
f732486c08 Merge branch 'PHP-8.1' into PHP-8.2 2023-01-30 12:33:06 +01:00
Bob Weinand
00be6e1aed Look at executing generator for fiber destructor behaviour 2023-01-30 12:32:53 +01:00
Bob Weinand
e746b89bc9 Merge branch 'PHP-8.1' into PHP-8.2 2023-01-30 12:13:41 +01:00
Bob Weinand
b9bca2dadb Fix resetting ZEND_GENERATOR_IN_FIBER flag
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-01-30 12:13:07 +01:00
Dmitry Stogov
55e3f73109 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix type inference
2023-01-30 13:16:05 +03:00
Dmitry Stogov
81607a62ca Fix type inference
Fixes oss-fuzz #55358
2023-01-30 13:15:05 +03:00
George Peter Banyard
08f654b590 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect check in phar tar parsing
2023-01-29 17:17:21 +00:00
Niels Dossche
ec4939b170 Fix incorrect check in phar tar parsing
The entry.flags was used to check whether the entry has the directory
flag. The flags however were masked to only contain the permissions. We
need to check the mode, before the permission masking, instead of the
flags to check whether it is a directory.

Closes GH-10464

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-29 17:14:12 +00:00
Aaron Piotrowski
5e1b9666a9 [ci skip] NEWS 2023-01-28 10:18:12 -06:00
Aaron Piotrowski
0c4aee464a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10437: Set active fiber to null on bailout (#10443)
2023-01-28 10:16:04 -06:00
Aaron Piotrowski
284c29328e Fix GH-10437: Set active fiber to null on bailout (#10443) 2023-01-28 10:13:58 -06:00
Arnaud Le Blanc
cfb6e82cbd [ci skip] NEWS 2023-01-27 19:37:27 +01:00
Arnaud Le Blanc
6c22dea3c1 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  Fix overflow check in OnUpdateMemoryConsumption (#10456)
  Prevent dtor of generator in suspended fiber (#10462)
2023-01-27 19:37:01 +01:00
Arnaud Le Blanc
a24ac59e55 [ci skip] NEWS 2023-01-27 19:36:28 +01:00
Niels Dossche
d7de73b551 Fix overflow check in OnUpdateMemoryConsumption (#10456)
memsize is a signed long, therefore the check against the
(*un*signed long maximum) / 1024² will allow too large values. This check worked
correctly in d4b3f89c53 where it checked against the maximum signed
value, but was broken in 003346c450. Fix it by changing ZEND_ULONG_MAX
to ZEND_LONG_MAX.
2023-01-27 19:33:58 +01:00
Arnaud Le Blanc
1173c2e64a Prevent dtor of generator in suspended fiber (#10462)
Generators that suspended a fiber should not be dtor because they will be
executed during the fiber dtor.

Fiber dtor throws an exception in the fiber's context in order to unwind and
execute finally blocks, which will also properly dtor the generator.

Fixes GH-9916
2023-01-27 19:32:25 +01:00
Arnaud Le Blanc
ab2097df48 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Handle non-INDIRECT symbol table entries in zend_fiber_object_gc() (#10386)
2023-01-27 10:55:30 +01:00
Arnaud Le Blanc
9830204213 Handle non-INDIRECT symbol table entries in zend_fiber_object_gc() (#10386)
Fixes GH-10340
2023-01-27 10:52:42 +01:00
David Carlier
fe9b622e7a zend extension build warning fix.
clang is more picky in this case but at least it makes it more consistent overall.
2023-01-25 20:59:08 +00:00
Derick Rethans
2c8ea44ff4 Merge branch 'ossfuzzer-fixes' into PHP-8.2 2023-01-25 10:50:24 +00:00
Derick Rethans
639bfbc217 Sync timelib to 2022.05 to address OSS Fuzzer issues 2023-01-25 10:49:48 +00:00
Niels Dossche
972c74c300 Fix incorrect check in zend_internal_call_should_throw()
This debug code is part of arginfo validation. This validation will
never trigger properly because the OR operation makes the first if
always true. Fix it by changing to an AND.

Closes GH-10417

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-25 00:12:13 +00:00
George Peter Banyard
0d9bf101c4 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect check in cs_8559_5 in map_from_unicode()
  Fix incorrect page_size check
2023-01-25 00:10:56 +00:00
Niels Dossche
a8c8fb2564 Fix incorrect check in cs_8559_5 in map_from_unicode()
The condition `code == 0x0450 || code == 0x045D` is always false because
of an incorrect range check on code.
According to the BMP coverage in the encoding spec for ISO-8859-5
(https://encoding.spec.whatwg.org/iso-8859-5-bmp.html) the range of
valid characters is 0x0401 - 0x045F (except for 0x040D, 0x0450, 0x045D).
The current check has an upper bound of 0x044F instead of 0x045F.
Fix this by changing the upper bound.

Closes GH-10399

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-25 00:08:28 +00:00
Niels Dossche
b7a158a19b Fix incorrect page_size check
The current check always evaluated to false because if `!page_size`
is true, then `page_size & (page_size - 1)` equals `0 & (0 - 1)` which
is always 0. The if condition is meant to check if page_size is zero or
not a power of two, thus we must change the AND to an OR to fix this
issue.

Closes GH-10427

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-25 00:06:56 +00:00
Tim Düsterhus
a8ecfc8a9b Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS (#10442)
2023-01-24 23:20:16 +01:00
Niels Dossche
40da9961f2 [ci skip] NEWS (#10442) 2023-01-24 23:19:21 +01:00
Máté Kocsis
7517cf3b97 Merge branch 'PHP-8.1' into PHP-8.2
- PHP-8.1:
  Fix GH-10292 1st param of mt_srand() has UNKNOWN default on PHP <8.3
2023-01-24 19:53:09 +01:00
Máté Kocsis
3197104e85 Fix GH-10292 1st param of mt_srand() has UNKNOWN default on PHP <8.3
Closes GH-10429
2023-01-24 19:05:33 +01:00
Dmitry Stogov
227b3b3281 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect check condition in type inference (#10425)
2023-01-24 09:32:26 +03:00
Niels Dossche
2787e3cd65 Fix incorrect check condition in type inference (#10425)
The "nothing to do" case would never be hit because the switch block
would execute if the opcode is ZEND_ASSIGN_STATIC_PROP_OP,
not ZEND_ASSIGN_STATIC_PROP. This meant that we were falling through to
the else block. Fix this by correcting the check condition.
2023-01-24 09:32:07 +03:00
Dmitry Stogov
d5b307c434 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect bitshifting and masking in ffi bitfield (#10403)
2023-01-24 09:15:27 +03:00
Niels Dossche
560ca9c7ae Fix incorrect bitshifting and masking in ffi bitfield (#10403)
When a uint8_t is bitshifted to the left, it is actually promoted to an
int. For the current code this has the effect of a wrong sign-extension,
and the result will also wrongly become zero when insert_pos >= 32.
Fix this by adding an explicit cast.
Furthermore, the partial prefix byte mask was computed incorrectly: the
byte is already shifted so the mask should not account for the shift.
2023-01-24 09:15:03 +03:00