Skip to content

sapi/phpdbg: Fix btree cleanup traversal - #366

Closed
iliaal wants to merge 1 commit into
masterfrom
fix/aph-phpdbg-btree-cleanup-double-free-brpd-84-work
Closed

iliaal wants to merge 1 commit into
masterfrom
fix/aph-phpdbg-btree-cleanup-double-free-brpd-84-work

Conversation

@iliaal

@iliaal iliaal commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Advance the contiguous btree branch during cleanup so detached child allocations are recursively freed exactly once.

phpdbg_btree_clean_recursive() never advanced past the first node of a
contiguously allocated chain, so it only ever looked at that node's
sibling. Siblings hanging off deeper nodes were leaked whenever a
watchpoint tree still held entries at request shutdown, and a sibling on
the first node, i.e. keys differing in the top bit, was freed once per
remaining level. Step to the next node of the chain on every level.
@iliaal
iliaal changed the base branch from PHP-8.4 to master November 27, 2026 11:41
@iliaal
iliaal force-pushed the fix/aph-phpdbg-btree-cleanup-double-free-brpd-84-work branch from e1b5c84 to d721f3c Compare November 27, 2026 11:42
@iliaal

iliaal commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Submitted upstream as php#25835.

@iliaal iliaal closed this Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant