PHPStorm 2016.2 performing code analysis hanging

Since upgrading to 2016.2 yesterday, the 'performing code analysis' task seems to keep hanging.

This means that often warnings / errors triggered whilst typing lines of code (i.e. errors because the line is incomplete) do not seem to disappear, unless I select the whole line, then cut + paste it again.

I've tried File.. Invalidate caches, but it doesn't seem to help.

Any suggestions?

19 comments
Comment actions Permalink
Official comment

Thanks for reporting!

Issue is fixed for next EAP!

Comment actions Permalink

Could you please restart PhpStorm, wait until the issue reoccurs and send us (upload somewhere) idea.log file (Help > Show log in...)? 

Any symlinks in a project?

0
Comment actions Permalink

There aren't any symlinks in the project that I am aware of (Moodle is a big project, so there could be one hidden somewhere, but it's unlikely).

Here's a zip file of the logs - https://dl.dropboxusercontent.com/u/933969/idea.log.zip

As requested, I closed PHPStorm, re-opened it, re-typed a line of code that had shown the problem outlined above (as before, it seemed to be stuck with the 'missing parameter' errors generated whilst I was typing the line), then closed PHPStorm and zipped up the log files.

 

 

0
Comment actions Permalink

Could you please:

1) try to disable all custom pluings, restart PhpStorm and test the same?

2) download & install EAP build and test it again: https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program ?

This looks like an issue caused by .phpstorm.meta.php file inside a project. Here's corresponding issue report but it's not yet addressed unfortunately: https://youtrack.jetbrains.com/issue/WI-28975

0
Comment actions Permalink

I've tried without custom plugins + tried with the latest EAP build.

Neither made any difference, that I could see.

Confirmed that switching back to 2016.1 seems to work around the problem.

0
Avatar
Vladimir Luchansky
Comment actions Permalink

Hello,

Did you try to File > Invalidate Caches/Restart > Invalidate and Restart?

0
Comment actions Permalink

Sorry for the very slow reply - I've been away from work for the last week or so.

As stated in the original post: "I've tried File.. Invalidate caches, but it doesn't seem to help."

 

0
Comment actions Permalink

Sorry for asking things from you over and over, but the archive you've sent to us doesn't have any useful information because the logs are filled with the 'too much type variants' message due to a logging issue that has been fixed already.
Even though it's completely our fault, I have to ask you to install 2016.2.1, reproduce the issue and collect the logs again. Could you please do so?

Thank you. Hope that something relevant to your issue comes up there.

0
Comment actions Permalink

The problem has been a bit intermittent since my last post - but that appears to be related to the bits of the PHP code I've been working with (it seems to cope better in files that just have a single class in them, rather than files that directly contain code).

I've managed to cleanly reproduce the problem and the log file is here:

https://dl.dropboxusercontent.com/u/933969/idea.log

I opened up PHPStorm. Introduced a deliberate error into the file ($keys[] = '; - missing the closing quote, breaking the code later in the file), then I fixed the error (by adding the missing quote). The file parsing then hung and did not correct the error status for the rest of the file, until I closed PHPStorm and opened it up again.

The log file does not include me reopening PHPStorm - it ends at the point where I closed it.

 

0
Comment actions Permalink

Is there a chance to share the file causing this with us? You can do this privately if needed (email/support request).

0
Comment actions Permalink

The code is open-source (Moodle) and I've managed to reproduce using only publicly available code (Moodle + one of my plugins, could probably have done with just the Moodle code).

The code (+ latest PHPStorm logs) can be downloaded here: (including the .git & .idea directories)

https://we.tl/FtFHm7KKrv

The steps I took to reproduce the problem are:

  • Opened PHP Storm
  • Opened blocks/objectives/lib.php
  • Waited for the initial code analysis to complete.
  • On line 183 (just as an example), I changed:
    ... $SESSION->objective_group ...
    to
    ... $SESS-ION->objective_group ...
  • Which immediately caused an error to appear on the line.
  • I then deleted the unwanted character - the code analyis then failed to complete and the line contains the errors 'Undefined constant ION' and 'Undefined constanct objective_group'.
  • Closing + reopening PHPStorm makes the error go away (until I cause another error in the file).

For reference, I'm running PHPStorm 2016.2.1, Debian Squeeze (was Jessie until a couple of days ago) + KDE.

Thanks

-1
Comment actions Permalink

Thanks for the great example.

I've tried the same and got the same result, but:

after you fix `$SESS-ION->objective_group ...` the analysis is still not complete:

note the "eye" sign in the upper right corner.

I had to wait for ~20 sec until analysis finished.

I believe the main issue here is that you have the whole framework included in a project as project files. I would suggest to mark the directories that you're not going to change as excluded and then add them in "Include path" section at File | Settings | Languages & Frameworks | PHP. 

This way you'll be able to use code completion provided by framework and reduce IDE busyness.

In the end it's 570 MB of code that IDE should be aware of anytime you type.

0
Comment actions Permalink

Thanks for the update, a few points:

  • I was aware of the eye icon and I've given it a very long time to complete (2+ minutes on a high-spec computer) without any success - once it gets 'stuck', the only way I've found to get the analysis complete is to reopen the application
  • With PHPStorm 2016.1.1 the analysis is completing in a second or so (with exactly the same code + above scenario)
  • I can't guarantee which sections of the code I will and won't be working on - various customer requirements involve making alterations to core code (even though discouraged) - even just writing plugins can involve adding them in any one of 20+ locations within the code base; it would also be quite an overhead to be configuring this for each project I work on (there are over 200 different repos checked out to my dev directory at this moment - not all of them in active use!)
  • I can, however, confirm that excluding lots of directories + adding back via 'include path' does get the analysis working again.
  • I've also tried setting the memory usage to a maximum of 2g (it was 750m), but that hasn't helped
0
Comment actions Permalink

For the moment, my solution is to switch back to PHPStorm 2016.1.1, which seems able to complete code analysis within a second or two (at most). This is a pity, as there are a few other new bits in 2016.2 that I'd like to be able to use (but none as mission-critical as the code analysis).

I'm hoping that future releases will be able to restore the performance of 2016.1 and I will keep an eye on those releases.

0
Comment actions Permalink

Davo, could you please try fresh EAP build?

0
Comment actions Permalink

Just given it a try - more-or-less the same result, but with additional popups to tell me that an exception has occurred.

I've clicked on the 'submit' button for the 4 exception messages I've seen (they looked to be different from each other) and included a link to this discussion in the 'steps to reproduce' section.

 

0
Comment actions Permalink

Thanks again for giving us the sample, that's an issue indeed - for me code analysis never ends on an edit, and there are exceptions in the log.
I have created an issue, please follow: https://youtrack.jetbrains.com/issue/WI-33584
(The project and other details are stored in a private comment to avoid exposing your sensitive data)

0
Comment actions Permalink

Eugene - thanks for adding the issue.

Please note that the example code to reproduce this is 100% open source and publically available ( https://github.com/moodle/moodlehttps://github.com/davosmith/moodle-objectives ), so please don't worry about keeping anything private in the ticket.

 

0
Comment actions Permalink

Thanks for the update - I'll look forward to trying the next EAP 

0

Please sign in to leave a comment.