eclipse.platform.swt
eclipse.platform.swt copied to clipboard
Eclipse IDE 2022-06 SIGSEGV crash during Java code editing
I have recently reinstalled Eclipse IDE 2022-06 from scratch but am struggling with constant crashes (least 4 times in the past half hour) while editing Java code.
Attached is a pid log which indicates a SIGSEGV in the JRE is at fault. I have no idea how to further analyze this so providing this in the hope it is useful (and that someone can point out something in my setup that might be to blame).
Local environment:
- Ubuntu Linux 22.04.01 LTS (x86_64), kernel release 5.15.0-1016-oracle
- OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)
- Desktop environment Gnome 42.2
For what it's worth the crash seems to be related to the trying to do a copy-paste (using Ctrl-V) from outside Eclipse into the Java editor. It doesn't consistently happen, but it does seem to happen often when I'm copy-pasting something.
I have seen a number of such reports but never managed to reproduce myself. If you can come up with reliable reproducer that would be key part in fixing this issue.
I'm not sure I can easily construct a minimal reproducer, but here's what I've done:
- fresh install of Eclipse for Java developers 2022-06 - using preinstalled Java environment (OpenJDK 18.0.2)
- added MoreUnit plugin
- imported new Java maven project from local git repo (project I've checked out is https://github.com/eclipse/rdf4j)
- start editing Java code.
- IDE crashes with SIGSEGV at unpredictable times during code editing, though appears to happen more frequently when using copy-paste from outside Eclipse itself (e.g. copying from a Github example) into an editor. Observed behavior is that the editor freezes (the pasted code does not show at any point) for a few seconds and then the entire IDE just crashes and an pid log (as attached) is dumped in my homedir.
I can try a few variations (e.g. different Java runtime) to see if that makes a difference, but hard to know what to focus on.
Java runtimes switch shouldn't make a difference. Is MoreUnit needed to reproduce?
Java runtimes switch shouldn't make a difference. Is MoreUnit needed to reproduce?
Hard to know I'm afraid. As we speak I've tried reproducing the problem again (with MoreUnit still active) but of course right now I'm not getting any crashes. I will give it a few more tries and post my findings here when I have something.
that might be to blame
From the PID file the crash happens at:
C [libcairo.so.2+0x643c4] cairo_region_num_rectangles+0x4
while
org.eclipse.swt.internal.gtk3.GTK3.gtk_main_do_event(J)V (0 bytes)
so this could be an SWT issue, or a libcairo issue, given that all pid files are indicating the same problem, can you give exact versions of libcairo / os you are using?
If you can come up with reliable reproducer that would be key part in fixing this issue.
I always wondered what pid files are good for if the give not at least an indication for the native programmer where to start looking? Are there no tools to decode this into some kind of "stacktrace" so one can see where the problem happens and then look around there if maybe an illegal argument and/or null reference might occur? SIGSEGV seem to indicate that some illegal pointer access is causing the problem.
so this could be an SWT issue, or a libcairo issue, given that all pid files are indicating the same problem, can you give exact versions of libcairo / os you are using?
Sure:
❯ sudo apt list --installed | grep libcairo
libcairo-gobject-perl/jammy,now 1.005-3build1 amd64 [installed,automatic]
libcairo-gobject2/jammy,now 1.16.0-5ubuntu2 amd64 [installed,automatic]
libcairo-perl/jammy,now 1.109-2build1 amd64 [installed,automatic]
libcairo-script-interpreter2/jammy,now 1.16.0-5ubuntu2 amd64 [installed,automatic]
libcairo2-dev/jammy,now 1.16.0-5ubuntu2 amd64 [installed,automatic]
libcairo2/jammy,now 1.16.0-5ubuntu2 amd64 [installed,automatic]
libcairo2/jammy,now 1.16.0-5ubuntu2 i386 [installed,automatic]
libcairomm-1.0-1v5/jammy,now 1.12.2-4build3 amd64 [installed,automatic]
❯ uname -a
Linux gromit 5.15.0-1016-oracle eclipse-platform/.github#20-Ubuntu SMP Mon Aug 8 07:02:52 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
❯lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 12228 org.eclipse.swt.internal.gtk3.GTK3.gtk_main_do_event(J)V (0 bytes) @ 0x00007f9bdd4245e9 [0x00007f9bdd4245a0+0x0000000000000049]
J 27145 c2 org.eclipse.swt.widgets.Display.eventProc(JJ)J (212 bytes) @ 0x00007f9bdda8e434 [0x00007f9bdda8e380+0x00000000000000b4]
v ~StubRoutines::call_stub
J 12229 org.eclipse.swt.internal.gtk3.GTK3.gtk_main_iteration_do(Z)Z (0 bytes) @ 0x00007f9bdd424969 [0x00007f9bdd424920+0x0000000000000049]
J 57845 c2 org.eclipse.swt.widgets.Display.readAndDispatch()Z (88 bytes) @ 0x00007f9be00acca0 [0x00007f9be00acbc0+0x00000000000000e0]
J 48714% c2 org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run()V (690 bytes) @ 0x00007f9bdf779504 [0x00007f9bdf779360+0x00000000000001a4]
j org.eclipse.core.databinding.observable.Realm.runWithDefault(Lorg/eclipse/core/databinding/observable/Realm;Ljava/lang/Runnable;)V+12
Stacktrace show SWT => moving to SWT, but probably its GTK
Crashes happened to me too all the time until I switched my Ubuntu from Wayland to x.org. IIRC my report was closed as "error in the library"
From the crash log attached above:
Stack: [0x00007f9bf342f000,0x00007f9bf352f000], sp=0x00007f9bf352c218, free space=1012k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libcairo.so.2+0x643c4] cairo_region_num_rectangles+0x4
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 12228 org.eclipse.swt.internal.gtk3.GTK3.gtk_main_do_event(J)V (0 bytes) @ 0x00007f9bdd4245e9 [0x00007f9bdd4245a0+0x0000000000000049]
J 27145 c2 org.eclipse.swt.widgets.Display.eventProc(JJ)J (212 bytes) @ 0x00007f9bdda8e434 [0x00007f9bdda8e380+0x00000000000000b4]
v ~StubRoutines::call_stub
J 12229 org.eclipse.swt.internal.gtk3.GTK3.gtk_main_iteration_do(Z)Z (0 bytes) @ 0x00007f9bdd424969 [0x00007f9bdd424920+0x0000000000000049]
J 57845 c2 org.eclipse.swt.widgets.Display.readAndDispatch()Z (88 bytes) @ 0x00007f9be00acca0 [0x00007f9be00acbc0+0x00000000000000e0]
J 48714% c2 org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run()V (690 bytes) @ 0x00007f9bdf779504 [0x00007f9bdf779360+0x00000000000001a4]
j org.eclipse.core.databinding.observable.Realm.runWithDefault(Lorg/eclipse/core/databinding/observable/Realm;Ljava/lang/Runnable;)V+12
j org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(Lorg/eclipse/e4/ui/model/application/MApplicationElement;Lorg/eclipse/e4/core/contexts/IEclipseContext;)Ljava/lang/Object;+57
j org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(Lorg/eclipse/e4/ui/model/application/MApplicationElement;)V+20
j org.eclipse.ui.internal.Workbench.lambda$3(Lorg/eclipse/swt/widgets/Display;Lorg/eclipse/ui/application/WorkbenchAdvisor;[I)V+393
j org.eclipse.ui.internal.Workbench$$Lambda$198+0x0000000800f244b0.run()V+12
j org.eclipse.core.databinding.observable.Realm.runWithDefault(Lorg/eclipse/core/databinding/observable/Realm;Ljava/lang/Runnable;)V+12
j org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Lorg/eclipse/swt/widgets/Display;Lorg/eclipse/ui/application/WorkbenchAdvisor;)I+16
j org.eclipse.ui.PlatformUI.createAndRunWorkbench(Lorg/eclipse/swt/widgets/Display;Lorg/eclipse/ui/application/WorkbenchAdvisor;)I+2
j org.eclipse.ui.internal.ide.application.IDEApplication.start(Lorg/eclipse/equinox/app/IApplicationContext;)Ljava/lang/Object;+113
j org.eclipse.equinox.internal.app.EclipseAppHandle.run(Ljava/lang/Object;)Ljava/lang/Object;+138
j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Ljava/lang/Object;)Ljava/lang/Object;+85
j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ljava/lang/Object;)Ljava/lang/Object;+79
j org.eclipse.core.runtime.adaptor.EclipseStarter.run(Ljava/lang/Object;)Ljava/lang/Object;+99
j org.eclipse.core.runtime.adaptor.EclipseStarter.run([Ljava/lang/String;Ljava/lang/Runnable;)Ljava/lang/Object;+132
j java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+11 [email protected]
j java.lang.invoke.LambdaForm$MH+0x0000000800c07800.invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+54 [email protected]
j java.lang.invoke.LambdaForm$MH+0x0000000800c07c00.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+22 [email protected]
j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+72 [email protected]
j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 [email protected]
j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 [email protected]
j org.eclipse.equinox.launcher.Main.invokeFramework([Ljava/lang/String;[Ljava/net/URL;)V+201
j org.eclipse.equinox.launcher.Main.basicRun([Ljava/lang/String;)V+159
j org.eclipse.equinox.launcher.Main.run([Ljava/lang/String;)I+4
j org.eclipse.equinox.launcher.Main.main([Ljava/lang/String;)V+10
v ~StubRoutines::call_stub
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000004
Based on cairo_region_num_rectangles it could be related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/158 where webkit is to blame.