It's all about the answers!

Ask a question

RTC scm command-line on linux throws an error if no DISPLAY variable is set and/or Xwindows is not available


Paul Callahan (20136) | asked Aug 12 '13, 9:35 p.m.
retagged Aug 13 '13, 7:29 p.m. by Te-Hsin Shih (2854)
 my version of the installed command-line is 
$scm -v
Build Id: RTC-I20121113-2333
com.ibm.team.filesystem.cli.core, version 3.1.200.v20121106_0746

If I try to run scm by itself, it tries to put up a GUI dialog box.  It works ok if I have a valid DISPLAY variable set, but it throws an error and core-dumps if not.  I'm trying to run this as part of a headless server script so this is a problem.  I've tried the --non-interactive flag, no joy.  Is there a flag to make scm run in a headless mode?

I'm using jre 1.6_34, on centos 6.2 64-bit.

The error is:
(Scm.binary:7099): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(Scm.binary:7099): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
(Scm.binary:7099): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(Scm.binary:7099): GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed
(Scm.binary:7099): GLib-GObject-WARNING **: value "TRUE" of type `gboolean' is invalid or out of range for property `visible' of type `gboolean'
(Scm.binary:7099): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(Scm.binary:7099): GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed
(Scm.binary:7099): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window
(Scm.binary:7099): Gdk-CRITICAL **: gdk_pango_context_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_context_set_font_description: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_context_set_base_dir: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_context_set_language: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_new: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_text: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_attributes: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_alignment: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_ellipsize: assertion `PANGO_IS_LAYOUT (layout)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_single_paragraph_mode: assertion `PANGO_IS_LAYOUT (layout)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_width: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_get_extents: assertion `layout != NULL' failed
(Scm.binary:7099): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(Scm.binary:7099): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(Scm.binary:7099): Gtk-CRITICAL **: gtk_icon_size_lookup_for_settings: assertion `GTK_IS_SETTINGS (settings)' failed
(Scm.binary:7099): Gtk-WARNING **: Invalid icon size 6

(Scm.binary:7099): Gtk-CRITICAL **: gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed
(Scm.binary:7099): Gtk-WARNING **: Error loading theme icon 'gtk-dialog-error' for stock: 
(Scm.binary:7099): Gtk-CRITICAL **: gtk_icon_size_lookup_for_settings: assertion `GTK_IS_SETTINGS (settings)' failed
(Scm.binary:7099): Gtk-WARNING **: gtkstyle.c:2318: invalid icon size '6'
(Scm.binary:7099): Gtk-CRITICAL **: gtk_style_render_icon: assertion `pixbuf != NULL' failed
(Scm.binary:7099): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed
(Scm.binary:7099): Gdk-CRITICAL **: gdk_pango_context_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_context_set_font_description: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_context_set_base_dir: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_context_set_language: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_new: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_text: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_get_attributes: assertion `PANGO_IS_LAYOUT (layout)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_alignment: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_ellipsize: assertion `PANGO_IS_LAYOUT (layout)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_single_paragraph_mode: assertion `PANGO_IS_LAYOUT (layout)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_wrap: assertion `PANGO_IS_LAYOUT (layout)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_width: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_get_extents: assertion `layout != NULL' failed
(Scm.binary:7099): Gdk-CRITICAL **: gdk_pango_context_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_context_set_font_description: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_context_set_base_dir: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_context_set_language: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_new: assertion `context != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_text: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_get_extents: assertion `layout != NULL' failed
(Scm.binary:7099): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
(Scm.binary:7099): Gdk-CRITICAL **: gdk_screen_get_width: assertion `GDK_IS_SCREEN (screen)' failed
(Scm.binary:7099): Gdk-CRITICAL **: gdk_screen_get_width: assertion `GDK_IS_SCREEN (screen)' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_set_width: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_get_extents: assertion `layout != NULL' failed
(Scm.binary:7099): Pango-CRITICAL **: pango_layout_get_line_count: assertion `layout != NULL' failed
Floating point exception (core dumped)




Comments
Karl Weinert commented Aug 13 '13, 8:54 a.m.
JAZZ DEVELOPER

What is the exact command you are running?
How did you install scm?
Do you know what version you installed? (The -ver does not seem to show the "real" version)

5 answers



permanent link
Paul Callahan (20136) | answered Aug 13 '13, 12:13 p.m.
 I resolved this by removing X Windows and GTK from the system entirely.  Since this is a build server, it wasn't really needed anyway.

The dialog was something akin to "workspace not found" or something.  I'm using the jenkins RTC plugin which first tries to run a history, and if by return code the workspace doesn't exist, jenkins goes ahead and creates it.

Thanks

Comments
Andrew Niefer commented Aug 13 '13, 4:08 p.m.
JAZZ DEVELOPER

If removing X Windows from the system is not a good solution for others, an alternative to try would be to disable SWT.  A simple way of doing this is to add a "-ws" argument to the scm.ini file:

-ws
none
-vm
../../client/eclipse/jdk/jre/bin
--launcher.suppressErrors
...

By setting the window system to "none", the swt fragment (org.eclipse.swt.gtk.linux.x86) would fail to resolve. Though I'm not sure how the jenkins plugin would react to this.


Paul Callahan commented Aug 13 '13, 4:11 p.m.

 Thanks.  That was probably the switches I was looking for.


permanent link
Shashikant Padur (4.3k27) | answered Aug 13 '13, 1:37 a.m.
JAZZ DEVELOPER
Since scm cli is based on Eclipse, Eclipse still requires a running X server to function. Probably there are ways to make Eclipse run in true headless mode.

Comments
Paul Callahan commented Aug 13 '13, 12:10 p.m.

the scm command works fine on a system of mine that has no X installed at all. 


permanent link
Abraham Sweiss (2.4k1331) | answered Aug 13 '13, 7:02 a.m.
My understanding is that the application would need to be designed so it could run in headless mode.  If scm is not designed to run in headless mode, then not sure anything can be done.  If you find a way to get it to work please post here, otherwise I think this is a candidate for a feature enhancement.   To open an enhancement request, select the "My Stuff" link in the upper right hand corner of jazz.net, then select the work item tab and click on open a defect.  A prompt to log in will appear, use your jazz credentials, then fill out the work  item. 


permanent link
Andrew Niefer (7135) | answered Aug 13 '13, 10:32 a.m.
JAZZ DEVELOPER
As mentioned, the scm command line is based on Eclipse.

However, Eclipse has supported running on linux without a display since 3.4, and it looks like you are running RTC 4.0.1 which is based on Eclipse 3.6.1. 

You can double check that your scm.ini file contains the line --launcher.suppressErrors , this causes the launcher to print errors to stderr instead of showing a dialog.  The 4.0.1 scm client I looked at has this already.

If you do set the DISPLAY, what is the content of the dialog box being shown?  It would be helpful to know where the dialog is coming from.

permanent link
Frederic Mora (13811518) | answered Aug 13 '13, 6:49 p.m.
edited Aug 13 '13, 6:49 p.m.
My current version is RTC 4. I am running scm on Linux machines with X11 installed. My scm.ini contains:
-vm
../../client/eclipse/jdk/jre/bin
--launcher.suppressErrors
-data
@noDefault
-vmargs
-Xmx512m
-Xshareclasses:nonfatal
-Xquickstart
-Dosgi.requiredJavaVersion=1.6
Whether DISPLAY is defined or not, I don't see an X11 dialog and scm runs OK.

Now, when we were running RTC 3, I remember having X11-related error messages when Eclipse-based utilities were launched in a shell that had the DISPLAY and XAUTHORITY env vars. Unsetting these vars fixed the prob.


Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.