History log of /PHP-8.1/Zend/zend.c (Results 1 – 25 of 851)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# fe3a819e 01-Nov-2023 Dmitry Stogov

Fixed GH-12564: The negative fiber.stack_size setting leads to crash


# 96885bc0 05-Aug-2023 Kévin Dunglas

fix: handle the GNU specific version of strerror_r

Close GH-11882


# 4c38a79f 20-Apr-2023 Ilija Tovilo

Fix incorrect CG(memoize_mode) state after bailout in ??=

Fixes GH-11108
Closes GH-11109


# ff62d117 04-Mar-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-8646: Memory leak PHP FPM 8.1

Fixes GH-8646
See https://github.com/php/php-src/issues/8646 for thorough discussion.

Interned strings that hold class entries can get a cor

Fix GH-8646: Memory leak PHP FPM 8.1

Fixes GH-8646
See https://github.com/php/php-src/issues/8646 for thorough discussion.

Interned strings that hold class entries can get a corresponding slot in map_ptr for the CE cache.
map_ptr works like a bump allocator: there is a counter which increases to allocate the next slot in the map.

For class name strings in non-opcache we have:
- on startup: permanent + interned
- on request: interned
For class name strings in opcache we have:
- on startup: permanent + interned
- on request: either not interned at all, which we can ignore because they won't get a CE cache entry
or they were already permanent + interned
or we get a new permanent + interned string in the opcache persistence code

Notice that the map_ptr layout always has the permanent strings first, and the request strings after.
In non-opcache, a request string may get a slot in map_ptr, and that interned request string
gets destroyed at the end of the request. The corresponding map_ptr slot can thereafter never be used again.
This causes map_ptr to keep reallocating to larger and larger sizes.

We solve it as follows:
We can check whether we had any interned request strings, which only happens in non-opcache.
If we have any, we reset map_ptr to the last permanent string.
We can't lose any permanent strings because of map_ptr's layout.

Closes GH-10783.

show more ...


# ad85e714 03-Mar-2023 Kévin Dunglas

fix: support for timeouts with ZTS on Linux (#10141)


# 897ca85d 09-Aug-2022 Jakub Zelenka

Revert "Fix GH-8409: SSL handshake timeout persistent connections hanging"

This reverts commit d0527427be57957157aec5e26a28899b380140df.

This patch makes Swoole/Swow can not work an

Revert "Fix GH-8409: SSL handshake timeout persistent connections hanging"

This reverts commit d0527427be57957157aec5e26a28899b380140df.

This patch makes Swoole/Swow can not work anymore, because Coroutine will yield to another one during socket operation, EG(record_errors) assertion will always fail, and zend_begin_record_errors() was only used during compile time before.
Note: zend_emit_recorded_errors() and the typo fix are reserved.

show more ...


# d0527427 09-Aug-2022 Jakub Zelenka

Fix GH-8409: SSL handshake timeout persistent connections hanging

This is not actually related to SSL handshake but stream socket creation
which does not clean errors if the error handle

Fix GH-8409: SSL handshake timeout persistent connections hanging

This is not actually related to SSL handshake but stream socket creation
which does not clean errors if the error handler is set. This fix
prevents emitting errors until the stream is freed.

show more ...


Revision tags: php-8.1.7RC1
# f07a08df 06-May-2022 Arnaud Le Blanc

Fix unregistering ini entries of dynamically loaded extension (#8435)

Fixes GH-8185

# c6a53f94 11-Mar-2022 Dmitry Stogov

Fix non-reentirant startiong or error recording from error handler

Fixes oss-fuzz #45398

# 67b372e2 07-Mar-2022 Bob Weinand

Merge branch 'PHP-8.0' into PHP-8.1


# 15949b61 07-Mar-2022 Bob Weinand

Fix ZTS build after cherry-pick

# a44d99fe 07-Mar-2022 Bob Weinand

Merge branch 'PHP-8.0' into PHP-8.1


# 0d7e10c1 07-Mar-2022 Tim Düsterhus

Fix memory leak of function attribute hash table (#8070)

==109253== 280 (56 direct, 224 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
==109253== at 0x4

Fix memory leak of function attribute hash table (#8070)

==109253== 280 (56 direct, 224 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
==109253== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==109253== by 0x6D9FA2: __zend_malloc (zend_alloc.c:3068)
==109253== by 0x745138: zend_add_attribute (zend_attributes.c:226)
==109253== by 0x6680D1: zend_add_parameter_attribute (zend_attributes.h:102)
==109253== by 0x66B787: zm_startup_zend_test (test.c:478)
==109253== by 0x7224CD: zend_startup_module_ex (zend_API.c:2202)
==109253== by 0x72252C: zend_startup_module_zval (zend_API.c:2217)
==109253== by 0x734288: zend_hash_apply (zend_hash.c:2011)
==109253== by 0x722C30: zend_startup_modules (zend_API.c:2328)
==109253== by 0x67409B: php_module_startup (main.c:2256)
==109253== by 0x88EDDE: php_cli_startup (php_cli.c:409)
==109253== by 0x890F61: main (php_cli.c:1334)

show more ...

Revision tags: php-8.1.4RC1
# 85b669e5 01-Mar-2022 Bob Weinand

Merge branch 'PHP-8.0' into PHP-8.1


Revision tags: php-8.1.3
# e6cf5831 12-Feb-2022 Bob Weinand

Fix GH-8082: Prevent leaking memory on observed transient run_time_caches

This is achieved by tracking the observers on the run_time_cache (with a fixed amount of slots, 2 for each observer)

Fix GH-8082: Prevent leaking memory on observed transient run_time_caches

This is achieved by tracking the observers on the run_time_cache (with a fixed amount of slots, 2 for each observer).
That way round, if the run_time_cache is freed all associated observer data is as well.

This approach has been chosen, as to avoid any ABI or API breakage.
Future versions may for example choose to provide a hookable API for run_time_cache freeing or similar.

show more ...

Revision tags: php-8.1.2RC1
# 72f8dbb3 24-Nov-2021 Dmitry Stogov

Fixed bug #81634 (ZEND_ENABLE_STATIC_TSRMLS_CACHE produces extensionswith the STATIC_TLS flag)

Revision tags: php-8.1.0, php-7.3.33, php-7.3.32, php-7.3.31
# 6434c93a 26-Aug-2021 Nikita Popov

Explicitly store real map ptr base

If we only store the biased pointer, the map ptr region will not
be recognized as reachable memory by leak checkers. This is
primarily problematic

Explicitly store real map ptr base

If we only store the biased pointer, the map ptr region will not
be recognized as reachable memory by leak checkers. This is
primarily problematic for fuzzing, because this is persistent
memory that may be reallocated during the request, without being
an actual leak.

Avoid this by simply storing both the real base pointer of the
allocation, as well as the biased base pointer used for accesses.

show more ...

Revision tags: php-7.3.30
# 116fa654 23-Aug-2021 Dmitry Stogov

Fixed ZEND_MAP_PTR_KIND_PTR (it is not used)

# 315f4094 11-Aug-2021 Nikita Popov

Always use CE_CACHE, remove TYPE_HAS_CE (#7336)

Currently, CE_CACHE on strings is only used with opcache interned strings. This
patch extends usage to non-opcache interned strings as wel

Always use CE_CACHE, remove TYPE_HAS_CE (#7336)

Currently, CE_CACHE on strings is only used with opcache interned strings. This
patch extends usage to non-opcache interned strings as well. This means that
most type strings can now make use of CE_CACHE even if opcache is not loaded,
which allows us to remove TYPE_HAS_CE kind, and fix some discrepancies
depending on whether a type stores a resolved or non-resolved name.

There are two cases where CE_CACHE will not be used:

* When opcache is not used and a permanent interned string (that is not an
internal class name) is used as a type name during the request. In this case
we can't allocate a map_ptr index for the permanent string, as it would be
not be in the permanent map_ptr index space.
* When opcache is used but the script is not cached (e.g. eval'd code or
opcache full). If opcache is used, we can't allocate additional map_ptr
indexes at runtime, because they may conflict with indexes allocated by
opcache.

In these two cases we would end up not using CE caching for property types
(argument/return types still have the separate cache slot).

show more ...

# e0119525 28-Jul-2021 Nikita Popov

Preload unlinked classes, remove preload autoload (#7311)

Currently, classes that can't be linked get moved back into the original script
and are not preloaded. As such classes may be re

Preload unlinked classes, remove preload autoload (#7311)

Currently, classes that can't be linked get moved back into the original script
and are not preloaded. As such classes may be referenced from functions that
did get preloaded, there is a preload autoload mechanism to load them at
runtime.

Since PHP 8.1, we can safely preload unlinked classes, which will then go
through usual lazy loading. This means that we no longer need the preload
autoload mechanism. However, we need to be careful not to modify any hash
table buckets in-place, and should create new buckets for lazy loaded classes.

show more ...

# 70195c35 27-Jul-2021 Nikita Popov

Don't force property type resolution for include preloading

Having all property types resolved is no longer a hard requirement
for preloading, resolving the types is just an optimization

Don't force property type resolution for include preloading

Having all property types resolved is no longer a hard requirement
for preloading, resolving the types is just an optimization. As
such, drop the special logic that forced loading of property
types when include-based preloading is used. Instead only keep
the code that resolves types based on actually preloaded classes.

Also drop the ZEND_ACC_PROPERTY_TYPES_RESOLVED flag, which is now
nearly useless and takes up flag space...

show more ...

# 989205e9 12-Jul-2021 Nikita Popov

Remove incorrect uses of zend_atoi()

zend_atoi() parses integers with size suffixes (like "128M").
These just want to use a plain number, so use ZEND_ATOL instead.

# efbb2198 12-Jul-2021 Nikita Popov

Return value from ZEND_ATOL

Instead of assigning it as part of the macro itself, which makes
usage quite awkward.

Revision tags: php-7.3.29
# aff36587 29-Jun-2021 Patrick Allaert

Fixed some spaces used instead of tabs

# 5d4f0552 15-Jun-2021 Aaron Piotrowski

Drop fiber block hooks

Removes the ability for an extension to allow Fiber switching in blocked contexts.

See discussion on fdc22744a8951b605a546ad6f09a2b907043bc54.

12345678910>>...35