eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
114 stars 130 forks source link

Doing work in Eclipse Flatpak crashes it #1076

Open Monniasza opened 6 months ago

Monniasza commented 6 months ago

Describe the bug I'm unable to import any other class via the quick fix. I'm having Eclipse crash when I import a class via the quick fix. This works with any quick fix.

To Reproduce To reproduce, paste the following code in Eclipse IDE, click and hover over the JButton and import the suggested class:

public class ImportBug {
    public static JButton button;
}

Expected behavior The quick fix is applied

Environment:

  1. Select the platform(s) on which the behavior is seen:

      • [] All OS
      • [ ] Windows
      • [x] Linux
      • [ ] macOS
  2. Additional OS info (e.g. OS version, Linux Desktop, etc) https://termbin.com/kx5t Core dump: hs_err_pid25.log Console log: console log 2.txt GDB does not output anything to the core dump

  3. JRE/JDK version OpenJDK Runtime Environment Temurin-17.0.9+9 (17.0.9+9) (build 17.0.9+9)

Version since 2023-09

Workaround Apply the refactoring manually

iloveeclipse commented 6 months ago

@SyntevoAlex : probably interesting for you?

iloveeclipse commented 6 months ago

@Monniasza : please add here the SWT section from configuration info dialog that you can see opening Help -> About, like here:

image

Monniasza commented 6 months ago
*** System properties:
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
org.eclipse.swt.graphics.Resource.reportNonDisposed=true
org.eclipse.swt.internal.deviceZoom=100
org.eclipse.swt.internal.gdk.backend=x11
org.eclipse.swt.internal.gtk.theme=WhiteSur-Dark
org.eclipse.swt.internal.gtk.version=3.24.41
sun.java.command=/app/eclipse//plugins/org.eclipse.equinox.launcher_1.6.600.v20231106-1826.jar -os linux -ws gtk -arch x86_64 -showsplash /app/eclipse//plugins/org.eclipse.epp.package.common_4.30.0.20231201-1200/splash.bmp -launcher /app/eclipse/eclipse -name Eclipse --launcher.library /app/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.800.v20231003-1442/eclipse_11802.so -startup /app/eclipse//plugins/org.eclipse.equinox.launcher_1.6.600.v20231106-1826.jar --launcher.appendVmargs -exitdata 5003f -product org.eclipse.epp.package.java.product -vm /app/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_17.0.9.v20231028-0858/jre/bin/java -vmargs -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclientjava -Dosgi.requiredJavaVersion=17 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dosgi.dataAreaRequiresExplicitInit=true -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Declipse.e4.inject.javax.warning=false -Dsun.java.command=Eclipse -Xms256m -Xmx2048m -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Djava.security.manager=allow -Dosgi.configuration.area=@user.home/.var/app/org.eclipse.Java/eclipse/configuration --patch-module=java.base=/app/eclipse/flatpak-dev-shim.jar -Dsun.boot.library.path=/app/lib -jar /app/eclipse//plugins/org.eclipse.equinox.launcher_1.6.600.v20231106-1826.jar
iloveeclipse commented 6 months ago

Try to set "Adwaita" GTK theme (default one in Gnome), not "WhiteSur-Dark". There is a little chance that it might help. You can also try if https://download.eclipse.org/eclipse/downloads/drops4/S-4.31RC2-202402290520/ build works for you.

Monniasza commented 6 months ago

The issue still occurs with Adwaita.

SyntevoAlex commented 6 months ago

Relevant fragment of crash log from top post:

Host: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz, 4 cores, 15G, GNOME 45 (Flatpak runtime)
Time: Fri Mar  1 18:08:05 2024 CET elapsed time: 56.838390 seconds (0d 0h 0m 56s)

<...>

Stack: [0x00007f5fa3644000,0x00007f5fa3744000],  sp=0x00007f5fa3740bc0,  free space=1010k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libgtk-3.so.0+0x3899d6]  gtk_widget_get_allocation+0x26
C  [libgtk-3.so.0+0x441fdd]
C  [libswt-pi3-gtk-4963r5.so+0x493a4]  Java_org_eclipse_swt_internal_gtk_OS_call__JJJJJJJ+0x27
j  org.eclipse.swt.accessibility.AccessibleObject.atkComponent_get_extents(JJJJJJ)J+85
v  ~StubRoutines::call_stub
V  [libjvm.so+0x829765]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x315
V  [libjvm.so+0x8c272b]  jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, JavaThread*) [clone .constprop.1]+0x38b
V  [libjvm.so+0x8c4b55]  jni_CallStaticLongMethodV+0x205

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.eclipse.swt.internal.gtk.OS.call(JJJJJJJ)J+0
j  org.eclipse.swt.accessibility.AccessibleObject.atkComponent_get_extents(JJJJJJ)J+85
v  ~StubRoutines::call_stub
J 12236  org.eclipse.swt.internal.gtk3.GTK3.gtk_main_iteration_do(Z)Z (0 bytes) @ 0x00007f5f917ad761 [0x00007f5f917ad720+0x0000000000000041]
<...>

siginfo: si_signo: 11 (SIGSEGV), si_code: 128 (SI_KERNEL), si_addr: 0x0000000000000000
SyntevoAlex commented 6 months ago

We (at my company that is NOT eclipse) are aware of this crash. If only happens on Flatpak. The crash is rather rare according to our data.

SyntevoAlex commented 6 months ago

@Monniasza could you please explain why/how do you run Eclipse on Flatpak?

Monniasza commented 6 months ago

@SyntevoAlex I've installed it from Flathub.

SyntevoAlex commented 6 months ago

@Monniasza could you install Eclipse normally, without Flatpak, and test?

Monniasza commented 6 months ago

@SyntevoAlex This issue does not occur if I install Eclipse with installer.

SyntevoAlex commented 6 months ago

Thanks for the confirmation.

Also thanks for the repro steps. I guess I'll try to reproduce it when I have time (hopefully within a couple weeks) and if there's something to fix, try to fix it.

Monniasza commented 6 months ago

@SyntevoAlex Have you done any testing on this?

SyntevoAlex commented 6 months ago

Not yet. Unfortunately it can take weeks, or months even. Sorry. I'm not exactly any kind of maintainer here, just spending a bit of time on something sometimes.

SyntevoAlex commented 5 months ago

I was instructed to not spend time on this. sorry.