Skip to content

test(php-lsp): regression guards for aliased-trait name-collision OOMs (#765, #951)#986

Merged
DeusData merged 2 commits into
mainfrom
fix/php-trait-alias-oom-guards
Jul 9, 2026
Merged

test(php-lsp): regression guards for aliased-trait name-collision OOMs (#765, #951)#986
DeusData merged 2 commits into
mainfrom
fix/php-trait-alias-oom-guards

Conversation

@DeusData

@DeusData DeusData commented Jul 9, 2026

Copy link
Copy Markdown
Owner

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.

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_lsp suite 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

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>
@DeusData DeusData added this to the 0.9.1-rc milestone Jul 9, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant