Repository navigation
Fix symfony-app SIGSEGV at boot: unbox a cell-typed name in the reflection builtins - #560
Merged
Merged
Conversation
…ty a reference retyped to a cell reached strcmp as a tagged word
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 argument0xfff4...(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 symfonyReflectionMethod::$name(declaredstring) is such a slot, so the constructor stores a boxed cell and$this->namereads back as a cell. The reflection builtins (biMcRefl*) took their name argument withemitNode+coerceToPtr, which treats the word as a raw pointer and hands the tagged value tostrcmp.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 aptr; otherwise unchanged. Applied to every name argument of thebiMcRefl*builtins (9 sites).Test
reflection_ref_stored_name: aReflectionMethodwhosenameis 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
-k refl: 74/74 before the new test./200,/nope404, clean exit.Not run
Full AOT suite, Linux gate, difftest.