Skip to content
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

Luanalysis freeezes CLion #42

Closed
mcondarelli opened this issue Jan 26, 2021 · 7 comments
Closed

Luanalysis freeezes CLion #42

mcondarelli opened this issue Jan 26, 2021 · 7 comments

Comments

@mcondarelli
Copy link

Environment

name version
IDEA version CL2020.3
Luanalysis version v1.2.2-IDEA203
OS Linux Mint 20.1 "Ulyssa"

CLion completely freezes shortly after startup.
Please see: https://intellij-support.jetbrains.com/hc/en-us/requests/3094347
I "solved" the issue disabling Luanalysis plugin.
What should I do?

TiA!
Mauro

@Benjamin-Dobell
Copy link
Owner

I'm unable to access that link. Could you please provide some details? Like, a lot more details 😉

@mcondarelli
Copy link
Author

Sorry,apparently JetBrains people removed my YouTrack Request.

There have been a few comments there.
Essentially my CLion invariably freezed hard (I had to hard kill "-9" the java machine) a few seconds after startup.

JetBrains people told me logs showed Luanalysis was in tight loop.
I was fast enough to manage disabling Luanalysis before lock and, at next start, everything was OK.

I attach the same logs I sent to Jetbrains
log.tar.gz

I am available for further tests, if needed.

Thanks in Advance
Mauro

@Benjamin-Dobell
Copy link
Owner

Benjamin-Dobell commented Jan 27, 2021

Just had a very quick look at those logs and I don't see any evidence of a tight loop. However, there is this blocking a thread:

com.tang.intellij.lua.ty.Ty.<clinit>(Ty.kt:673)

I actually ran into this at one stage in the past, after upgrading IntelliJ version. I've not done enough research to claim with any degree of certainty, however it does look a lot like a bug in the JBR (Jetbrains' Java Runtime), or possibly the Kotlin compiler.

The line in question is this:

https://github.com/Benjamin-Dobell/IntelliJ-Luanalysis/blob/v1.2.2/src/main/java/com/tang/intellij/lua/ty/Ty.kt#L673

It's running the Ty static initializer, and looks as though it's about to run the static initializer for TyPrimitiveClass, but instead it just hangs indefinitely. Presumably the other threads also go to access Ty (or TyPrimitiveClass) but must block until the static initializers complete (never).

clinit just shouldn't be allowed to hang indefinitely like that. It's quite likely there's something about Luanalysis' codebase that is causing the situation to arise - possibly cyclical static initializer logic. However, the Kotlin compiler should prevent this situation.

I'm of the opinion there's a bug in something Jetbrains, either the JBR or the Kotlin compiler. However, that's not to say there isn't also something wrong with Luanalysis (e.g. something cyclical).

I can't reproduce this (at the moment) in order to debug, but I'll have a think about the static initializers and see if I can identify any problem areas.

@Benjamin-Dobell
Copy link
Owner

So, I was able to reproduce the problem. Actually running Luanalysis tests, not an interactive IDE instance.

I've refactored a bit to mitigate the issue, and I can no longer reproduce the problem.

I can certainly see why static initialization was (and still is) rather complicated for the runtime. However my current understanding is that what was already there should have been working fine.

@mcondarelli
Copy link
Author

Should I wait for next Luanalysis update or should I try re-enabling it now?

@Benjamin-Dobell
Copy link
Owner

You can wait for the next release, build master, or use the attached build:
IntelliJ-Luanalysis-5018fdb14e170ccfcdaa1359a4db2e662a8dbd27.zip

I should probably add that whilst 5018fdb14e170ccfcdaa1359a4db2e662a8dbd27 is passing all tests, I tend to do a bunch of manual testing before each release, and I've not yet done that. Still, it's pretty hard to be worse than locking up your IDE on start-up.

@Arakade
Copy link

Arakade commented Feb 12, 2021

Per your message on Discord, I've installed this temp fix. Certainly seems (a) not to crash Rider and (b) not to produce regular stack-overflow errors so that's great :) Is there a way to be notified when it becomes the 'live' JetBrains plugins version (so I know to switch over)? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants