Skip to content

Fix symfony-app SIGSEGV at boot: unbox a cell-typed name in the reflection builtins - #560

Merged
blacktrs merged 1 commit into
mainfrom
fix/refl-cell-name
Nov 3, 2026
Merged

blacktrs merged 1 commit into
mainfrom
fix/refl-cell-name

Conversation

@blacktrs

@blacktrs blacktrs commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Why

After #555 the compiled symfony-app dies with SIGSEGV while booting the container (AttributeAutoconfigurationPass -> ReflectionClass::getMethods). Backtrace: ReflectionMethod::flags -> __mc_refl_member -> strcmp, second argument 0xfff4... (a tagged cell word, not a string pointer).

Cause

#555 keeps a property that is passed by reference to a callee that stores the reference as a CELL for its whole lifetime (refStoredProps), typed or not. In symfony ReflectionMethod::$name (declared string) is such a slot, so the constructor stores a boxed cell and $this->name reads back as a cell. The reflection builtins (biMcRefl*) took their name argument with emitNode + coerceToPtr, which treats the word as a raw pointer and hands the tagged value to strcmp.

Bisect: the compiler at 99259a1b (#556 + #558) plus the comptime-require fix serves / with 200; the break comes with #555.

Change

coerceToNamePtr: for a CELL/UNKNOWN argument strip the tag (CELL_PAYLOAD_MASK) before it is used as a ptr; otherwise unchanged. Applied to every name argument of the biMcRefl* builtins (9 sites).

Test

reflection_ref_stored_name: a ReflectionMethod whose name is handed to a by-ref parameter that keeps the reference. The compiler on main exits 139 on it; with the fix the output equals php's.

Verified

  • New test passes; -k refl: 74/74 before the new test.
  • symfony-app built with this change: / 200, /nope 404, clean exit.

Not run

Full AOT suite, Linux gate, difftest.

…ty a reference retyped to a cell reached strcmp as a tagged word
@blacktrs
blacktrs merged commit f1c76b4 into main Nov 3, 2026
49 checks passed
@blacktrs
blacktrs deleted the fix/refl-cell-name branch November 3, 2026 07:44
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