Skip to content

AOT: fix mb_trim NestedJIT ABI (SIGSEGV/empty) leftover of #34388 - #34396

Merged
PurHur merged 1 commit into
masterfrom
agent/ext-mbstring-34379-mb-trim-nestedjit-abi
Aug 24, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/ext-mbstring-34379-mb-trim-nestedjit-abi

Conversation

@PurHur

@PurHur PurHur commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • ./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4 PHP_COMPILER_HELPER_RUNTIME_O=0; php bin/vm.php test/repro/aot_mb_trim_runtime.php > /tmp/mbv.out; php bin/compile.php -o /tmp/mbrt test/repro/aot_mb_trim_runtime.php; /tmp/mbrt > /tmp/mba.out; diff -u /tmp/mbv.out /tmp/mba.out; echo DIFF=$?' → DIFF=0
  • ./script/phpunit.sh --filter MbTrimRuntimeAotTest → OK (2 tests, 14 assertions)
  • ./script/docker-exec.sh -- bash -lc './script/aot-smoke.sh' → 8/8

Not run: north-star5-verify --strict, full ci-local, release-readiness.

Made with Cursor

Use two-string public helpers and ascending no-break private bodies so
NestedJIT keeps __string__* params and does not SIGSEGV under thin AOT.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit d1def19 into master Aug 24, 2026
@PurHur
PurHur deleted the agent/ext-mbstring-34379-mb-trim-nestedjit-abi branch August 24, 2026 11:35
PurHur added a commit that referenced this pull request Aug 24, 2026
)

MbTrimJitHelper used substr() and index-subtraction patterns that thin AOT
miscompiles; rewrite rtrim with byte indexing, copyPrefix, and C2-hold NBSP
deferral so runtime haystack trim matches VM/Zend.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

AOT: mb_trim/mb_ltrim/mb_rtrim refuse runtime strings — LogicException (leftover of #5957/#23883, ext/mbstring/mbstring.c)

1 participant