Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWT crashes with Seg fault at Java_org_eclipse_swt_internal_gtk_OS_G_1OBJECT_1TYPE on Linux #1367

Open
Kummallinen opened this issue Jul 25, 2024 · 0 comments

Comments

@Kummallinen
Copy link

Kummallinen commented Jul 25, 2024

Describe the bug
When closing some UI elements Eclipse will crash with a segmentation fault at Java_org_eclipse_swt_internal_gtk_OS_G_1OBJECT_1TYPE

This appears to be an old bug, previously reported by others on BugZilla but I have now seen it on Eclipse 4.32. Bugzilla link: https://bugs.eclipse.org/bugs/show_bug.cgi?id=573208

Not my log but the referenced frames and lines are identical.

 A fatal error has been detected by the Java Runtime Environment:

  SIGSEGV (0xb) at pc=0x00007f111ea2efb4, pid=28748, tid=28766

 JRE version: OpenJDK Runtime Environment (15.0.2+7) (build 15.0.2+7)
 Java VM: OpenJDK 64-Bit Server VM (15.0.2+7, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
 Problematic frame:
 C  [libswt-pi3-gtk-4944r20.so+0x4dfb4]  Java_org_eclipse_swt_internal_gtk_OS_G_1OBJECT_1TYPE+0x0

j  org.eclipse.swt.accessibility.Accessible.<init>(Lorg/eclipse/swt/widgets/Control;)V+13
j  org.eclipse.swt.accessibility.Accessible.internal_new_Accessible(Lorg/eclipse/swt/widgets/Control;)Lorg/eclipse/swt/accessibility/Accessible;+5
j  org.eclipse.swt.widgets.Control._getAccessible()Lorg/eclipse/swt/accessibility/Accessible;+9
j  org.eclipse.swt.widgets.Control.removeRelation()V+25
j  org.eclipse.swt.widgets.Control.release(Z)V+89
j  org.eclipse.swt.widgets.Widget.dispose()V+23

Looks like there is some condition which allows "labelRelation" to be not null while the "accessible" field on the Control is null, which looks like it shouldn't be able to happen. Combined with "_getAccessible" instantiating a new Accessible if the field is null this causes a dispose call to try to create an Accessible on the partially disposed control.

I've not yet been able to locate a code path that could cause this state.

To Reproduce
I don't yet have a simple snippet that that reproduce it yet. However any UI element which causes the crash does so consistently.

Expected behavior
Should not crash

Screenshots
Not applicable

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • [X ] Linux
  1. Additional OS info (e.g. OS version, Linux Desktop, etc)
    Ubuntu 20.04 & 22.04

  2. JRE/JDK version
    21

Version since
At least 4.19

Workaround (or) Additional context
This commit fixes avoids the crash but doesn't address the underlying issue causing Control to get into that state. I'm also not familiar enough with SWT & GTKs internals to know if this could cause any issues: Kummallinen@149be2b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant