Saturday, April 11, 2015

Spring Tool Suite crashes at start up on debian wheezy

At the time of starting spring tool suite on debian wheezy crash occurs with the below log:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.

(java:7096): GLib-GObject-WARNING **: cannot register existing type `GdkDisplayManager'

(java:7096): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(java:7096): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed

(java:7096): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(java:7096): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(java:7096): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(java:7096): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(java:7096): GLib-GObject-WARNING **: cannot register existing type `GdkDisplay'

(java:7096): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(java:7096): GLib-GObject-CRITICAL **: g_type_register_static: assertion `parent_type > 0' failed

(java:7096): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(java:7096): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f342ddc273f, pid=7096, tid=139862722598656
#
# JRE version: Java(TM) SE Runtime Environment (8.0_40-b25) (build 1.8.0_40-b25)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.40-b25 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libgdk-x11-2.0.so.0+0x5173f] gdk_display_open+0x3f
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
#/springtoolsuite/sts-bundle/sts-3.6.4.RELEASE/hs_err_pid7096.log
#
# If you would like to submit a bug report, please visit:
# http://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.
#


Debian wheezy comes with glibc 2.13. For eclipse in gtk3 we need the minimum version to be 2.14. To resolve the problem please upgrade the glibc version to 2.14.

Another work around is there. We have to force STS to always use GTK2. This would be the easiest to get STS up without crash. To force STS to always use GTK2, we need to include few lines in STS.ini file. Just add the following lines:

--launcher.GTK_version
2

In my case STS.ini file is as below:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20150204-1316
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.GTK_version
2
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m