eclipse-platform / eclipse.platform.ui

Eclipse Platform
https://projects.eclipse.org/projects/eclipse.platform
Eclipse Public License 2.0
80 stars 177 forks source link

ECLIPSE Deadlocks when CLOSING (!) an editor when some 10 editors are open. #1079

Closed Sciuriware closed 1 year ago

Sciuriware commented 1 year ago

This issue was introduced in version 4.28 (never seen it before). Situation: 10 or more editors are open, I close one or two and get a busy cursor. The only thing to do is kill it: unsaved text lost. (some text could be saved by making a screen shot before killing; there is no other way). Restart goes without problem, more editors can be closed without deadlock.

Current version: 4.28, Language JAVA 20.02, OS=MacOS 11.7.9 (BigSur). ;JOOP!

iloveeclipse commented 1 year ago

Please attach jstack from the deadlock, and exact steps to reproduce.

Sciuriware commented 1 year ago

Please tell me: what is jstack and where to find it.

New info: I just had a deadlock when closing the last of only 6 editors. I had not been editing, only viewing. ;JOOP!

merks commented 1 year ago

You can Google "what is jstack". You'll find it in the same folder where the java executable is located, i.e., in the JDK's bin folder.

This article might help:

https://www.baeldung.com/java-thread-dump

Sciuriware commented 1 year ago

Sorry, I never had to use jstack in 22 years, so I did not know it. Well, I upgraded Eclipse to 4.29RC2a to be sure pending problems were mended, then I opened 20 sources, edited some, started closing those editors. When closing number 14 (leaving 13 editors open) Eclipse deadlocked. Attached the Activity Monitor output revealing more than one CPU core involved and the jstack dump. ;JOOP!

ActivityMonitorOutput

JstackOutput.txt

iloveeclipse commented 1 year ago

Looking on jstack I assume this could be Mac specific SWT issue related to the focus handling, but might be also related to some e4 context switch issues, I see org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:670) many timmes on stack.

Sciuriware commented 1 year ago

It happened again with the latest release (4.29) and this time it was AFTER saving (lucky me) all editors and closing some. So, not the same situation: I started with 10 sources open and it deadlocked (beachbal) after closing number 7. ;JOOP!

laeubi commented 1 year ago

Closing many editors fells also slow on Linux ... for me it seems as if it is not a batch operation (what should be fast) but happens that one editor is closed, now the next gets focus, what triggers some actions (e.g. update views that listen for a selection change like Outline View), then closes the next, another gets focus and so on...

Sciuriware commented 1 year ago

If only there was some indication WHERE it loops ... ;JOOP!

laeubi commented 1 year ago

Usually you can try to sample multiple JStacks at different times, then compare them to see if there is some progress/change (infinite loop) or if it always is the same (deadlock).

Sciuriware commented 1 year ago

Until now I did not seem to have this problem with 4.30M1. But I will continue testing. ;JOOP!

Sciuriware commented 1 year ago

It happened again with 4.30M1. Continued ... ;JOOP!

Sciuriware commented 1 year ago

Today the lock and beach ball happened with only 8 editors open and not by closing one but by addressing a hidden one. With 'hidden' I mean the little drop down list of editors when their tabs do not fit on the pane header. ;JOOP!

vogella commented 1 year ago

can you run jstack on the frozen Eclipse and post the stack traces here?

Sciuriware commented 1 year ago

I had Eclipse already killed (Forced!); I will send jstacks of all future lock-downs. Surely they will occur. ;JOOP!

Sciuriware commented 1 year ago

With 13 (!) editors open (1 hidden) when opening the hidden editor ... ;JOOP! jstack.txt

iloveeclipse commented 1 year ago

Same stack as before.

Sciuriware commented 1 year ago

On the contrary: I compared and found 115 differences. Continued ... ;JOOP!

szarnekow commented 1 year ago

Does the slowness reproduce if you disable the Java Breadcrump view?

Sciuriware commented 1 year ago

Slowness? It remains in lock down for a long time (I didn't wait for hours ... ); I gave it a Force Quit on the Dock. Do you think that Eclipse won't lock when the breadcrumb is disabled? We'll try. ;JOOP!

Sciuriware commented 1 year ago

I tested intensively on 2 machines, INTEL and SILICON, both with Breadcrumb disabled ... no lock down yet. Continued ... ;JOOP!

Sciuriware commented 1 year ago

I overloaded Eclipse several times with editors but since I disabled Breadcrumb no lockdowns occurred. I'm surprised that this would solve the case. Anyway, I think I can live without the crumbs. ;JOOP!

szarnekow commented 1 year ago

Thank you for reporting back. This ticket can be moved to jdt.ui by someone who has the necessary rights.

mickaelistria commented 1 year ago

@szarnekow Unfortunately, I don't think it's a matter of rights, but more that it's not possible to move an issue between 2 different repositories if they are from different organizations. @Sciuriware Please open a ticket to JDT UI mentioning that this issue happens with the breadcrumbs enabled in the Java editor only

Sciuriware commented 1 year ago

DONE: https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/860 Thanks to all of you for contributing. ;JOOP!