Bug 572196 - [Linux] segfault when trying to see secure storage
Summary: [Linux] segfault when trying to see secure storage
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Security (show other bugs)
Version: 4.19   Edit
Hardware: PC Linux
: P3 critical with 2 votes (vote)
Target Milestone: 4.20 M1   Edit
Assignee: Jeff Johnston CLA
QA Contact: Jeff Johnston CLA
URL:
Whiteboard:
Keywords: regression
: 572198 572217 572545 572701 573763 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-22 13:44 EDT by Antonio Petrelli CLA
Modified: 2021-06-26 06:11 EDT (History)
12 users (show)

See Also:


Attachments
Error report made by Java (207.53 KB, text/x-log)
2021-03-22 13:44 EDT, Antonio Petrelli CLA
no flags Details
Updated Eclipse Security for Linux (4.66 MB, application/zip)
2021-03-30 15:09 EDT, Jeff Johnston CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Petrelli CLA 2021-03-22 13:44:32 EDT
Created attachment 285915 [details]
Error report made by Java

OS: Kubuntu 20.10 Groovy Gorilla

Newly unpacked Eclipse 2021-03, tried internal OpenJDK 15, the one provided by Ubuntu and even OpenJDK 11
When trying to open the following menu:
Window - Preferences - General - Security - Secure Storage
there is a segmentation fault.

This is what I see in the console:

(Eclipse:31798): GLib-GIO-CRITICAL **: 18:35:12.983: g_dbus_proxy_get_object_path: assertion 'G_IS_DBUS_PROXY (proxy)' failed
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f5c096d6764, pid=31798, tid=31799
#
# JRE version: OpenJDK Runtime Environment (15.0.2+7) (build 15.0.2+7-27)
# Java VM: OpenJDK 64-Bit Server VM (15.0.2+7-27, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libglib-2.0.so.0+0x41764]  g_str_hash+0x4
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/antonio/javadev/ide/eclipse-202103/core.31798)
#
# An error report file with more information is saved as:
# /home/antonio/javadev/ide/eclipse-202103/hs_err_pid31798.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#


I attached the error report.
Comment 1 Andrey Loskutov CLA 2021-03-22 13:55:16 EDT
Can you please keep the core dump?
Run following:

gdb /home/antonio/javadev/ide/eclipse-202103/core.31798

and enter "bt" - that should show the backtrace. Please attach it here.
Comment 2 Andrey Loskutov CLA 2021-03-22 13:58:05 EDT
Moving to equinox:

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.sun.jna.Native.invokeInt(Lcom/sun/jna/Function;JI[Ljava/lang/Object;)I+0
j  com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;ZI)Ljava/lang/Object;+211
j  com.sun.jna.Function.invoke(Ljava/lang/reflect/Method;[Ljava/lang/Class;Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+271
j  com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344
j  org.eclipse.equinox.internal.security.linux.$Proxy24.secret_service_unlock_sync(Lcom/sun/jna/Pointer;Lorg/eclipse/equinox/internal/security/linux/GList;Lcom/sun/jna/Pointer;Lcom/sun/jna/ptr/PointerByReference;Lcom/sun/jna/ptr/PointerByReference;)I+34
j  org.eclipse.equinox.internal.security.linux.LinuxPasswordProvider.unlockSecretService()V+378
j  org.eclipse.equinox.internal.security.linux.LinuxPasswordProvider.canUnlock()Z+1
j  org.eclipse.equinox.internal.security.linux.LinuxPasswordProvider.isValid()Z+1
j  org.eclipse.equinox.internal.security.storage.PasswordProviderSelector.findAvailableModules(Ljava/lang/String;)Ljava/util/List;+331
j  org.eclipse.equinox.internal.security.storage.friends.InternalExchangeUtils.passwordProvidersFind()Ljava/util/List;+4
j  org.eclipse.equinox.internal.security.ui.storage.TabPassword.fillProviderTable()V+48
j  org.eclipse.equinox.internal.security.ui.storage.TabPassword.<init>(Lorg/eclipse/swt/widgets/TabFolder;ILorg/eclipse/swt/widgets/Shell;)V+439
j  org.eclipse.equinox.internal.security.ui.storage.StoragePreferencePage.createContents(Lorg/eclipse/swt/widgets/Composite;)Lorg/eclipse/swt/widgets/Control;+46
j  org.eclipse.jface.preference.PreferencePage.createControl(Lorg/eclipse/swt/widgets/Composite;)V+88
j  org.eclipse.jface.preference.PreferenceDialog.createPageControl(Lorg/eclipse/jface/preference/IPreferencePage;Lorg/eclipse/swt/widgets/Composite;)V+2
j  org.eclipse.jface.preference.Preference
Comment 3 Andrey Loskutov CLA 2021-03-22 15:49:37 EDT
*** Bug 572198 has been marked as a duplicate of this bug. ***
Comment 4 Eclipse Genie CLA 2021-03-22 17:57:29 EDT
New Gerrit change created: https://git.eclipse.org/r/c/equinox/rt.equinox.bundles/+/178240
Comment 5 Jeff Johnston CLA 2021-03-22 18:00:48 EDT
Problem is due to faulty JNA coding of glist append call.  I have provided a patch.  The problem occurs if the default collection is currently locked.
Comment 6 Antonio Petrelli CLA 2021-03-23 04:10:26 EDT
(In reply to Andrey Loskutov from comment #1)
> Can you please keep the core dump?
> Run following:
> 
> gdb /home/antonio/javadev/ide/eclipse-202103/core.31798
> 
> and enter "bt" - that should show the backtrace. Please attach it here.

I am sorry the core dump has not been created, later I will replicate the problem and attach it.
Comment 7 Andrey Loskutov CLA 2021-03-23 07:42:00 EDT
*** Bug 572217 has been marked as a duplicate of this bug. ***
Comment 8 Antonio Petrelli CLA 2021-03-23 11:39:08 EDT
(In reply to Andrey Loskutov from comment #1)
> Can you please keep the core dump?
> Run following:
> 
> gdb /home/antonio/javadev/ide/eclipse-202103/core.31798
> 
> and enter "bt" - that should show the backtrace. Please attach it here.

I think that the backtrace without the debug symbols, however here it is:

#0  0x00007fa5f2bd68cb in ?? ()
#1  0xfffffffe7ffbfa07 in ?? ()
#2  0x0000000000000010 in ?? ()
#3  0x00007fa5f2814b82 in ?? ()
#4  0x00007fa5f245e77e in ?? ()
#5  0x0000000000000008 in ?? ()
#6  0x00000000000007d0 in ?? ()
#7  0x00007fa5f159db50 in ?? ()
#8  0x00007fa5f2814b82 in ?? ()
#9  0x00007fa5f159d9b0 in ?? ()
#10 0x00007fa5f245f45b in ?? ()
#11 0x0000000000000001 in ?? ()
#12 0x00007fa5f2c9dda4 in ?? ()
#13 0x00007fa5f159d9c0 in ?? ()
#14 0x0000000000000005 in ?? ()
#15 0x00007fa5f2b44940 in ?? ()
#16 0x0000000000000005 in ?? ()
#17 0xfffffffe7fffffff in ?? ()
#18 0xffffffffffffffff in ?? ()
#19 0xffffffffffffffff in ?? ()
#20 0xffffffffffffffff in ?? ()
#21 0xffffffffffffffff in ?? ()
#22 0xffffffffffffffff in ?? ()
#23 0xffffffffffffffff in ?? ()
#24 0xffffffffffffffff in ?? ()
#25 0xffffffffffffffff in ?? ()
#26 0xffffffffffffffff in ?? ()
#27 0xffffffffffffffff in ?? ()
#28 0xffffffffffffffff in ?? ()
#29 0xffffffffffffffff in ?? ()
#30 0xffffffffffffffff in ?? ()
#31 0xffffffffffffffff in ?? ()
#32 0xffffffffffffffff in ?? ()
#33 0x00007fa5f159db10 in ?? ()
#34 0x6e11ee8aa655fc00 in ?? ()
#35 0x00007fa5f159daa0 in ?? ()
#36 0x00007fa5f2bbb864 in ?? ()
#37 0x0000000000000020 in ?? ()
#38 0x00000000000007d0 in ?? ()
#39 0x00007fa5f159db50 in ?? ()
#40 0x0000003000000010 in ?? ()
#41 0x00007fa5f159dab0 in ?? ()
#42 0x00007fa5f159d9c0 in ?? ()
#43 0x0000000000006c83 in ?? ()
#44 0x0000000000023bc0 in ?? ()
#45 0x000000000000000a in ?? ()
#46 0x00007fa5f27d205f in ?? ()
#47 0x0000000000000000 in ?? ()
Comment 10 Ortwin Glück CLA 2021-03-24 04:29:27 EDT
Any mitigation? Because now Eclipse is completely unusable for me. Any git Operation or even opening the secure storage settings crashes Eclipse immediately.
Comment 11 M Wensveen CLA 2021-03-24 06:29:44 EDT
I use this workaround on Ubuntu
before starting eclipse:
- Open the seahorse (application for managing encryption keys and passwords in the GNOME Keyring)
- The "Default keyring" is locked. Right click and select unlock.
Comment 12 Jeff Johnston CLA 2021-03-26 16:00:53 EDT
A fix has been made and is part of the latest 4.20-I-builds.

Could you try downloading the Eclipse SDK from:

https://download.eclipse.org/eclipse/downloads/drops4/I20210325-1800/

and testing to verify if the problem is fixed for your set-up.
Comment 13 Henning Blohm CLA 2021-03-29 03:03:53 EDT
The proposed workaround seems to work. Tried to test the drop but it lacks all features I would need to test our plugin.
Comment 14 M Wensveen CLA 2021-03-29 03:42:15 EDT
Tested the https://download.eclipse.org/eclipse/downloads/drops4/I20210325-1800/.
I installed egit and this version of eclipse does not crash when pulling from git. So it seems to be fixed.
Comment 15 Antonio Petrelli CLA 2021-03-29 03:56:40 EDT
It works! However I hope that this fix is backported to 4.19, since this version is useless without it.
Comment 16 Jeff Johnston CLA 2021-03-29 16:37:13 EDT
(In reply to Antonio Petrelli from comment #15)
> It works! However I hope that this fix is backported to 4.19, since this
> version is useless without it.

Hi Antonio,

Have you tried the suggested workaround to manually unlock the default keyring?
Comment 17 Antonio Petrelli CLA 2021-03-30 03:40:03 EDT
(In reply to Jeff Johnston from comment #16)
> (In reply to Antonio Petrelli from comment #15)
> > It works! However I hope that this fix is backported to 4.19, since this
> > version is useless without it.
> 
> Hi Antonio,
> 
> Have you tried the suggested workaround to manually unlock the default
> keyring?

Yes, it works, I just tried it. Notice that I tried the 4.20 integration build *before* unlocking the keyring (and it worked).
Notice that I am in KDE and I had to install seahorse because is not bundled with it. Luckily it is not disruptive.
Saving passwords works too with the workaround.
Anyway I think that backporting this fix is better that saying people to unlock the keyring at every login.
Comment 18 Jeff Johnston CLA 2021-03-30 15:09:41 EDT
Created attachment 285992 [details]
Updated Eclipse Security for Linux

Source for updated fragment with patch
Comment 19 Jeff Johnston CLA 2021-03-30 15:33:43 EDT
(In reply to Antonio Petrelli from comment #17)
> (In reply to Jeff Johnston from comment #16)
> > (In reply to Antonio Petrelli from comment #15)
> > > It works! However I hope that this fix is backported to 4.19, since this
> > > version is useless without it.
> > 
> > Hi Antonio,
> > 
> > Have you tried the suggested workaround to manually unlock the default
> > keyring?
> 
> Yes, it works, I just tried it. Notice that I tried the 4.20 integration
> build *before* unlocking the keyring (and it worked).
> Notice that I am in KDE and I had to install seahorse because is not bundled
> with it. Luckily it is not disruptive.
> Saving passwords works too with the workaround.
> Anyway I think that backporting this fix is better that saying people to
> unlock the keyring at every login.

Hi Antonio, 

Backporting is difficult to do and get permission for but I understand the annoyance of the manual work-around each time.  To that end, I have posted the source for the org.eclipse.equinox.security.linux fragment project with patch as a zip which you can download.  If you go to File -> Import -> General -> Existing Projects into Workspace and then click on Select Archive, you can specify the location of the zip file you downloaded and hit Finish.  This will bring the fragment project into your workspace.

If you then right-click on the org.eclipse.equinox.security.linux fragment project and select Export... -> Plug-in Development -> Deployable Plugins and Fragments then choose the last Destination option: "Install into host: Repository" and hit Finish, the fragment update will get installed into your Eclipse and you won't have to do anything manual after that.  It will warn you about it not being signed, but that is expected since it is directly from the fragment project.  You can verify by looking at Help -> About Eclipse IDE -> Installation Details -> Plugins and you should see that the org.eclipse.equinox.security.linux fragment is version 1.0.100.xxxxxx.

This fix is unnecessary for systems which unlock the default keyring on login.
Comment 20 Andrey Loskutov CLA 2021-04-03 10:00:58 EDT
*** Bug 572545 has been marked as a duplicate of this bug. ***
Comment 21 Christoph Laeubrich CLA 2021-04-03 10:15:23 EDT
(In reply to Jeff Johnston from comment #19)
> Backporting is difficult to do and get permission for

But what is Backporting/Update Sites are good for if even such a serve problem (eclipse crashes with all unsaved work is gone, probably workspace corruption) is not worth it?
Comment 22 Marco Heyde CLA 2021-04-08 03:32:49 EDT
Hi Jeff,
thanks for the workaround. It works on my Linux Mint 20 following your instructions. It seems to require the Plugin-Development Environment installed in Eclipse to have the necessary export target available. A pure Java edition of Eclipse seems not to work.
Comment 23 Andrey Loskutov CLA 2021-04-08 11:29:05 EDT
*** Bug 572701 has been marked as a duplicate of this bug. ***
Comment 24 Andrey Loskutov CLA 2021-05-25 13:05:38 EDT
*** Bug 573763 has been marked as a duplicate of this bug. ***