Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 150006 - [IAC] Exception when launching a SWT process via the IAC on Linux.
Summary: [IAC] Exception when launching a SWT process via the IAC on Linux.
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: Other Linux
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: Navid Mehregani CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-07 11:51 EDT by Paul Slauenwhite CLA
Modified: 2016-05-05 10:43 EDT (History)
7 users (show)

See Also:


Attachments
Example plugin to reproduce the defect and a possible solution. (9.74 KB, application/x-zip-compressed)
2006-07-07 11:54 EDT, Paul Slauenwhite CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2006-07-07 11:51:44 EDT
Exception when launching a SWT process via the IAC on Linux.

When launching a SWT process (e.g. enclosed sample SWT process or the TPTP Manual Test View) - probably any process containing a UI - via the IAC on Linux, the following exception is thrown:

org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]

Based on https://bugs.eclipse.org/bugs/show_bug.cgi?id=115822#c12, this is caused by the process not being able to connect to the X server.  The connection to the X server can fail in the following ways:
 1. The DISPLAY environment variable is unset
 2. The host/port information is wrong
 3. The X server is down
 4. The socket to the X server is on too high of a file descriptor

I traced this problem to the org.eclipse.hyades.execution/src-local/org/eclipse/tptp/platform/agentcontroller/internal/impl/HyadesMessageProcessorImpl.java#handleLaunchProcess(String,String,Command) method where it is calling /org.eclipse.hyades.execution/src-local/org/eclipse/tptp/platform/agentcontroller/internal/impl/PlatformUtility.java#launchProcess(String,String[],String) which calls java.lang.Runtime#exec(String,String[],File).  By passing in the environment array, the launched process does not inherit the environment of the current process (e.g. Eclipse's JVM).  As such, the launched process does not have a handle to the local display (despite setting the DISPLAY environment variable) to render the UI.  See the enclosed example for more details.  Interestingly, setting the DISPLAY environment variable to a remote machine with an accessible X server (e.g. Windows XP running Exceed), the UI is rendered on the remote machine.
Comment 1 Paul Slauenwhite CLA 2006-07-07 11:54:59 EDT
Created attachment 45933 [details]
Example plugin to reproduce the defect and a possible solution.

This example plugin works the TPTP-4.2.0-200606190100B driver on Linux (IA32).
Comment 2 Bob Duncan CLA 2006-07-13 11:57:21 EDT
As per discussion with Paul, this will affect any application with a ui that is launched via IAC on Linux. However the problem can be circumvented by using the RAC instead of IAC and therefore, I am asking Paul to change the severity from Blocker to Critical. It is agreed that the best way to fix the problem is to get the JDK to fix Runtime.Exec but we both believe that will take longer than we can afford. In the meantime, it is agreed that the workaround he has described/protoyped (ie: to launch apps via a wrapper shell script that will setup the environment and invoke the actual app) is the most expedient way to fix the problem but it is risky because it affects delicate RAC code that requires Samson's hand if we are to make the risk acceptable.

Therefore, we agree to proceed as follows:
 1) downgrade severity to critical
 1) provide a release note for the problem/workaround for 4.2.0.1 and 4.2.1
 2) defer the wrapper fix to 4.3 (so that Samson can do it)
 3) pursue JDK (as time permits) to fix Runtime.Exec
Comment 3 Karla Callaghan CLA 2006-07-13 13:50:26 EDT
Setting priority to P1 as well.
Comment 4 Paul Slauenwhite CLA 2006-07-14 15:43:34 EDT
(In reply to comment #2)

Created readme entries for the Platform (Java profiling) and Test (Manual Test View).

Note, please remove these entries when this defect is fixed.

Please open a IBM and/or Sun JVM defect for this issue.
Comment 5 Paul Slauenwhite CLA 2006-09-22 11:36:25 EDT
Increasing to blocker since Manual Test execution using the IAC is a very common use case.
Comment 6 Karla Callaghan CLA 2006-09-22 12:50:03 EDT
Targetting 4.2 i2. Need to fix before exiting this iteration.
Comment 7 Joe Toomey CLA 2006-10-06 12:07:43 EDT
removing blocker tag per discussion at AB call.  Re-triaging to i3.
Comment 8 Samson Wai CLA 2006-10-06 13:30:49 EDT
Setting this to P2 to make sure bug 159179 is highest in priority.
Comment 9 Samson Wai CLA 2006-10-30 10:43:07 EST
Not containable in 4.3 and retarget to 4.4. Please let me know if you have any concern.
Comment 10 Samson Wai CLA 2007-01-31 16:09:43 EST
Set priority to P1 for 4.4 plan closure.
Comment 11 Samson Wai CLA 2007-02-16 15:12:59 EST
Not containable in 4.4.
Comment 12 Paul Slauenwhite CLA 2007-02-22 13:53:20 EST
(In reply to comment #11)
> Not containable in 4.4.

How can we defer a defect that is blocking Test Tool function for a very common use case (local Manual Test execution using the IAC on Linux)?  Will this be addressed in the new IAC?  If not, we need to reconsider for 4.4.
Comment 13 Paul Slauenwhite CLA 2007-03-29 19:28:07 EDT
See again when testing the TPTP-4.4.0-200703270100A driver.  This defect needs to be reconsidered for 4.4.
Comment 14 Navid Mehregani CLA 2007-04-02 10:23:30 EDT
Should be resolved with the implementation of the new IAC described in bugzilla 173330.
Comment 15 Paul Slauenwhite CLA 2007-04-02 10:37:58 EDT
Confirmed that this defect is not encountered using the stand-alone AC.
Comment 16 jkubasta CLA 2007-04-03 12:38:26 EDT
plan keyword is only for defects approved officially in the TPTP 4.4 plan
Comment 17 Navid Mehregani CLA 2007-04-27 10:22:54 EDT
Fixed as a result of bug 173330.
Comment 18 Paul Slauenwhite CLA 2007-06-27 14:52:17 EDT
Verified in TPTP-4.4.0-200706140100C.