vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.57k stars 660 forks source link

Fatal error since PHP 8.3.9+ #11067

Open sukei opened 3 months ago

sukei commented 3 months ago

When I run the whole analyze, I got the following error at the very end:

PHP Fatal error: Maximum execution time of 0 seconds exceeded in vendor/vimeo/psalm/src/Psalm/Internal/Type/ParseTree.php on line 26

If I remove the method ParseTree::__destruct, the error disappear. This method seems to exist for the memory management, but I do not see any improvement of the memory usage with or without the destructor.

romulodl commented 2 months ago

got the same error running psalm 5.25.0 on PHP 8.2.22

InvisibleSmiley commented 2 months ago

Last known good: 5.6.0 (broken since 5.7.0). I'm using psalm/phar because I cannot install vimeo/psalm due to dependency issues (namely nikic/php-parser ^5). Happens with both PHP 8.1 and 8.2.

InvisibleSmiley commented 2 months ago

Maybe stating the obvious, but this is neither a problem exceeding the max execution time nor a PHP config issue. It's an infinite loop.

weirdan commented 2 months ago

I can't reproduce it. Running latest 5.x branch on either PHP 8.2.23 or PHP 8.3.11 (both are the latest versions at the time of writing) on Psalm's own source code.

pereorga commented 2 months ago

Psalm's own source code

I can reproduce this using PHP 8.3.11 (brew, Mac M1), when running it with --no-cache.

weirdan commented 2 months ago

Running linux here, and it looks like it may be apple-specific: https://github.com/php/php-src/issues/12814#issuecomment-2224838123

@vudaltsov have you had any success tracking it down?

sukei commented 2 months ago

I can reproduce this using PHP 8.3.11 (brew, Mac M1), when running it with --no-cache.

I have PHP 8.3.11 installed with brew on a MacBook Pro M1 too. The --no-cache flag is not better nor worse however.

bakert commented 2 weeks ago

I started experiencing this after upgrading my project from PHP8.1 to 8.2. If I add --threads=1 it goes away. PHP installed via homebrew on my M1 Pro running Sonoma.