psalm: how to debug: "Child terminated with return code 0 and signal 9" and "Could not get class storage"

hi there,

while trying to scan a whole project, I got the error:

Uncaught Exception: Could not get class storage for kint here’s the output. (Kint can be found here)

because I don´t know how to fix this, I just tried to ignore “Kint” at this point: vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Properties.php and added:

/** in method propertyExists */
if ($fq_class_name==='Kint') {
  return false;
}

just to see, what happens. with that change I got the error:

Scanning files...
Analyzing files...

E░░EE░░░░░E░░░░E░EE░EEEE░░E░░░E░E░EEE░E░EEEEEEEEEEEEEEEEE░EE  60 / 791 (7%)
░EEEEEEEEEEEEEEEEEEE░EEEEEEEEEEEEEEE░EEEE░░E░EE░E░░EEEEE░EEE 120 / 791 (15%)
EEEEEEEEEEEEEEEEEEEEEEEE░E░EEE░EEEEEEEEEEE░E░E░░░E░E░░░░E░EE 180 / 791 (22%)
EE░EEE░░EEEEEEEEEEEEEEEEEEEE░E░░░░EEEEEE░░░░░░░░EEEEE░░E░░░E 240 / 791 (30%)
EEE░EEEE░EEEEEEEEEEEEEEEEEEEEEEEEEEE░░E░E░EEEE░░EEEEEEEEEEE░ 300 / 791 (37%)
E░░░░░░EEEEEEEEEEE░░EEEEEE░░░E░EEE░EE░░░░░░░EEEEEE░░EE░░░EEE 360 / 791 (45%)
░EEE░░EEEEEEEEEEEEEEEEEEE░EEEEEE░░E░░░EEEE░░░░░░░░EEEEE░░EE░ 420 / 791 (53%)
░░░EEE░E░E░EEEEEEEEEEEEEEEEEE░EEEEEEEEE░EE░EE░E░E░░░░░░░EEEE 480 / 791 (60%)
E░░EE░░░░░░E░EEE░EEEEEE░EEEEEEEEEEE░EEEEEEEEE░EEEEEEEEE░░░░░ 540 / 791 (68%)
░░EEEEEChild terminated with return code 0 and signal 9

after digging in psalm issues I have seen, that people tried to use --debug-by-line but I don´t see anything, running psalm multiple times, show me different files and different lines before psalm gets terminated. I removed --threads and disabled opcache, I tried PHP 7.4 and 8.0.1, same problems. I tested with and without --no-cache, same results.

psalm version: Psalm 4.3.2@57b53ff26237074fdf5cbcb034f7da5172be4524 PHP: tested with 7.4 and 8.0.1 (with and without opcache) also tried pcre.jit=0 but has no effect

so please let me know, how I can debug these errors and find the piece of code that is responsible for all this.

thanks!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21

Most upvoted comments

This is the part that confuses Psalm:

if ((!\defined('KINT_SKIP_FACADE') || !KINT_SKIP_FACADE) && !\class_exists('Kint')) {
    \class_alias('Kint\\Kint', 'Kint');
}

Reproducer: https://psalm.dev/r/85a57c9dbe

Probable solution is to make propertyExist() handle the class name here:

https://github.com/vimeo/psalm/blob/9e0525439d3024e12b3402b2ef7f908ca2cb2e56/src/Psalm/Internal/Codebase/Properties.php#L97

the same way as methodExists() does: https://github.com/vimeo/psalm/blob/9e0525439d3024e12b3402b2ef7f908ca2cb2e56/src/Psalm/Internal/Codebase/Methods.php#L111-L117

Unhandled exception still needs to be addressed (https://github.com/vimeo/psalm/issues/5056#issuecomment-763509642).

funny… please don´t blame for this 10-year-old code 🙈 😂 but psalm stops here and runs out of memory. if the method checkAUTH gets modified like: return false; instead of this super terrible long compare… then psalm runs without any issues and finishes its scan and offers me a result 😏

@weirdan https://github.com/michabbb/test-psalm-kint calling psalm with --show-info --find-unused-psalm-suppress --show-info --threads=1 I found the line that causes the error, but I still don´t know why or how to fix it 😏