-
Notifications
You must be signed in to change notification settings - Fork 651
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
Docblock typedef crash #10739
Comments
@boesing would you mind providing more info here? From the backtrace it looks like it crashed while reading a docblock for a property on a class that had type aliases, and that property docblock mentioned |
@weirdan I was trying to get more details with If you have some more hidden "features" which could help me identifying the problem, I'd happy to help. |
What's the last few lines starting with Parsing|Scanning before the crash? |
I also got not helpful hint from the --debug output. All the previous files seem not be related. I can try again and with --debug-by-line next week. |
I did not try to build a reproducer because that might be very tricky with multithreading involved, but I debugged it in my project and tracked it down to a specific type in monolog. In use is It always crashes on comments handling an imported type. What I can do for psalm to successfully scan is either to remove all type imports related to
There are more classes importing this file, but I guess unrelated in my project, which is using Or I can remove these 3 comments related to the type:
With this information I stepped some more Minutes through some code, but I lack too much internal knowledge to understand the problem and find a possible fix in a reasonable time. I hope this can help. |
That's consistent with the backtrace, thanks. Can you also check if replacing references to constants with their values here: https://github.com/Seldaek/monolog/blob/437cb3628f4cf6042cc10ae97fc2b8472e48ca1f/src/Monolog/Logger.php#L30 helps with the crash? Constants and typedefs are double fun to debug. |
No, it does not help. |
Hi there! Could it be the problem? Reproduces only with multithreading (--threads=8 in my case) |
I can confirm that the commit mentioned is the one which introduced that issue. I outlined that on symfony slack some weeks ago. Same issue for me that there is almost no way of extracting a reproducer from our repository as that is kinda huge. |
Thanks for the hint about the causing commit @AtCliffUnderline if ($type_aliases !== []) {
$intersection_types = self::resolveTypeAliases(
$codebase,
$generic_params[0]->getAtomicTypes(),
);
if ($intersection_types !== []) {
$generic_params[0] = $generic_params[0]->setTypes($intersection_types);
}
} Commenting it out showed no crash anymore, but more interestingly there were zero changes done by |
@weirdan This closed as completed, but I just reproduced this on 5.23.1. Maybe reopen? |
@AtCliffUnderline there is not yet a release with this fix. |
Oh wow missed that, sorry! |
As pointing out above I had the problem already since at least 5.21.1. With your branch I see multiple catches on that introduced point and then a fallback to the reported
monolog\logger
class from 5.21.1 instead of mockery.Here is the stack trace in case this shows anything new.
Originally posted by @simonberger in #10706 (comment)
The text was updated successfully, but these errors were encountered: