Skip to content

Bug #63581 Possible null dereference and buffer overflow - #234

Closed
remicollet wants to merge 2 commits into
php:masterfrom
remicollet:issue-fpm-deref
Closed

Bug #63581 Possible null dereference and buffer overflow#234
remicollet wants to merge 2 commits into
php:masterfrom
remicollet:issue-fpm-deref

Conversation

@remicollet

Copy link
Copy Markdown
Member

@remicollet

Copy link
Copy Markdown
MemberAuthor

Applied

EdmondDantes added a commit to true-async/php-src that referenced this pull request Aug 18, 2026
Three review findings, in the order they cost the most.
The adjustment moved out of gc_possible_root_when_full, a function upstream
edits and the fork had so far kept byte-identical; the call site now names a
fork-only wrapper and nothing else in that function changes. Reweaving upstream
control flow at every merge was a worse price than the redundant call the
restructure had saved.
The record is replayed only when the run examined something. A collection that
finds the root buffer already drained returns 0 without looking at a root, and
adjusting on that 0 stepped the threshold up for free - the same ratchet the
commit before this one removed, reached through a different door.
A spawn that fails now clears the record instead of leaving it for a coroutine
that was never created.
The dispose hook is gone with them: extended_dispose does not fire on every
path that destroys a coroutine, so it was insurance that only looked complete,
and the per-request clear in gc_reset() covers the case it was added for.
EdmondDantes added a commit to true-async/php-src that referenced this pull request Aug 18, 2026
The clear on spawn failure could not fire: gc_collect_cycles() runs first and
clears the record, then the wrapper two frames up re-evaluates the same
predicate, finds it still true and sets it back. The record was therefore
always left behind by a failed spawn, and the clear only ever reached explicit
collections, where it could drop a pending record instead.
The wrapper now records only while a coroutine actually owes the run. No
coroutine means the collection either ran inline or was never spawned, and in
both cases the count in hand is the honest one - which also stops a genuine
count from being discarded when async activates inside a destructor of an
inline run.
EdmondDantes added a commit to true-async/php-src that referenced this pull request Aug 18, 2026
php#234: adjust the GC threshold from the coroutine that collects
EdmondDantes added a commit to true-async/php-src that referenced this pull request Aug 18, 2026
Sign up for freeto 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.

2 participants

@remicollet@laruence