[pull] master from php:master#1057
Merged
Merged
Conversation
perf stat --control allows the profiled process to enable and disable counters
at runtime. This allows us to skip profiling startup and shutdown for more
accurate results. The same already exists for valgrind.
$ perf stat -D -1 --control fifo:/tmp/perfctl,/tmp/perfack
-D -1 starts perf stat with counters disabled. --control makes perf stat connect
to the /tmp/perfctl and /tmp/perfack fifo files. These need to exist when
starting perf, so create them using mkfifo /tmp/perf{ctl,ack}. The ctl fifo is
written to by cgi to enable/disable counters, whereas the ack fifo is written to
by perf stat to acknowledge counters have been installed.
Additionally, you'll need to set the set the PERF_STAT_CTL_FIFO and
PERF_STAT_ACK_FIFO env variables for cgi to find the fifo files.
* PHP-8.5: [8.5] NEWS: add entry for bugfix from GH-22187
A number of call sites lowercased a class/function/method name into a temporary string solely to use it as a lookup key in the class table, function table, module registry, etc., then released it. Replace those with zend_hash_find_ptr_lc() / zend_hash_str_find_ptr_lc(), which lowercase into a stack buffer (for short names), perform the lookup, and free the temporary internally. This removes the manual tolower + release boilerplate at 17 sites and avoids a heap allocation for the common short-name case. No behavior change.
phpdbg_resolve_opline_break() passed the result of zend_str_tolower_dup() directly as the lookup key to zend_hash_str_find_ptr() for both the class and the function/method lookups. That emalloc'd buffer was never freed, leaking on every method/function opline breakpoint resolution. Use zend_hash_str_find_ptr_lc(), which lowercases into a (stack-allocated for short names) temporary and frees it internally, instead of duplicating the key by hand and leaking it. Add a regression test that exercises all three paths through the two lookups (class + method found, method not found, class not found). Closes GH-22563
* PHP-8.4: phpdbg: fix leaked lowercased lookup keys in phpdbg_resolve_opline_break
* PHP-8.5: phpdbg: fix leaked lowercased lookup keys in phpdbg_resolve_opline_break
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )