psalm icon indicating copy to clipboard operation
psalm copied to clipboard

Fatal error since PHP 8.3.9+

Open sukei opened this issue 1 year ago • 7 comments

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.

sukei avatar Aug 07 '24 09:08 sukei

got the same error running psalm 5.25.0 on PHP 8.2.22

romulodl avatar Sep 02 '24 12:09 romulodl

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 avatar Sep 03 '24 07:09 InvisibleSmiley

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.

InvisibleSmiley avatar Sep 03 '24 07:09 InvisibleSmiley

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.

weirdan avatar Sep 07 '24 18:09 weirdan

Psalm's own source code

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

pereorga avatar Sep 07 '24 20:09 pereorga

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?

weirdan avatar Sep 07 '24 21:09 weirdan

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.

sukei avatar Sep 08 '24 07:09 sukei

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.

bakert avatar Oct 31 '24 20:10 bakert

Can confirm what @bakert suspects. On my end, however, I've not changed PHP versions for quite some time, nor have I changed psalm versions (am on 4.30.0).

My suspicion is that this started when I upgraded to Sequoia 15.1. --threads=1 works, --threads=2 does not.

$ php --version
PHP 7.4.33 (cli) (built: Sep 27 2024 12:56:02) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v3.1.6, Copyright (c) 2002-2022, by Derick Rethans
    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies

Saeven avatar Nov 21 '24 04:11 Saeven

same problem on M2 + php8.3 + --threads != 1

Filipponik avatar Nov 22 '24 10:11 Filipponik

This seems to have been fixed in Psalm 6.1.0.

I was still able to reproduce it with 6.0 but not with any later version.

InvisibleSmiley avatar Apr 16 '25 08:04 InvisibleSmiley