Skip to content

Conversation

@joshuaruesweg
Copy link
Owner

No description provided.

Girgias and others added 30 commits March 30, 2025 19:35
…al without errors

This is intended to replace the few manual usages of zend_fetch_resource2_ex() to fetch a php_stream from a zval.
This will simplify the conversion from resource to object for streams when this actually happens.
returns the ongoing name of the service, if there is.
available since postgres 18

close phpGH-18198
Debugging memory corruption issues in production can be difficult when it's not possible to use a debug build or ASAN/MSAN/Valgrind (e.g. for performance reasons).

This change makes it possible to enable some basic heap debugging helpers without rebuilding PHP. This is controlled by the environment variable ZEND_MM_DEBUG. The env var takes a comma-separated list of parameters:

- poison_free=byte: Override freed blocks with the specified byte value (represented as a number)
- poison_alloc=byte: Override newly allocated blocks with the specified byte value (represented as a number)
- padding=bytes: Pad allocated blocks with the specified amount of bytes (if non-zero, a value >= 16 is recommended to not break alignments) 
- check_freelists_on_shutdown=0|1: Enable checking freelist consistency [1] on shutdown

Example:

    ZEND_MM_DEBUG=poison_free=0xbe,poison_alloc=0xeb,padding=16,check_freelists_on_shutdown=1 php ...

This is implemented by installing custom handlers when ZEND_MM_DEBUG is set.

This has zero overhead when ZEND_MM_DEBUG is not set. When ZEND_MM_DEBUG is set, the overhead is about 8.5% on the Symfony Demo benchmark.

Goals:

 - Crash earlier after a memory corruption, to extract a useful backtrace
 - Be usable in production with reasonable overhead
 - Having zero overhead when not enabled

Non-goals:

 - Replace debug builds, valgrind, ASAN, MSAN or other sanitizers

[1] php#14054

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
This is more efficient than manually dealing with a garbage copy.
After the loop, `parent` will for sure be ce_SplFixedArray, and
inherited will be true; for inherited cases.
This option is semi-deprecated [1] and shouldn't influence much anyway.
The anticipated BC break is low.

[1] PCRE2Project/pcre2#736 (comment)
[2] PCRE2Project/pcre2#736 (comment)

Closes phpGH-18150.
* PHP-8.4:
  Address deprecated PHP 8.4 session options to prevent test failures
Static __invoke() is disallowed since PHP 8.0.

Closes phpGH-18171
* PHP-8.3:
  Add missing EXTENSIONS section to intl test
* PHP-8.4:
  Add missing EXTENSIONS section to intl test
* PHP-8.3:
  Use-after-free in extract() with EXTR_REFS
* PHP-8.4:
  Use-after-free in extract() with EXTR_REFS
The test doesn't test what it says it does. And depending on what it is
actually trying to test, it is redundant with either
Zend/tests/traits/error_009.phpt, Zend/tests/traits/error_010.phpt or
Zend/tests/traits/language015.phpt.
This more accurately matches the "copy & paste" semantics described in
the documentation. Abstract trait methods diverge from this behavior,
given that a parent method can satisfy trait methods used in the child.
In that case, the method is not copied, but the check is performed after
the parent has been bound.

Fixes phpGH-15753
Fixes phpGH-16198
Close phpGH-15878
TimWolla and others added 25 commits April 22, 2025 22:24
* PHP-8.3:
  fileinfo: Fix cleanup in ext/fileinfo/tests/cve-2014-1943-mb.phpt (php#18397)
* PHP-8.4:
  fileinfo: Fix cleanup in ext/fileinfo/tests/cve-2014-1943-mb.phpt (php#18397)
* PHP-8.3:
  [skip ci] NEWS for php#18317
* PHP-8.4:
  [skip ci] NEWS for php#18317
It looks like it's no longer supported. We don't test tidy on FreeBSD
anyway.
* PHP-8.1:
  backporting C++17 detection support for recent icu4c releases.
  Drop tidyp from FreeBSD build
* PHP-8.2:
  backporting C++17 detection support for recent icu4c releases.
  Drop tidyp from FreeBSD build
* PHP-8.3:
  backporting C++17 detection support for recent icu4c releases.
  Drop tidyp from FreeBSD build
* PHP-8.4:
  backporting C++17 detection support for recent icu4c releases.
  Drop tidyp from FreeBSD build
* PHP-8.4:
  [skip ci] NEWS for php#18317
* fileinfo: Remove `php_fileinfo` struct

This is just a needless layer of indirection and requires an additional
allocation.

* fileinfo: Remove options field from `finfo_object`

This was only required to restore the original options when options are given
for `finfo_file()` or `finfo_buffer()`. This can more reliably be achieved
using `magic_getflags()` and is therefore redundant.

* fileinfo: Preserve error for uninitialized `finfo` objects
This makes the output in PHPInfo a little more readable.
DOM HTML serializer will be closer compliant to HTML5 in the next
libxml2 version, so the tests need to be adapted.
Ref: https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/309

Closes phpGH-18406.
* PHP-8.3:
  Fix DOM tests for upcoming libxml2 serializer changes
* PHP-8.4:
  Fix DOM tests for upcoming libxml2 serializer changes
This function is a noop and will be proposed for deprecation. This patch
removes the useless calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment