Skip to content

Fix: SPINE_CHUNK sockets compile past SIGSEGV/verify (#24429) - #24890

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-24429-spine-chunk-segfault
Jul 29, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-24429-spine-chunk-segfault

Conversation

@PurHur

@PurHur PurHur commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restore TYPE_STRING guard on Helper's compileTimeString IDENTICAL fast-path so VALUE-boxed string literals are not passed to VmStringCompare::identical as native __string__* (was SIGSEGV / structGep kind=10 under PHP_COMPILER_SPINE_CHUNK=1 on ext/sockets/SocketsLibcThinAbi.php).
  • Coerce typed __object__* returns via JitValueBox::valuePtrFromVariable instead of store __value__* into alloca __value__ (module verify failure in SocketsLibcThinAbi::ffi() after the string-compare crash was cleared).
  • Compile-only repro: test/repro/issue_24429_static_nullable_object_return.php.

Closes #24429 — partial: removes the sockets SIGSEGV/verify wall for SocketsLibcThinAbi; full ext/sockets chunk still OOMs at ≥4G (next capacity wall), and unbound ExternalMethod stubs remain (#579).

php-src / prior art

Test plan

# Was: structGep / SIGSEGV; now compiles
PHP_COMPILER_LLVM_ASSERT=1 PHP_COMPILER_SPINE_CHUNK=1 \
  php bin/compile.php -o /tmp/repro24429.bin \
  test/repro/issue_24429_static_nullable_object_return.php
# → RC 0

# Prior fallthrough still OK
php bin/compile.php -o /tmp/d1.bin test/repro/issue_24429_static_call_fallthrough.php  # RC 2
PHP_COMPILER_SPINE_CHUNK=1 PHP_COMPILER_REPORT_EXTERNAL_STUBS=1 \
  php bin/compile.php -o /tmp/d2.bin test/repro/issue_24429_static_call_fallthrough.php  # RC 0

php vendor/bin/phpunit --filter ExternalMethodBindTest  # 8 OK

# Full sockets chunk: no longer rc=139; default 1536M / 4G still OOM (capacity, not crash)
script/spine-chunk-probe.sh --ext=sockets

Not covered

Made with Cursor

Require TYPE_STRING on the compileTimeString IDENTICAL fast-path so VALUE
boxes are not passed to VmStringCompare as native strings, and coerce
`__object__*` returns through valuePtrFromVariable instead of storing a
`__value__*` into alloca `__value__`.

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.

Spine split-TU is blocked on cross-chunk binding: no spine chunk compiles in isolation today

1 participant