Hi,

I am facing issue on Linux with NativeLibrary. When HTTPS proxy is set, I am 
getting errors on terminal error stream with consistency from 
org.eclipse.equinox.internal.security.linux.unlockSecretService(..) and 
following call in this method gets stuck forever.

            Pointer secretService = 
fLibSecret.secret_service_get_sync(SecretServiceFlags.SECRET_SERVICE_LOAD_COLLECTIONS,
                        Pointer.NULL, gerror);

On investigation, I found that its a race condition between finalizer and 
NativeLibrary.getInstance(..). On second time call to get secret-1 library, the 
object from weak reference is gone/GCed in NativeLibrary.libraries but the 
NativeLibrary object itself is not finalized/GCed yet, so it gets 
ref.get()==null and goes for reloading the library which causes following 
errors in console. The reason is that the older library was not unloaded yet 
and we loaded it again.

~~~~~~~~~~~~~~~~~~~~~~~~~
(java:3835014): GLib-GObject-WARNING **: 02:47:42.753: cannot register existing 
type 'SecretService'

(java:3835014): GLib-GObject-WARNING **: 02:47:42.753: cannot add private field 
to invalid (non-instantiatable) type '<invalid>'

(java:3835014): GLib-GObject-CRITICAL **: 02:47:42.753: 
g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE 
(instance_type)' failed

(java:3835014): GLib-GObject-CRITICAL **: 02:47:42.753: 
g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE 
(instance_type)' failed

(java:3835014): GLib-GObject-WARNING **: 02:47:42.753: cannot register existing 
type 'SecretBackend'

(java:3835014): GLib-GObject-CRITICAL **: 02:47:42.753: 
g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE 
(interface_type)' failed

(java:3835014): GLib-GObject-CRITICAL **: 02:47:42.753: 
g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE 
(interface_type)' failed

(java:3835014): GLib-CRITICAL **: 02:47:42.753: g_once_init_leave: assertion 
'result != 0' failed

(java:3835014): GLib-GObject-CRITICAL **: 02:47:42.753: 
g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE 
(instance_type)' failed
~~~~~~~~~~~~~~~~~~~~~~

I was looking at jna project and they have moved away from using finalizers [1] 
and it is available is version 5.12.

Can we add latest jna version in orbit for 2022-09?

[1] https://github.com/java-native-access/jna/pull/1402

Thanks,
Umair Sair
_______________________________________________
platform-dev mailing list
platform-dev@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/platform-dev

Reply via email to