Skip to content

[pull] master from php:master#1057

Merged
pull[bot] merged 7 commits into
turkdevops:masterfrom
php:master
Jul 3, 2026
Merged

[pull] master from php:master#1057
pull[bot] merged 7 commits into
turkdevops:masterfrom
php:master

Conversation

@pull

@pull pull Bot commented Jul 3, 2026

Copy link
Copy Markdown

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 : )

iluuu1994 and others added 7 commits July 2, 2026 23:40
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
@pull pull Bot locked and limited conversation to collaborators Jul 3, 2026
@pull pull Bot added the ⤵️ pull label Jul 3, 2026
@pull pull Bot merged commit 092de40 into turkdevops:master Jul 3, 2026
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants