Skip to content

Grow smart_str buffers through functions every PHP release exports - #6776

Merged
ondrejmirtes merged 2 commits into
2.3.xfrom
turbo-smart-str-pins
Oct 22, 2026
Merged

ondrejmirtes merged 2 commits into
2.3.xfrom
turbo-smart-str-pins

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Recent PHP patch releases (8.3.36 and its siblings) changed zend_smart_str.h's inline appending helpers to grow the buffer through a new smart_str_ferealloc(). The turbo extension's shared core is compiled against one version's headers but must load on every patch release of every supported minor. A core built against the new headers imports smart_str_ferealloc(), which earlier patch releases don't export, so the core fails to load there.

Found in #6775: its CI rebuilt the Windows core against the 8.3.36 devel pack, and the extension then failed to load that core on the runner's PHP 8.5.11 NTS (LoadLibrary error 127). The other Windows variants installed newer patch releases and passed. On 2.3.x the problem is hidden because CI reuses a core built before 8.3.36 shipped, so the next change to turbo-ext/src would have hit it. On Linux the same import resolves lazily, and would surface as an unresolved symbol on an older patch release.

The fix pins the helpers the extension uses in abi.h, next to the other codegen pins, so they grow the buffer through smart_str_erealloc() as they did before. Every release exports that function. This PR changes turbo-ext/src, so its CI rebuilds the core against 8.3.36 and runs the Windows PHP 8.5 NTS job against it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MMNnG2Zo7wgvSZCzjdk17X

@ondrejmirtes
ondrejmirtes force-pushed the turbo-smart-str-pins branch 2 times, most recently from 5da6a18 to 4a5187b Compare October 22, 2026 19:53
ondrejmirtes and others added 2 commits October 22, 2026 21:55
Recent patch releases (8.3.36 and its siblings) changed zend_smart_str.h's
inline appending helpers to grow the buffer through a new
smart_str_ferealloc(). The shared core is compiled against one version's
headers and must load on every patch release of every supported minor;
built against the new headers, it imports smart_str_ferealloc(), which
the earlier releases do not export, and fails to load there: a core
rebuilt in CI against the 8.3.36 devel pack failed to load on the
runner's PHP 8.5.11 NTS on Windows with LoadLibrary error 127. 2.3.x's
runs reuse a core built before 8.3.36 shipped, so the next change to
turbo-ext/src would have hit it.

The helpers the extension uses are pinned in abi.h to grow through
smart_str_erealloc(), as they did before, which every release exports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMNnG2Zo7wgvSZCzjdk17X
@ondrejmirtes
ondrejmirtes merged commit a9d6b5e into 2.3.x Oct 22, 2026
136 checks passed
@ondrejmirtes
ondrejmirtes deleted the turbo-smart-str-pins branch October 22, 2026 19:57
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