Hannah-Sten / TeXiFy-IDEA

LaTeX support for the IntelliJ platform by JetBrains.
https://hannah-sten.github.io/TeXiFy-IDEA
MIT License
891 stars 87 forks source link

PyCharm hangs #1078

Closed NagabhushanSN95 closed 4 years ago

NagabhushanSN95 commented 4 years ago

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

PyCharm

TeXiFy IDEA version

0.6.6

What I did (steps to reproduce)

Compile the tex file

Expected behavior

Actual behavior

PyCharm hangs. Need to kill the process and start it again.

(if applicable) The full stacktrace of the exception thrown

Since yesterday night, whenever I open a tex file, CPU usage reaches 80% or so (8 cores). None of the warnings or autocompletion works. If I try to compile the file, PyCharm hangs. I have no idea how this suddenly started happening. I had encountered a similar problem before when I was using an alpha version. I removed the alpha version and installed stable version of TeXiFy and my problem was solved. But now, I'm facing the same problem with stable version of TeXiFy.

Is this a known issue? Anything I can do to fix this? I badly need this to work :)

PHPirates commented 4 years ago

I recall I managed to hang PyCharm as well. Which would mean that it would be solved in the latest alpha version. Can you try installing the latest alpha version?

[Edit] Maybe the thing I recalled was actually #1030, although this should be triggered by you typing, not just opening a tex file. It would result in a hanging PyCharm though, so you can at least make sure you don't have texdoc installed.

NagabhushanSN95 commented 4 years ago

Thanks.

  1. Tried latest alpha version. Still same problem.
  2. I don't have texdoc.
PHPirates commented 4 years ago

Hm, then without using a profiler I have no idea where it would be hanging. Does it happen with also a new empty tex file?

NagabhushanSN95 commented 4 years ago

Okay. I'll try that and revert back to you.

NagabhushanSN95 commented 4 years ago

Hi, sorry for the delay. I ran the profiler and I've attached the data. Had to rename the extension from nps to txt to upload here. Is this fine? (Also please let me know if it has any sensitive data :P that I should remove before uploading. This is the first time I'm doing this.) TeXiFyProfileData.txt

I also tried with a completely empty tex file. The moment I press ctrl+shift+F10, PyCharm hangs.

PHPirates commented 4 years ago

@NagabhushanSN95 Thanks! I can see now where it is hanging, but I don't know why yet. As far as I know there's not really sensitive data involved, especially if you filter on the nl.hannahsten.** package, but never viewed a dump of an other system before so don't know for sure.

NagabhushanSN95 commented 4 years ago
  1. I'm not using on Mac. I'm using Ubuntu 18.04
  2. I tried with minimal tex file in new project. PyCharm hung again. After 5 or 10 mins, it completed and the PDF opened. In the meantime, it took almost 80% of CPU.
  3. I installed v0.6.6. Same problem. Here is the dump: NagabhushanPycharmDump.txt
  4. Trying to install IntelliJ. For some reason, download speed to very low. Do you think it is necessary?
PHPirates commented 4 years ago

Are you sure you are not using a Mac? :smile:

This is the code:

if (SystemInfo.isMac) {
    doStuff
}

The dump shows that your PyCharm is hanging on doStuff, unless I am very much mistaken. I would say this is somewhat impossible. You can try to verify this:

  1. Removed that part of the code completely in this 0.6.6-1078.2: TeXiFy-IDEA-0.6.6-1078.2.zip
  2. Removed even more code in 0.6.6-1078.3, which means it will not create out dirs: TeXiFy-IDEA-0.6.6-1078.3.zip. If this still has the problem, another dump (sorry) would be very useful because if it hangs it can at least not be in the same code.
  3. Strange, though if you have a lower than 5 mbit connection it can take a while, but given that all else fails so far I think it is worth trying.

I don't know what is happening on your system but it is very weird.

  1. Did you try uninstalling other plugins?
  2. You have PyCharm 2019.2.4 right?
NagabhushanSN95 commented 4 years ago
  1. Still the problem persists.
  2. Problem persists. I also noticed that, as soon as I open tex file, CPU usage shoots up. I've attached profile for both (during compilation and when just open). Would this help? Nagabhushan_1078_3_TexCompile.txt Nagabhushan_1078_4_TexOpen.txt
  3. Tried IntelliJ CE. Worked!!! Crazy! Used 0.6.6-1078.3 version. Do you think uninstalling PyCharm and installing it would help? (Though it won't help you debug the actual issue)
  4. The other downloaded plugins I have are .ignore, ini, Markdown, Matlab Support. I disabled all of them. No luck!
  5. Yes.
PHPirates commented 4 years ago
  1. Thanks, what is interesting is that in those logs I can not find TeXiFy anymore. May be me, but looks like PyCharm has confused itself, for some reason it is triggered in a way by TeXiFy which I can't find back.
  2. That's something. I don't know, but you should try to reinstall PyCharm definitely. If that doesn't help, you can even try installing an EAP build like 2019.2.5 or 2019.3 - who knows it may fix something.

If that still doesn't help, I don't know anything else so you will have to stick with IntelliJ :)

NagabhushanSN95 commented 4 years ago

Reinstalling PyCharm fixed the issue in many projects. But in one project, I still face the issue. May be because the project is huge and contains a lot of code (python, matlab) and other resources (txt, csv, mp4 files).