Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 527536

Summary: [GTK3] [32-bit] NoSuchMethodError: gObjectClass_finalize
Product: [Eclipse Project] Platform Reporter: Thomas Singer <eclipse>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: blocker    
Priority: P3 CC: akurtakov, daniel_megert, ericwill, Lars.Vogel, loskutov, peter, s.muecke, simeon.danailov.andreev
Version: 4.8Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=470031
https://git.eclipse.org/r/112104
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=28cccc6c31636d2dfce20e6fd2b67b306db0ddbb
https://bugs.eclipse.org/bugs/show_bug.cgi?id=536764
https://bugs.eclipse.org/bugs/show_bug.cgi?id=536766
Whiteboard:

Description Thomas Singer CLA 2017-11-21 03:11:10 EST
Disposing a shell with the latest SWT 4.830 causes following exception to occur on Linux Mint 18.1 with GTK 3.18.9 and Mint-X theme:

java.lang.NoSuchMethodError: gObjectClass_finalize
	at org.eclipse.swt.internal.gtk.OS._gtk_widget_destroy(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_widget_destroy(OS.java:13691)
	at org.eclipse.swt.widgets.Widget.destroyWidget(Widget.java:463)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1186)
	at org.eclipse.swt.widgets.Control.release(Control.java:4117)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:498)
	at org.eclipse.swt.widgets.Shell.dispose(Shell.java:2700)
Comment 1 Dani Megert CLA 2017-11-21 03:36:44 EST
(In reply to Thomas Singer from comment #0)
> Disposing a shell with the latest SWT 4.830 causes following exception to
> occur on Linux Mint 18.1 with GTK 3.18.9 and Mint-X theme:
> 
> java.lang.NoSuchMethodError: gObjectClass_finalize
> 	at org.eclipse.swt.internal.gtk.OS._gtk_widget_destroy(Native Method)
> 	at org.eclipse.swt.internal.gtk.OS.gtk_widget_destroy(OS.java:13691)
> 	at org.eclipse.swt.widgets.Widget.destroyWidget(Widget.java:463)
> 	at org.eclipse.swt.widgets.Widget.release(Widget.java:1186)
> 	at org.eclipse.swt.widgets.Control.release(Control.java:4117)
> 	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:498)
> 	at org.eclipse.swt.widgets.Shell.dispose(Shell.java:2700)

Is this with a fresh install? Can you try with
http://download.eclipse.org/eclipse/downloads/drops4/S-4.8M3a-201710300400/
Comment 2 Leo Ufimtsev CLA 2017-11-21 09:32:19 EST
I've tried with today's master and Snippet1.java, no issues.
(gtk3.22/Fedora26).

Please kindly post more details:
- Snippet to reproduce (or link to SWT Snippets snippet)
- Last known good version(?) (roughly).

Maybe it's trying to load non-existing bindings? Try to move ~/.swt  to allow new .so files to be extracted.

@Eric, any ideas?
Comment 3 Eric Williams CLA 2017-11-21 10:07:55 EST
gObjectClass_finalize() is a method in AccessibleObject.java that is called via JNI from os_custom.c. This has been the case for ~2 months now, as part of the new accessibility work.

It looks like JNI can't find the method, which I'm guessing means something is wrong with your binaries/bindings. Maybe try a different build? I can't reproduce the issue on GTK3.18 (or 3.22).
Comment 4 Thomas Singer CLA 2017-11-21 10:54:16 EST
(In reply to Dani Megert from comment #1)
> (In reply to Thomas Singer from comment #0)
> > Disposing a shell with the latest SWT 4.830 causes following exception to
> > occur on Linux Mint 18.1 with GTK 3.18.9 and Mint-X theme:
> > 
> > java.lang.NoSuchMethodError: gObjectClass_finalize
> > 	at org.eclipse.swt.internal.gtk.OS._gtk_widget_destroy(Native Method)
> > 	at org.eclipse.swt.internal.gtk.OS.gtk_widget_destroy(OS.java:13691)
> > 	at org.eclipse.swt.widgets.Widget.destroyWidget(Widget.java:463)
> > 	at org.eclipse.swt.widgets.Widget.release(Widget.java:1186)
> > 	at org.eclipse.swt.widgets.Control.release(Control.java:4117)
> > 	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:498)
> > 	at org.eclipse.swt.widgets.Shell.dispose(Shell.java:2700)
> 
> Is this with a fresh install? Can you try with
> http://download.eclipse.org/eclipse/downloads/drops4/S-4.8M3a-201710300400/

It is a fresh build from sources - like I do it since approx. 3 or 4 years.
Comment 5 Thomas Singer CLA 2017-11-21 10:55:18 EST
I reckon, it wouldn't work with SWT_GTK3=0 if the build would have failed.
Comment 6 Eric Williams CLA 2017-11-21 11:13:20 EST
Does this happen all the time? With a specific snippet?
Comment 7 Dani Megert CLA 2017-11-21 11:15:46 EST
(In reply to Thomas Singer from comment #4)
> (In reply to Dani Megert from comment #1)
> > (In reply to Thomas Singer from comment #0)
> > > Disposing a shell with the latest SWT 4.830 causes following exception to
> > > occur on Linux Mint 18.1 with GTK 3.18.9 and Mint-X theme:
> > > 
> > > java.lang.NoSuchMethodError: gObjectClass_finalize
> > > 	at org.eclipse.swt.internal.gtk.OS._gtk_widget_destroy(Native Method)
> > > 	at org.eclipse.swt.internal.gtk.OS.gtk_widget_destroy(OS.java:13691)
> > > 	at org.eclipse.swt.widgets.Widget.destroyWidget(Widget.java:463)
> > > 	at org.eclipse.swt.widgets.Widget.release(Widget.java:1186)
> > > 	at org.eclipse.swt.widgets.Control.release(Control.java:4117)
> > > 	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:498)
> > > 	at org.eclipse.swt.widgets.Shell.dispose(Shell.java:2700)
> > 
> > Is this with a fresh install? Can you try with
> > http://download.eclipse.org/eclipse/downloads/drops4/S-4.8M3a-201710300400/
> 
> It is a fresh build from sources - like I do it since approx. 3 or 4 years.

Can you please try with the suggested build.
Comment 8 Thomas Singer CLA 2017-11-22 06:12:04 EST
I have performed further tests. Steps:
- download SmartSynchronize 3.4.12 from <http://www.syntevo.com/smartsynchronize/download?file=smartsynchronize/smartsynchronize-linux-3_4_12.tar.gz>
- unpack bin/smartsynchronize.sh, run it from command line until the "Welcome" window occurs
- press Alt+X (or click the "Exit" button)

To eliminate anything from our launch-script (bin/smartsynchronize.sh), one could launch it also from the lib directory using following command:

 $ env SWT_GTK3=1 java -jar bootloader.jar

The log at ~/.smartsynchronize/log.txt should indicate what jars actually are loaded.

I have replaced lib/org.eclipse.swt.gtk.linux.x86.jar with the swt.jar from http://download.eclipse.org/eclipse/downloads/drops4/S-4.8M3a-201710300400/ - same crash. I have bisected the SWT sources and found out that the bug has been introduced with build 4.820. The last working commit was

3154c28ad77 "Bug 522718 - Remove mozilla leftovers" from 2017-09-25 12:39

and the first bad (successfully compilable) commit being

7448b63396e "v4820" from 2017-09-26 10:10

To me it looks like the commit which introduced the crash was

bdaf68d5b28 "Bug 470031: [GTK3] Some viewparts became inaccessible in 4.5" from 2017-09-06 17:47


The bad thing is, I could not reproduce it within a snippet. I was not even possible to reproduce it when launching SmartSynchronize from within IDEA.
Comment 9 Thomas Singer CLA 2017-11-22 06:13:16 EST
(In reply to Thomas Singer from comment #8)
> - unpack bin/smartsynchronize.sh, run it from command line until the
> "Welcome" window occurs

should read

- unpack,
- run bin/smartsynchronize.sh from command line until the "Welcome" window occurs
Comment 10 Eric Williams CLA 2017-11-22 08:47:26 EST
I will investigate.
Comment 11 Leo Ufimtsev CLA 2017-11-22 09:39:38 EST
(In reply to Thomas Singer from comment #8)
> I have replaced lib/org.eclipse.swt.gtk.linux.x86.jar with the swt.jar from
>                                                ^- 32 bit?

Are you using a 32bit of swt?  
Theory: Some pointer issue where 32/64 bit pointers might got muddled up. (who knows??)

Are you able to test with a 64 bit version?

Btw, may be of interest if using 32 bit:
Bug 526620 – Future of 32-bit Eclipse 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=526620
There are plans on dropping 32 bit version. If you depend on 32bit, consider hoping onto the 64bit wagon if possible.
Comment 12 Thomas Singer CLA 2017-11-22 10:38:56 EST
Yes, I'm using the 32-bit lib because I have a 32-bit Linux installed.
Comment 13 Eric Williams CLA 2017-11-22 10:46:42 EST
(In reply to Thomas Singer from comment #8)
> I have performed further tests. Steps:
> - download SmartSynchronize 3.4.12 from
> <http://www.syntevo.com/smartsynchronize/download?file=smartsynchronize/
> smartsynchronize-linux-3_4_12.tar.gz>
> - unpack bin/smartsynchronize.sh, run it from command line until the
> "Welcome" window occurs
> - press Alt+X (or click the "Exit" button)
> 
> To eliminate anything from our launch-script (bin/smartsynchronize.sh), one
> could launch it also from the lib directory using following command:
> 
>  $ env SWT_GTK3=1 java -jar bootloader.jar
> 
> The log at ~/.smartsynchronize/log.txt should indicate what jars actually
> are loaded.
> 
> I have replaced lib/org.eclipse.swt.gtk.linux.x86.jar with the swt.jar from
> http://download.eclipse.org/eclipse/downloads/drops4/S-4.8M3a-201710300400/
> - same crash. I have bisected the SWT sources and found out that the bug has
> been introduced with build 4.820. The last working commit was
> 
> 3154c28ad77 "Bug 522718 - Remove mozilla leftovers" from 2017-09-25 12:39
> 
> and the first bad (successfully compilable) commit being
> 
> 7448b63396e "v4820" from 2017-09-26 10:10
> 
> To me it looks like the commit which introduced the crash was
> 
> bdaf68d5b28 "Bug 470031: [GTK3] Some viewparts became inaccessible in 4.5"
> from 2017-09-06 17:47
> 
> 
> The bad thing is, I could not reproduce it within a snippet. I was not even
> possible to reproduce it when launching SmartSynchronize from within IDEA.

I did these steps and could not get the issue to reproduce. This is on a 64-bit OS, using the 64-bit SWT libs.

I will try on a 32-bit VM to see if the issue reproduces...even if it doesn't, I  believe I'll be able to patch it since it's a JNI error which I can catch.
Comment 14 Leo Ufimtsev CLA 2017-11-22 10:53:22 EST
(In reply to Thomas Singer from comment #12)
> Yes, I'm using the 32-bit lib because I have a 32-bit Linux installed.

Out of technical curiosity, is it possible for you guys to migrate to 64 bit, or would it currently be too expensive/time consuming? (I'm kinda thinking about what to do when 32bit will be dropped...).
Comment 15 Leo Ufimtsev CLA 2017-11-22 10:53:51 EST
(In reply to Leo Ufimtsev from comment #14)
> (In reply to Thomas Singer from comment #12)
> > Yes, I'm using the 32-bit lib because I have a 32-bit Linux installed.
> 
> Out of technical curiosity, is it possible for you guys to migrate to 64
> bit, or would it currently be too expensive/time consuming? (I'm kinda
> thinking about what to do when 32bit will be dropped...).

Not saying that we should ignore 32 bit bugs :-), just curious.
Comment 16 Dani Megert CLA 2017-11-22 11:02:23 EST
(In reply to Leo Ufimtsev from comment #15)
> (In reply to Leo Ufimtsev from comment #14)
> > (In reply to Thomas Singer from comment #12)
> > > Yes, I'm using the 32-bit lib because I have a 32-bit Linux installed.
> > 
> > Out of technical curiosity, is it possible for you guys to migrate to 64
> > bit, or would it currently be too expensive/time consuming? (I'm kinda
> > thinking about what to do when 32bit will be dropped...).
> 
> Not saying that we should ignore 32 bit bugs :-), just curious.

See bug 526620.
Comment 17 Thomas Singer CLA 2017-11-22 11:16:33 EST
(In reply to Leo Ufimtsev from comment #14)
> (In reply to Thomas Singer from comment #12)
> > Yes, I'm using the 32-bit lib because I have a 32-bit Linux installed.
> 
> Out of technical curiosity, is it possible for you guys to migrate to 64
> bit, or would it currently be too expensive/time consuming? (I'm kinda
> thinking about what to do when 32bit will be dropped...).

Sure, this would be possible, but ATM our Linux test machine just has a 32-bit Linux installed.
Comment 18 Eric Williams CLA 2017-11-22 11:35:04 EST
Okay, I can reproduce the issue (kind of) in my VM.

The crash/error doesn't actually happen, but I see the error message:

CRITICAL **: JNI method ID pointer is NULL for method gObjectClass_finalize

Which is undoubtedly causing the crash on your end. I can prepare a patch, Thomas would be able to review + test it?
Comment 19 Thomas Singer CLA 2017-11-22 12:18:57 EST
(In reply to Eric Williams from comment #18)
> Okay, I can reproduce the issue (kind of) in my VM.
> 
> The crash/error doesn't actually happen, but I see the error message:
> 
> CRITICAL **: JNI method ID pointer is NULL for method gObjectClass_finalize
> 
> Which is undoubtedly causing the crash on your end. I can prepare a patch,
> Thomas would be able to review + test it?

Yes, this should be possible tomorrow.
Comment 20 Eclipse Genie CLA 2017-11-22 13:34:02 EST
New Gerrit change created: https://git.eclipse.org/r/112104
Comment 21 Thomas Singer CLA 2017-11-23 02:33:16 EST
Sorry, I can't build native code and hence can't verify the patch.
Comment 22 Eric Williams CLA 2017-11-23 10:43:25 EST
(In reply to Thomas Singer from comment #21)
> Sorry, I can't build native code and hence can't verify the patch.

Okay. I will build it myself and try on my VM. If it fixes the errors I'll push it.

You can check out the I-build tomorrow and verify on your machine.
Comment 24 Eric Williams CLA 2017-11-23 11:45:25 EST
(In reply to Eclipse Genie from comment #23)
> Gerrit change https://git.eclipse.org/r/112104 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=28cccc6c31636d2dfce20e6fd2b67b306db0ddbb

I've merged the patch.

Building SWT on 32-bit required a lot of time so I didn't go down that road. Please test with tomorrow's I-build and let me know if the issue is fixed. I'll keep this bug open in the meantime.
Comment 25 Thomas Singer CLA 2017-11-24 03:15:48 EST
Sorry, Eric, the bug is still present in 4.832. I'm also still seeing the output

CRITICAL **: JNI method ID pointer is NULL for method gObjectClass_finalize

printed to stderr.
Comment 26 Eric Williams CLA 2017-11-24 09:28:58 EST
(In reply to Thomas Singer from comment #25)
> Sorry, Eric, the bug is still present in 4.832. I'm also still seeing the
> output
> 
> CRITICAL **: JNI method ID pointer is NULL for method gObjectClass_finalize
> 
> printed to stderr.

Alright, I'll investigate further next week.
Comment 27 Alexander Kurtakov CLA 2018-05-02 04:46:18 EDT
What is the status of this bug guys?
Comment 28 Eric Williams CLA 2018-05-02 14:17:11 EDT
(In reply to Alexander Kurtakov from comment #27)
> What is the status of this bug guys?

I still cannot reproduce the bug.
Comment 29 Alexander Kurtakov CLA 2018-06-08 14:06:24 EDT
Should we close this one?
Comment 30 Thomas Singer CLA 2018-06-09 07:13:11 EDT
The crash still is reproducible with stock Linux Mint 18.3 Cinnamon/32-bit.
Comment 31 Andrey Loskutov CLA 2018-07-06 10:42:43 EDT
See also bug 536764 and bug 536766.
Comment 32 Eric Williams CLA 2018-08-23 15:23:47 EDT
32 bit Linux support is being dropped in 4.10. See bug bug 536766.
Comment 33 Eric Williams CLA 2018-09-10 09:42:02 EDT
*** Bug 536764 has been marked as a duplicate of this bug. ***