test(php-lsp): regression guards for aliased-trait name-collision OOMs (#765, #951)#986
Merged
Merged
Conversation
Two reported indexer OOMs reduce to the same self-flattening loop the trait-uses-itself fix closed (self-flatten short-circuit + snapshotted loop bound in flatten_trait_into_class): - a trait whose name collides with an aliased `use ... as` import it composes (#765's exact single-file reproducer) — the alias canonicalizes onto the enclosing trait via the short-name fallback - a class sharing its short name with an aliased trait import (#951's reproducer, reduced to one file: the trait definition being unavailable is what forces the short-name fallback onto the class) Both fixtures were verified RED against the pre-guard code (each hangs the suite within the 90s alarm when the two guards are reverted, each independently as the first test run) and GREEN with the guards in place. Landing them as permanent regression guards; the issues close as fixed-by-the-#920-pair. Closes #765 Closes #951 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The previous commit's clang-format pass reformatted the whole file (tests are not in the lint-enforced LINT_SRCS set, so the committed file was never format-clean under the local formatter). Restore the original formatting; the branch's net diff against main is now exactly the two new regression guards. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This was referenced Jul 9, 2026
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.
Summary
Verification work on two reported indexer OOMs concluded that both are already fixed on main by #920's guard pair in
flatten_trait_into_class(self-flatten short-circuit + snapshotted loop bound). This PR lands their exact reproducers as permanent regression guards and closes the issues.phplsp_trait_aliased_import_name_collision_terminates— PHP: trait whose name collides with an aliaseduse … asimport it composes → unbounded recursion indefinitionspass, OOM (SIGKILL) #765's single-file reproducer: a trait whose name collides with an aliaseduse … asimport it composes; the alias canonicalizes onto the enclosing trait via the short-name fallback → self-flattening loop.phplsp_class_aliased_trait_name_collision_terminates— Indexer OOM-killed (exit 137): infinite loop in PHP trait flattening when a class shares its short name with an aliased trait import #951's reproducer reduced to one file: a class sharing its short name with an aliased trait import; the missing trait definition forces the short-name fallback onto the class itself.RED/GREEN verification (per repo doctrine)
With #920's two guards temporarily reverted, each fixture independently hangs the suite (run first, killed by a 90s alarm — the unbounded registry-growth loop the issues report). With the guards in place: both PASS, full
php_lspsuite 281/281 green under ASan/UBSan.Net diff vs main: +58 lines, tests only (an intermediate commit briefly reformatted the file — tests aren't lint-enforced — and is reverted by the follow-up commit; the merge diff is clean).
Closes #765
Closes #951