Closed Techcable closed 1 year ago
Based on the stack trace, it seems like the root of the problem is com.tang.intellij.lua.ty.Ty.<clinit>()
at Ty.kt:198
:
I strongly suspect this triggers a dependency cycle in class initialization. If this is the case, consider using Kotlin's lazy properties.
I see Ty.<clinit>
in the thread dumps of #459 , #482 . I suspect they have the same cause.
Possibly the cause of #429 , but the pastebin of the thread dump expired so I cannot tell.
can you make a pr fix this?
Yes. I am working on it right now 😄 It looks like the issue is simple to fix!
If you look in stack you will also see
waiting on the Class initialization monitor for com.tang.intellij.lua.ty.TyClass
This is closed by #511
Environment(环境)
What are the steps to reproduce this issue?(重现步骤?)
What happens?(出现什么问题?)
The entire application freezes.
YourKit detects a deadlock in EmmyLua I've pasted below.
Disabling EmmyLua fixes the issue.
What were you expecting to happen?(期望?)
I can have EmmyLua enabled, and the application should still work.
Any logs, error output, etc?(有没有什么log, error输出?)
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
https://gist.github.com/Techcable/bd377d5688b771a16b47dde23d9da132
Any other comments?(其它说明)
Similar to some other issues. However, I am not sure its the same. Deadlocks can be very difficult to debug, so I thought I'd post the information YourKit identified.
It looks like the
Ty
class can't even finish running its class initializer<clinit>
(link). This is caused by a deadlock in thestatic
fields or astatic { }
block.If the class initializer of
Ty
can't finish, nothing else in theTy
class can run!