Skip to content

AOT: inline str_pad helper — stop NestedJIT VmString null segfault (#23911) - #23931

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-23911-aot-str-pad-segfault
Jul 27, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-23911-aot-str-pad-segfault

Conversation

@PurHur

@PurHur PurHur commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #23911

php-src reference

  • ext/standard/string.c — PHP_FUNCTION(str_pad)
  • PHP implementation: ext/standard/StrPadJitHelper.php + lib/JIT/Builtin/StringStrPad.php

Trust gate (pre-claim)

  • bootstrap-inventory --check: OK 6592/6592
  • release-readiness --json: user_release_ready: yes (north-star5-fast ok; gen-0 seed stale warning only)

Verification

# Issue repro (default user-script AOT, HELPER_RUNTIME_O on)
./script/docker-exec.sh --bind -- bash -lc 'source script/php-env.sh
  php bin/vm.php test/repro/issue23911_str_pad_aot.php
  php bin/compile.php -o /tmp/i23911 test/repro/issue23911_str_pad_aot.php
  /tmp/i23911'
# p---- / p---- / p----  EXIT 0  (was: fatal signal after c:main_before_php)

php -d memory_limit=1536M vendor/bin/phpunit --filter StrPadRuntimeShrinkTest
# OK (3 tests, 21 assertions)

php -d memory_limit=1536M vendor/bin/phpunit --filter "str_pad_literal_segfault|str_pad\"$|str_pad_named" test/aot/AotTest.php
# OK (3 tests)

# differential case named in the issue
php bin/compile.php -o /tmp/c11 test/differential/cases/c11_strcmp.php && /tmp/c11
# p---- / bcde  EXIT 0

Not covered: full differential-sweep.sh --aot; str_pad_null_forward_profile_84 AOT fixture still expects exit 255 while VM/AOT soft-null on PROFILE=8.4 (pre-existing vs #21190) — unchanged by this PR.

Made with Cursor

…23911)

StrPadJitHelper called VmString::strPad which returns null under user-script
AOT (same class as #23204 str_repeat). Inline the pad loop and align
StringStrPad with the NestedJitCompileScope peer guard.

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: str_pad() segfaults — three-argument literal call is enough

1 participant