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
PHP Fatal error: Uncaught UnexpectedValueException: Expecting strval to have storage #1200
Comments
What happens when you run it without |
Different error at least then: I'll try further with excluding the directory that error arose in |
ah hold up, would you mind running |
Ok, here it is back with 4 threads and adding the debug by line |
The Would you mind rerunning with Also what happens on line 2 of |
@muglug Yes, good point, that code is perhaps not something that works well with the analyzer, the whole file is basically as is noted here: (moved to gist cause github comments filter out the php tags) |
To clarify, when you run
|
The PHP error traceback should at least give some indication of what's causing the bug in Psalm. |
@muglug No sorry I truncated of just grabbing the last few lines, it basically prints out all the lines as it scans and analyzes, it's just that was the one where it threw the error. Would you want the full output from the entire scan? It's quite large as I believe there's a few thousand files so likely would need to upload it for you. Do you have enough info from the error + the lines noted in the output? I could try to create a test repo with just the offending file to see if that gives the same error |
Sadly the snippet you gave (a standard variable assignment to a string) isn’t the root cause. You should hopefully have a longer error output that resembles something like the one given in #1026? |
Obviously if you can narrow it down yourself that’d be great, too, but I don’t want to make you do my work for me :) |
Also the message "PHP Fatal error: Uncaught UnexpectedValueException: Expecting strval to have storage in..." should be followed by a filename - is there a reference to strval in that file and if so, where? |
@muglug note I was able to get a successful run by excluding a few of the directories and not adding threads=4. Passing the threads option, the results seem to be non-deterministic. I'll see if I can narrow down out of the excluded directories by adding them back in and then reporting back on the files with outputs that fatal errored |
To help narrow down, you can run Psalm on those directories directly by running |
@muglug here's one with the full output that failed, run on some library code (which I had since excluded) but as you can see it reproduces the behavior |
@muglug also those lines are |
Great, I can reproduce with this clone of smarty: opensolutions/smarty@8466966 Temp workaround: use an autoloader (
|
Thanks for the digging - when Psalm encounters a The workaround above helps Psalm figure out what the |
@muglug Thanks so much for being such a responsive and dedicated maintainer of this project. Psalm seems great and we're hoping to set it up for continual use at Kiva.org |
You're welcome! Thanks for working to do good in the world! |
Similar (same?) issue:
|
Would you mind opening a new issue for that? Very likely a different issue |
Below is what happens when running from the command line as shown
$ ./vendor/bin/psalm --use-ini-defaults --threads=4
Scanning files...
Analyzing files...
Child terminated without returning a serialized array - response type=boolean
Child terminated without returning a serialized array - response type=boolean
Child terminated without returning a serialized array - response type=boolean
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Psalm\IssueBuffer::addIssues() must be of the type array, null given, called in /kiva/main/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php on line 252 and defined in /kiva/main/vendor/vimeo/psalm/src/Psalm/IssueBuffer.php:215
Stack trace:
#0 /kiva/main/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(252): Psalm\IssueBuffer::addIssues(NULL)
#1 /kiva/main/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(416): Psalm\Internal\Codebase\Analyzer->analyzeFiles(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 4, false)
#2 /kiva/main/vendor/vimeo/psalm/src/psalm.php(501): Psalm\Internal\Analyzer\ProjectAnalyzer->check('/kiva/main/', false)
#3 /kiva/main/vendor/vimeo/psalm/psalm(2): require_once('/kiva/main/vend...')
#4 {main}
thrown in /kiva/main/vendor/vimeo/psalm/src/Psalm/IssueBuffer.php on line 215
Fatal error: Uncaught TypeError: Argument 1 passed to Psalm\IssueBuffer::addIssues() must be of the type array, null given, called in /kiva/main/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php on line 252 and defined in /kiva/main/vendor/vimeo/psalm/src/Psalm/IssueBuffer.php:215
Stack trace:
#0 /kiva/main/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(252): Psalm\IssueBuffer::addIssues(NULL)
#1 /kiva/main/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(416): Psalm\Internal\Codebase\Analyzer->analyzeFiles(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 4, false)
#2 /kiva/main/vendor/vimeo/psalm/src/psalm.php(501): Psalm\Internal\Analyzer\ProjectAnalyzer->check('/kiva/main/', false)
#3 /kiva/main/vendor/vimeo/psalm/psalm(2): require_once('/kiva/main/vend...')
#4 {main}
thrown in /kiva/main/vendor/vimeo/psalm/src/Psalm/IssueBuffer.php on line 215
The text was updated successfully, but these errors were encountered: