-
Notifications
You must be signed in to change notification settings - Fork 41
Eclipse nearly-consistently crashes on startup when workspace contains PMD enabled projects #148
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hi @krallus , Unfortunately I can't reproduce the problem. As you said, there is no error at all, when eclipse crashes... the log in I noticed, that you use a ubuntu flavor of java 11 for running eclipse. Can you try to use the standard eclipse from eclipse.org? Eclipse 2021-06 ships with Java 16 as runtime. How do you start eclipse? Do you start it from a terminal, so that you can see any error when it crashes? Maybe there is a jvm crash - if this is the case, then this crash won't appear in eclipse's error log but only on the console (e.g. in stderr).
This is the initialization of oomph setting up your eclipse/workspace. It starts after a while. But your crash seem to happen mostly before that. So I guess, this is unrelated. If you are interested to know, what is happening during that phase, you can have a look at the file |
[EDIT: I spoke too soon, it seems. Starting Eclipse from within a terminal can also result in a crash. I must have just been "lucky" when I tested it out earlier. I am editing this comment to reflect that fact and to avoid confusion...] I have been launching Eclipse from the shortcut in the Linux Mint Cinnamon menu. The shortcut specifies the following command:
An additional thing I will note here is that I always get the "select workspace" prompt on startup. It's only after selecting a workspace that has a PMD enabled project that the crash occurs. I have one other machine running Linux Mint. When I have some time, I'll do some testing there. I would love to know whether or not others using PMD and launching Eclipse in Cinnamon have experienced this problem. |
For the record, I tried installing Java 16 -- the Linux distro version -- and running Eclipse under that but the problem persists. I'll test out a straight up downloaded Hotspot OpenJDK 16. |
No dice with the OpenJDK 16 either. downloaded from: Here is Eclipse running in debug mode when the crash happens (that is, the crash where the window with all java arguments appears), though sadly I do not think it will be particularly helpful:
In those cases where the Eclipse window simply disappears rather than showing the window with command line arguments, the last lines are a bit different. I suspect this just a problem handling the error, however, rather than hinting at the cause:
|
Good news, I finally could reproduce the problem: It only appears if X11 + GTK3 is used - I already use wayland and there the bug doesn't seem to be a problem. To reproduce (for future reference):
Then inside the xterm, force x11 and start eclipse:
The problem appears, when PMD plugin is installed and PMD markers exist in the project. It is triggered by the RuleLabelDecorator which adds the violation icons to the project explorer view. Updating the labels is called in a separate thread which is not the UI thread, but apparently when painting off-screen images, it still needs to happen in the UI thread (at least for X11). The problem manifests in different ways: Eclipse/Java simply might crash, sometimes you see the message
sometimes not. Sometimes eclipse doesn't respond anymore (I guess a deadlock...). Sometimes it just works without a problem. It is more often reproducible, if no editor view is open - the editor view also needs the violation markers, so when the rule label decorator is executed, the violation markers might already be initialized. So, close all editors and start eclipse again. Usually it crashes then. Workaround: As this problem occurs due to the rule label decorator decorating the projects at start up: if you disable this decorator, eclipse won't crash: Window -> Preferences: General/Appearance/Label Decorations: Rule Violation Decorator . Background Info:
|
Execute org.eclipse.swt.graphics.GC call in UI thread in ShapePainter #157
When the PMD plugin is installed in Eclipse and the workspace contains a project with PMD enabled, Eclipse will crash when it starts up. Less commonly, Eclipse will freeze during startup and require a "force quit". After several attempts (in the range of 3 to 10, sometimes more), Eclipse will eventually start without crashing. I often notice "deferred early start" in the Eclipse status bar when it does start successfully. This may hint that there is a timing issue in the loading of the PMD plugin.
Important to note is that this only happens when the the projects that have PMD enabled have "Use the ruleset configured in a project file" enabled. (In my case, I have four projects that all reference the same external ruleset file). It doesn't seem to matter what the precise contents of the ruleset file are.
I know that the Eclipse crash is related to the PMD plugin because performing any one of the following will allow Eclipse to start normally:
On those attempts where Eclipse starts without crashing, everything, including the PMD plugin work completely fine and as expected.
I have attempted to resolve this by installing a fresh installation of Eclipse and using a clean new workspace, but as soon as I have a PMD enabled project that points to a custom ruleset file, this crash will start happening. I have been unsuccessful in narrowing it down further, unfortunately. I will also note here that the projects that have PMD enabled are Maven projects.
Environment:
UPDATE: I confirmed that the issue occurs for all versions of the PMD Eclipse Plugin, back to at least as far as 4.20.0.v20210130-1744 (I did not test earlier versions), when the plugin is installed to Eclipse 2021-06 (4.20.0).
A simple workspace that exhibits this problem: https://www.dropbox.com/s/hjgxkndbgccr2k3/pmd-test.tar.gz?dl=0
You may get lucky and it will open fine the first time, but after a few exits and restarts, Eclipse will crash.
The text was updated successfully, but these errors were encountered: