History log of /php-src/Zend/zend_observer.c (Results 1 – 25 of 37)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# a22a8724 07-Apr-2024 Bob Weinand

Add next handler parameter to zend_observer_remove_begin/end_handler (#13807)

The usage of the current API within an observer handler leads to bugs like https://bugs.xdebug.org/view.php?id=2

Add next handler parameter to zend_observer_remove_begin/end_handler (#13807)

The usage of the current API within an observer handler leads to bugs like https://bugs.xdebug.org/view.php?id=2232.
Given two observer handlers, next to each other. The first one is executed. It removes itself. The second observer handler gets moved to the place of the first. The first one returns. The handler in the second slot is fetched, but is now NULL, because the it's now in the slot of the first observer; i.e. the second handler is skipped and the begin/end symmetry guarantee is violated.

Providing the next handler to the caller is a zero-cost way to avoid any impact in the paths of zend_observe_fcall_begin/end.

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

show more ...


# 709540cc 09-Jun-2023 Bob Weinand

Fix add/remove observer API with multiple observers installed

Depending on the order in which observers were installed, some observers might have been executed twice after removal of another

Fix add/remove observer API with multiple observers installed

Depending on the order in which observers were installed, some observers might have been executed twice after removal of another observer. Also, adding an observer could produce a bogus pointer.

show more ...


# bf1cfc07 16-Jan-2023 Christoph M. Becker

Revert GH-10300

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

This reverts commit 68ada76f9a659745f572539b72afa06fa75a866f.
his reverts commit 45384c6

Revert GH-10300

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

This reverts commit 68ada76f9a659745f572539b72afa06fa75a866f.
his reverts commit 45384c6e201eda9963e2fcc18946a9446230a2d6.
This reverts commit ef7fbfd71025f034b0bfcb413efd181ce798fc1b.
This reverts commit 9b9ea0d7c696f2990a159b2a2dafbc04547dc10f.
This reverts commit f15747c26be4a2330dc0cf3ea442f53f30f84cac.
This reverts commit e883ba93c40827fafd7868517eb48e04569f76ab.
This reverts commit 7e87551c3775d26e20b06a4032a00053db6452cc.
This reverts commit 921274d2b8966641a00c0a767ae40ba7187bdffc.
This reverts commit fc1f528e5e3ee45ab17ae8dcfad6a6422ff2002d.
This reverts commit 0961715cdafb5d39124667ff94f3b56453ce71f1.
This reverts commit a93f264526e1cdade71d887800c1c448c411bfdc.
This reverts commit 72dd94e1c6d29203b8f6473317f626e6d6d6fbdc.
This reverts commit 29b2dc89645e741f91cc920964432dccd2aaef14.
This reverts commit 05c7653bba7571852f5ce6fc0d220a1a829bc4c0.
This reverts commit 5190e5c260ee05e3f3c3d1168263a1a6637441d0.
This reverts commit 6b55bf228cb2da8705737d414f394950a92d8aae.
This reverts commit 184b4a12d3215d105720d005b31e365249e2eb21.
This reverts commit 4c31b7888a561e920fd3889ba8d99368f3c2d9e6.
This reverts commit d44e9680f080b4918cfed268b96f90ea35975617.
This reverts commit 4069a5c43f419d76e1254c8e49b4cad9968a408f.

show more ...


# 921274d2 04-Jan-2023 Max Kellermann

Zend/zend_observer: include cleanup


# 8dabbda8 24-Oct-2022 Florian Sowade

Don’t reset func in zend_closure_internal_handler

The pointer is used in _zend_observe_fcall_begin().


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23
# 396b2aab 23-Aug-2022 Bob Weinand

Wrap observer notify functions into inlined enabled checks

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

Revision tags: php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3, php-8.2.0beta2, php-8.1.9, php-8.0.22, php-8.1.9RC1, php-8.2.0beta1, php-8.0.22RC1
# bf427b73 11-Jul-2022 Bob Weinand

Add an API to observe functions and classes being linked

To observe when the functions and classes start being officially available to the user

Signed-off-by: Bob Weinand <bobwei9@h

Add an API to observe functions and classes being linked

To observe when the functions and classes start being officially available to the user

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

show more ...

# da94baf3 29-Jul-2022 Bob Weinand

Add proper handling to observe functions in fibers

The current_observed_frame is carried along the fiber context and thus always correct now.

Signed-off-by: Bob Weinand <bobwei9@hot

Add proper handling to observe functions in fibers

The current_observed_frame is carried along the fiber context and thus always correct now.

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

show more ...

# dc5475c1 28-Jul-2022 Bob Weinand

Save previous observer on the VM stack

This avoids a possible significant performance penalty, when some leaf function was observed, deep in the stack.
As a side effect, we are not itera

Save previous observer on the VM stack

This avoids a possible significant performance penalty, when some leaf function was observed, deep in the stack.
As a side effect, we are not iterating over prev_execute_data anymore and thus, non-observed fake frames, possibly on stack, cannot have any impact on the observer anymore (especially within zend_observer_fcall_end_all).

Saving the previous observer happens now directly on the VM stack. If there is any observer, function frames are allocated an extra zval (the last temporary), which will, on observed frames, contain the previous observed frame address.

show more ...

# 625f1649 20-Jul-2022 Bob Weinand

Include internal functions in the observer API

There are two main motivations to this:
a) The logic for handling internal and userland observation can be unified.
b) Unwinding of obs

Include internal functions in the observer API

There are two main motivations to this:
a) The logic for handling internal and userland observation can be unified.
b) Unwinding of observed functions on a bailout does notably not include observers. Even if users of observers were to ensure such handling themselves, it would be impossible to retain the relative ordering - either the user has to unwind all internal observed frames before the automatic unwinding (zend_observer_fcall_end_all) or afterwards, but not properly interleaved.

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

show more ...

# 9e2de4c2 11-Jul-2022 Bob Weinand

Add an API to manipulate observers at runtime

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

Revision tags: php-8.0.21, php-8.1.8, php-8.2.0alpha3, php-8.1.8RC1, php-8.2.0alpha2, php-8.0.21RC1, 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, 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
# 0e88f749 01-Mar-2022 Bob Weinand

Merge branch 'PHP-8.1'


# 85b669e5 01-Mar-2022 Bob Weinand

Merge branch 'PHP-8.0' into PHP-8.1


Revision tags: php-8.0.17RC1, php-8.1.3, php-8.0.16, php-7.4.28
# 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.3RC1, php-8.0.16RC1, php-8.1.2, php-8.0.15, php-8.1.2RC1, php-8.0.15RC1
# 1d448290 27-Dec-2021 Christoph M. Becker

Merge branch 'PHP-8.1'

* PHP-8.1:
Revert "Fix zend_observer_fcall_end_all() accessing dangling pointers"


# d58c48d4 27-Dec-2021 Christoph M. Becker

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
Revert "Fix zend_observer_fcall_end_all() accessing dangling pointers"


# ee610947 27-Dec-2021 Christoph M. Becker

Revert "Fix zend_observer_fcall_end_all() accessing dangling pointers"

This reverts commit 76e2a8380e5e030412e9d565955d011972af8418. Cf.
<https://github.com/php/php-src/commit/76e2a8380

Revert "Fix zend_observer_fcall_end_all() accessing dangling pointers"

This reverts commit 76e2a8380e5e030412e9d565955d011972af8418. Cf.
<https://github.com/php/php-src/commit/76e2a8380e5e030412e9d565955d011972af8418#r62560239>.

show more ...

# a72a0110 27-Dec-2021 Christoph M. Becker

Merge branch 'PHP-8.1'

* PHP-8.1:
Fix zend_observer_fcall_end_all() accessing dangling pointers


# d4c07df4 27-Dec-2021 Christoph M. Becker

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
Fix zend_observer_fcall_end_all() accessing dangling pointers


Revision tags: php-8.0.14, php-8.1.1, php-7.4.27, php-8.1.1RC1, php-8.0.14RC1, php-7.4.27RC1, php-8.1.0
# 76e2a838 18-Nov-2021 Florian Sowade

Fix zend_observer_fcall_end_all() accessing dangling pointers

This may happen, when the execute_data was allocated on the stack. We
ensure that the runtime cache pointer is not NULL bef

Fix zend_observer_fcall_end_all() accessing dangling pointers

This may happen, when the execute_data was allocated on the stack. We
ensure that the runtime cache pointer is not NULL before dereferencing
it.

This is a partial fix for bug 81430.

Closes GH-7665.

show more ...

Revision tags: php-8.0.13, php-7.4.26, php-7.3.33, php-8.1.0RC6, php-7.4.26RC1, php-8.0.13RC1, php-8.1.0RC5, php-7.3.32, php-7.4.25, php-8.0.12
# 7699aed3 13-Oct-2021 Joe Watkins

missing shutdown in observer

Revision tags: php-8.1.0RC4, php-8.0.12RC1, php-7.4.25RC1
# b94b97f7 29-Sep-2021 Joe Watkins

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
Fix #81380 observer may not be initialized properly


Revision tags: php-8.1.0RC3
# c884a5a2 28-Sep-2021 Joe Watkins

Fix #81380 observer may not be initialized properly

Revision tags: php-8.0.11, php-7.4.24, php-7.3.31, php-8.1.0RC2
# a8f06346 13-Sep-2021 Bob Weinand

Merge remote-tracking branch 'origin/PHP-8.0' into PHP-8.1


# 12b0f1b7 13-Sep-2021 Bob Weinand

Fix #81435 Observer current_observed_frame may point to an old (overwritten) frame

Ensure current_observed_frame always points to an actually observed frame.
This solution has a caveat o

Fix #81435 Observer current_observed_frame may point to an old (overwritten) frame

Ensure current_observed_frame always points to an actually observed frame.
This solution has a caveat of being O(stack size), with the worst case occurring if there are a lot of frames between the current and previous observed frames.
An O(1) solution would require keeping track of the previous observed frame, which would require some additional frame attached metadata, which is best not attempted in an already released version.

show more ...

12