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
OOM when parsing a snippet #6896
Comments
This bug report is missing a link to reproduction on phpstan.org. It will most likely be closed after manual review. |
Oh, weird, looks like I cannot reproduce it in an AnalyserIntegrationTest, that's new for me |
Btw, just analyzing it via |
Ok thx, yeah I guess I need to reconfigure something, or need another test or messed something else up. |
Which PHP version are you using? I think this should not be related, but who knows.. I tested with 8 and 8.1 |
I'm on PHP 8.1, to be more precise I ran phpstan by cloning the phpstan-src repo, running composer install, then creating a ../phpstanTest folder with just a.php in it and running |
Ok, I still don't have a nice automated test unfortunately, but manually calling phpstan analyze was enough to bisect as you mentioned, yeah. it started occurring with phpstan/phpstan-src@53563e9 / 1.4.7
|
Puh, this is a hard one, I found the following places that make recursive reference via
|
Had another thought - not sure if it really makes sense to adapt PHPStan's data structures to avoid circular references, which UPDATE: tried the jms and symfony serializer packages, but they both had problems. and it feels like this is an overkill UPDATE2: tried switching to serialize/unserialize, just to see what would make problems. interestingly only the snippet from here (because of a closure). I'll try to figure out where this closure actually is.. (UPDATE3: it was the ClassReflection again in GenericObjectType. maybe I'll just finish my adaptions and open a PR for further discussion of this approach instead of further derailing this issue ;)) |
Most likely fixed by: phpstan/phpstan-src#1137 |
All good on this front, thanks! :) |
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. |
Bug report
Encountering an OOM when parsing the following snippet:
Code snippet that reproduces the problem
(phpstan.org also OOMs and the share link button won't work)
Expected output
No OOM
Did PHPStan help you today? Did it make you happy in any way?
Thank you for your work on phpstan <3
The text was updated successfully, but these errors were encountered: