Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop while scanning certain file #6933

Closed
danog opened this issue Mar 29, 2022 · 8 comments
Closed

Infinite loop while scanning certain file #6933

danog opened this issue Mar 29, 2022 · 8 comments

Comments

@danog
Copy link

danog commented Mar 29, 2022

Bug report

An infinite loop occurs while scanning a certain project.

Code snippet that reproduces the problem

Extract https://paste.daniil.it/phpstan.tar.xz and run composer update; .../phpstan-src/bin/phpstan analyze -vvv --xdebug --debug Module/Article/DataProvider/RegOwnerSteps.php

Expected output

No infinite loop

Did PHPStan help you today? Did it make you happy in any way?

<3

@mergeable
Copy link

mergeable bot commented Mar 29, 2022

This bug report is missing a link to reproduction on phpstan.org.

It will most likely be closed after manual review.

@herndlm
Copy link
Contributor

herndlm commented Mar 29, 2022

thx for the reproducer, I can take a look again later today. Does it also happen without --xdebug and --debug?

@danog
Copy link
Author

danog commented Mar 29, 2022

Yep, it happens even with no flags as long as the vendor folder and composer.lock are both populated.

@bartv2
Copy link

bartv2 commented May 21, 2022

Just had a look, it eats memory in 1.5.2 but just works in the 1.7.x branch. So fixed?

@herndlm
Copy link
Contributor

herndlm commented May 22, 2022

I did actually forget about this, sorry.. But maybe it was part of some other endless recursion fixes we did recently. Is it also fixed on 1.6.x?
But anyways, if there's no endless loop anymore it is fixed I guess. Would be still great to find out which part caused it and add a regression test for it, so maybe this should still stay open. My guess: something related to traits. Or, if it still occurs on 1.6.x - most likely the fully static reflection changes in 1.7.x?

@bartv2
Copy link

bartv2 commented May 22, 2022

This is the commit that fixed this, but at first glance it doesn't look like a proper fix.

@ondrejmirtes
Copy link
Member

Can anyone volunteer to add it to integration tests in phpstan/phpstan similarly to this commit? Thanks! 5a8fb50

@github-actions
Copy link

github-actions bot commented Oct 5, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants