-
Notifications
You must be signed in to change notification settings - Fork 679
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 Notice: Undefined offset => PHP Fatal error: Uncaught UnexpectedValueException: $storage should not be null #2316
Comments
|
Mind running with |
I just ran into the same issue when setting up psalm on a veeeery old branch of ours which was, frankly, a mess. In my case, this issue was reproducible when:
This is a race condition where one process sees the class definition and the other sees methods being called on the other class with the same name. I don't think this needs fixing, but I'm posting here if somebody else runs into the same issue. |
Oh thanks! |
@pilif I’m going to try to reproduce based on this information (but if you can create a small repro repo that would be amazing). At the very least Psalm shouldn’t crash. |
I had a lot of trouble reproducing it because it's sheer luck which process sees one class and which sees the usage of the other. So for various values of n and depending on the machine I was trying on, it would be fine or blow up. Of the classes in question, both were named One of them had a The fix was to exclude the directory containing one of the classes and subclasses. |
Also hitting this. Seems like the same problem of different classes with the same name. Would rather not exclude either of the directories. Can psalm disambiguate the files somehow? |
3.9 crashes by default for us because of this. |
If anyone can create a repo that reproduces the bug, I'll be able to fix it quickly cc @nickyr |
Yeah it’s really a struggle to reproduce in a separate repo. And trimming down the problem repo is unwieldy because it’s so big that psalm init eats up all my computer’s application memory If it doesn’t crash first...that’s gonna be an issue. I’ve seen it fail on two different classes, each of which shares its name with at least one other class. In one case, all the classes with the same name extend the same parent. But in another case, one of the classes has no parents or children. But making a repo with classes with the same name doesn’t reproduce the issue for me, it just fails with a DuplicateClass error. I wonder if a certain volume of classes is needed for the race condition to have a chance of happening. |
Ahhh - Psalm probably isn’t forking its analysis because the number of files is too low - you can override that in Also Nico says hi |
Ok I got it to fork, had to edit a couple other places. Still no repro though. I may need to think about this whole memory limit issue first anyway... And hi Nico! |
Can now reproduce this on our codebase with |
@leighman can you create a reproducer in a new repo? |
Can have another go. I have tried in the past and not been able to. I think it has to do with the number of (non-namespaced) files. |
Right, but if you can reproduce on a single thread it implies an order-of-operations issue that should be reproducible. Another alternative would be to give me temporary access to the repo, but I could understand how that might be complicated. |
I am also getting this, if I run it normally, I get an error about storage and undefined index If i run with --debug-by-line it never finishes Stack trace below: vendor/bin/psalm 16:05:09
Obviously redacted the directories and the namespace and class name are changed Any ideas? |
@muglug I've created a repo with which you can reproduce the issue. In my case it happens with Laminas InputFilter library. Here's the repo: https://github.com/jgwong/psalm-issue-2316-repro |
@jgwong that was a different issue, now fixed. Closing this as not reproducable |
I have the similar issue:
|
Could you please open a new issue @dwasil |
It may happen if you also have Psalm installed via composer. Run |
It was installed via Phive. Actually, it is just psalm.phar version 5.7.7 |
The text was updated successfully, but these errors were encountered: