History log of /PHP-8.4/Zend/zend_fibers.c (Results 1 – 25 of 69)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# cd255007 28-Aug-2024 Arnaud Le Blanc

Do not scan generator frames more than once (#15330)


# 7c6ff878 21-Feb-2024 Arnaud Le Blanc

Expose fibers API


# ea026826 08-Apr-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-13903: ASAN false positive underflow when executing copy()

Closes GH-13917.


# 013978e5 05-Mar-2024 Cristian Rodríguez

Zend/fibers: Ensure fiber stack is not backed by THP. (#13306)

Ending with fiber stack mapped in hugepages will affect performance
badly.
Until < Linux 6.8-rc2 MAP_STACK was a noop,

Zend/fibers: Ensure fiber stack is not backed by THP. (#13306)

Ending with fiber stack mapped in hugepages will affect performance
badly.
Until < Linux 6.8-rc2 MAP_STACK was a noop, now it implies no THP, older releases
need madvise.

show more ...


# 71f14510 09-Oct-2023 Daniil Gentili

Fix GH-11121: ReflectionFiber segfault

Closes GH-12391.

Co-authored-by: Aaron Piotrowski <aaron@trowski.com>


# 0a04c008 11-May-2023 Ilija Tovilo

Fix potential NULL pointer access in zend_fiber_object_gc

Accidentally introduced in GH-11208.

Fixes oss-fuzz #58795


# 06fe9ff0 08-May-2023 Ilija Tovilo

Fix use-of-undefined in zend_fiber_object_gc of ex->call

ex->call is only set for user calls, we shouldn't access it here.
zend_unfinished_execution_gc_ex wouldn't actually use it for in

Fix use-of-undefined in zend_fiber_object_gc of ex->call

ex->call is only set for user calls, we shouldn't access it here.
zend_unfinished_execution_gc_ex wouldn't actually use it for internal calls, so
it didn't cause any serious issues.

Closes GH-11208

show more ...


# 371ae12d 19-Feb-2023 Max Kellermann

Zend/zend_fibers: change return value to zend_result

According to @nikic:

> The current guideline for use of bool and zend_result in php-src is
> that bool is an appropriate ret

Zend/zend_fibers: change return value to zend_result

According to @nikic:

> The current guideline for use of bool and zend_result in php-src is
> that bool is an appropriate return value for "is" or "has" style
> functions, which return a yes/no answer. zend_result is an
> appropriate return value for functions that perform some operation
> that may succeed or fail.

Closes GH-10622.

show more ...


# 95016138 13-Feb-2023 Bob Weinand

Fix GH-10496: Fibers must not be garbage collected while implicitly suspended by resumption of another fiber


# d721dcc2 10-Feb-2023 Arnaud Le Blanc

Fix colletion of unfinished function call in fibers

Fixes GH-10496.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>


# 284c2932 28-Jan-2023 Aaron Piotrowski

Fix GH-10437: Set active fiber to null on bailout (#10443)


# 98302042 27-Jan-2023 Arnaud Le Blanc

Handle non-INDIRECT symbol table entries in zend_fiber_object_gc() (#10386)

Fixes GH-10340


# c8955c07 16-Jan-2023 Christoph M. Becker

Revert GH-10220

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491d66081298a16634629f149459706a9.
This reverts commit 588a07

Revert GH-10220

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491d66081298a16634629f149459706a9.
This reverts commit 588a07f7371ee2b5fac17de147926780e427fae6.
This reverts commit f377e15751d3aa48b69cd9bcc366ede7803d511f.
This reverts commit b4ba16fe189b109144aff669e11d81365160104b.
This reverts commit 694ec1deea36e366b28b6349a52be49824e1a1a8.
This reverts commit 6b34de8eba9f66882ae16e6073af28783670ac53.
This reverts commit aa1cd02a4367834026ea2205ea13a2f904455aa1.
This reverts commit 308fd311ea6fcf3094b448df7f2b264f08e4fe4f.
This reverts commit 16203b53e1822a37b6ba6f2ab198bb435d05fdad.
This reverts commit 738fb5ca5412f5e833a7fab82b11519e635a3357.
This reverts commit 9fdbefacd3c382d731aa175b7bdc002ec9cb2b30.
This reverts commit cd4a7c1d90562ebb5f89caf94d00d579631b9fbe.
This reverts commit 928685eba2b2f0ded90e7f78fd806ea164002f6e.
This reverts commit 01e5ffc85cd4357fd7b5b7ceefa29f2d10ca26b7.

show more ...


# 4fb14939 13-Jan-2023 Arnaud Le Blanc

GC fiber unfinished executions (#9810)


# 833b45ac 10-Jan-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-10249: Assertion `size >= page_size + 1 * page_size' failed.

Co-authored-by: Changochen <changochen1@gmail.com>

Closes GH-10284


# aa1cd02a 04-Jan-2023 Max Kellermann

Zend/zend_fibers: include cleanup


# a11c8a30 16-Dec-2022 Arnaud Le Blanc

Limit stack size (#9104)


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23, php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3, php-8.2.0beta2, php-8.1.9, php-8.0.22
# 37b84b7e 26-Jul-2022 Chen, Hu

Fiber: add shadow stack support

Shadow stack is part of Intel's Control-Flow Enforcement Technology (CET).

Whenever a function is called, the return address is pushed onto both

Fiber: add shadow stack support

Shadow stack is part of Intel's Control-Flow Enforcement Technology (CET).

Whenever a function is called, the return address is pushed onto both
the regular stack and the shadow stack. When that function returns, the
return addresses are popped off both stacks and compared; if they fail
to match, #CP raised.

With this commit, we create shadow stack for each fiber context and
switch the shadow stack accordingly during fcontext switch.

Signed-off-by: Chen, Hu <hu1.chen@intel.com>

Closes GH-9283.

show more ...


# 5a0b68be 14-Sep-2022 Bob Weinand

Revert "Store default object handlers alongside the class entry"

This reverts commit 9e6eab3c139b41dc976dd5305fd1a6e387e5e27f.

Reverted along a01dd9fedaecd2e5b95bc5c2e8d6542116addea

Revert "Store default object handlers alongside the class entry"

This reverts commit 9e6eab3c139b41dc976dd5305fd1a6e387e5e27f.

Reverted along a01dd9fedaecd2e5b95bc5c2e8d6542116addeae.

show more ...


# 9e6eab3c 22-Jul-2022 Bob Weinand

Store default object handlers alongside the class entry

Object handlers being separate from class entries is a legacy inherited from PHP 5. Today it has little benefit to keep them separate:

Store default object handlers alongside the class entry

Object handlers being separate from class entries is a legacy inherited from PHP 5. Today it has little benefit to keep them separate: in fact, accessing object handlers usually requires not-so-safe hacks.
While it is possible to swap handlers in a custom installed create_object handler, this mostly is tedious, as well as it requires allocating the object handlers struct at runtime, possibly caching it etc..

This allows extensions, which intend to observe other classes to install their own class handlers.
The life cycle of internal classes may now be simply observed by swapping the class handlers in post_startup stage.
The life cycle of userland classes may be observed by iterating over the new classes in zend_compile_file and zend_compile_string and then swapping their handlers.

In general, this would also be a first step in directly tying the object handlers to classes. Especially given that I am not aware of any case where the object handlers would be different between various instances of a given class.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>

show more ...


# 8fe1db20 26-Aug-2022 Bob Weinand

Delay fiber VM stack cleanup until after observer has been called

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>


# 0adbf9c2 22-Jul-2022 Martin Schröder <53789145+kooldev@users.noreply.github.com>

Fix memory leak in fiber constructor by throwing an error (#9098)


Revision tags: php-8.1.9RC1, php-8.2.0beta1, php-8.0.22RC1, php-8.0.21, php-8.1.8, php-8.2.0alpha3, php-8.1.8RC1, php-8.2.0alpha2, php-8.0.21RC1
# e67565f5 20-Jun-2022 Max Kellermann

Zend, ext/opcache: use PR_SET_VMA_ANON_NAME (Linux 5.17) (#8234)

The new Linux 5.17 feature PR_SET_VMA_ANON_NAME can give names to
anonymous private memory, see:

https://lwn.ne

Zend, ext/opcache: use PR_SET_VMA_ANON_NAME (Linux 5.17) (#8234)

The new Linux 5.17 feature PR_SET_VMA_ANON_NAME can give names to
anonymous private memory, see:

https://lwn.net/Articles/867818/

It can be useful while debugging, to identify which portion of the
process's memory belongs to which subsystem.

This is how /proc/PID/maps can look like:

555ccd400000-555ccdc00000 r-xp 00000000 00:00 0 [anon:huge_code_pages]
7f6ec6600000-7f6ec6800000 rw-p 00000000 00:00 0 [anon:zend_alloc]

The first mapping is the PHP executable copied to anonymous memory by
option "opcache.huge_code_pages". The second one is a memory area for
the "zend_alloc.h" memory allocator library.

Unfortunately, it is not possible to give names to shared memory
(MAP_SHARED), because Linux MAP_SHARED really maps /dev/zero (see
shmem_zero_setup()), which makes madvise_vma_anon_name() believe this
is a file mapping, failing the prctl() with EBADF.

show more ...


Revision tags: php-8.0.20, php-8.1.7, php-8.2.0alpha1, php-7.4.30, php-8.1.7RC1, php-8.0.20RC1, php-8.1.6, php-8.0.19, php-8.1.6RC1
# 040a37d3 26-Apr-2022 Chen

Add IBT support for fiber

Indirect Branch Tracking (IBT) is part of Intel's Control-Flow
Enforcement Technology (CET). IBT is hardware based, forward edge
Control-Flow-Integrity mech

Add IBT support for fiber

Indirect Branch Tracking (IBT) is part of Intel's Control-Flow
Enforcement Technology (CET). IBT is hardware based, forward edge
Control-Flow-Integrity mechanism where any indirect CALL/JMP must target
an ENDBR instruction or suffer #CP.

This commit adds IBT support for fiber:
1. Add endbr32/64 in assembly
2. Inform compiler jump_fcontext may return via indirect branch

Furthermore:
gcc support CET since v8.1 and set it to default since gcc 11. That is,
the ELF header of sapi/cli/php has a property named IBT. However, such
property is lost since PHP8.1 because the assembly introduced by Fiber.
This commit also fixes this.

Closes GH-8339

Signed-off-by: Chen, Hu <hu1.chen@intel.com>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

show more ...


Revision tags: php-8.0.19RC1, php-8.0.18, php-8.1.5, php-7.4.29, php-8.1.5RC1, php-8.0.18RC1, php-8.1.4, php-8.0.17, php-8.1.4RC1, php-8.0.17RC1, php-8.1.3, php-8.0.16, php-7.4.28, php-8.1.3RC1, php-8.0.16RC1, php-8.1.2, php-8.0.15, php-8.1.2RC1, php-8.0.15RC1, php-8.0.14, php-8.1.1, php-7.4.27
# 069bbf3e 14-Dec-2021 Petr Sumbera

Fix zend_fibers.c build with ZEND_FIBER_UCONTEXT

Avoids (Solaris SPARC) issue:
zend_fibers.c:77:9: error: unknown type name 'ucontext_t'

Closes GH-7773.


123