Bug 58346 - [browser] IBM VM removes entries in the LD_LIBRARY_PATH causing Browser to fail
Summary: [browser] IBM VM removes entries in the LD_LIBRARY_PATH causing Browser to fail
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: Christophe Cornu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-13 14:54 EDT by Christophe Cornu CLA
Modified: 2004-06-18 04:36 EDT (History)
5 users (show)

See Also:


Attachments
eclipse launcher for M9 with some debug info (19.74 KB, application/octet-stream)
2004-05-26 17:06 EDT, Christophe Cornu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Cornu CLA 2004-04-13 14:54:19 EDT
From Konrad:

It looks like the browser installed with RHEL 3.0 does not meet requirements 
of SWT.  I have RHEL3.0U1 with all RHN updates, and they upgraded Mozilla to 
1.4.2, which I am afraid is not GTK version.  If you would like to see the 
browser embedded, a different mozilla (GTK2 build) needs to be installed
Comment 1 Konrad Kolosowski CLA 2004-04-13 15:24:29 EDT
I have not tried just on RHEL3.0U1.  We installed it, registered to RHN, 
installed all updated packages applicable for our system on Monday 20040412, 
so the system is little newer than plain Update1.
Then I tried help, the browser widget throws its ussual SWT.ERROR_NO_HANDLES.
Comment 2 Christophe Cornu CLA 2004-04-15 10:01:34 EDT
I am waiting to receive the licence to use RHN.
Meanwhile, could you try the following:
- open a terminal
- cd /usr/lib/mozilla-1.4
- ldd libgtkembedmoz.so

can you past the output of the last command?
Comment 3 Konrad Kolosowski CLA 2004-04-15 11:48:35 EDT
/usr/lib/mozilla-1.4 is has only chrome directory
issuing ldd libgtkembedmoz.so in /usr/lib/mozilla-1.4.2 gives:
        libxpcom.so => not found
        libplds4.so => /usr/lib/libplds4.so (0xb75d1000)
        libplc4.so => /usr/lib/libplc4.so (0xb75cc000)
        libnspr4.so => /usr/lib/libnspr4.so (0xb759c000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb758c000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7589000)
        libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0xb7333000)
        libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xb72c4000)
        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0xb72ab000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0xb7298000)
        libpangoxft-1.0.so.0 => /usr/lib/libpangoxft-1.0.so.0 (0xb7277000)
        libpangox-1.0.so.0 => /usr/lib/libpangox-1.0.so.0 (0xb726a000)
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0xb7236000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb7201000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb71fd000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7193000)
        libm.so.6 => /lib/tls/libm.so.6 (0xb7171000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0xb70be000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb70b4000)
        libc.so.6 => /lib/tls/libc.so.6 (0xb6f7c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0xb6e9d000)
        libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0xb6e99000)
        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0xb6e91000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0xb6e82000)
        libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0xb6e70000)
        libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0xb6e68000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb6e41000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb6df1000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb6de3000)
        libexpat.so.0 => /usr/lib/libexpat.so.0 (0xb6dc2000)
Comment 4 Christophe Cornu CLA 2004-04-15 14:01:01 EDT
This sounds good.
Can you try the following:
- open a terminal
- csh
- setenv LD_LIBRARY_PATH /usr/lib/mozilla-1.4
- start eclipse and try the Browser. It should work (make sure the 
LD_LIBRARY_PATH is correctly set - I gave the details for the csh shell)
Comment 5 Christophe Cornu CLA 2004-04-15 14:02:17 EDT
Sorry - I meant: LD_LIBRARY_PATH /usr/lib/mozilla-1.4.2

Can you try the following:
- open a terminal
- csh
- setenv LD_LIBRARY_PATH /usr/lib/mozilla-1.4.2
- start eclipse and try the Browser. It should work (make sure the 
LD_LIBRARY_PATH is correctly set - I gave the details for the csh shell)
Comment 6 Konrad Kolosowski CLA 2004-04-15 16:50:53 EDT
With LD_LIBRARY_PATH set, the browser does not work as before :-(
Comment 7 Christophe Cornu CLA 2004-04-19 10:06:04 EDT
Currently updating my RH EL3 system through RHN and hoping to reproduce the PR
Comment 8 Christophe Cornu CLA 2004-04-19 11:14:36 EDT
Fixed v>20040419.
Comment 9 Christophe Cornu CLA 2004-04-19 11:15:07 EDT
closing PR - fixed v>20040419
Comment 10 Masayuki Fuse CLA 2004-05-24 03:54:01 EDT
Hi, this problem is reappearing in I200405211200.
Comment 11 Christophe Cornu CLA 2004-05-25 13:55:57 EDT
Masayuki: is M9 failing too for you?
Are you trying to use the Browser from within Eclipse or stand-alone (or junit 
tests)?
Can you paste the error message?

M9 is working for me on RH EL3 with the update that instals Mozilla 1.4.2.

Comment 12 Masayuki Fuse CLA 2004-05-26 00:14:47 EDT
I just tried,
--launch a brand new eclipse, then Help > Help Contents
The help is opened in Mozilla 1.4.2

The preferences > Help page does not display "Always use external browsers" 
selection

There is no error come up. 
That occurs in M9 on ja_JP and en_US.UTF-8 locale.
My RHEL 3.0 installs latest update via RHN. I guess the level is Update 2 and 
some updates applied.
Comment 13 Christophe Cornu CLA 2004-05-26 09:30:56 EDT
Thanks for the feedback. Could you try running the BrowserExample plugin:

1. download the Example Plug-ins from the Eclipse website for M9
http://download.eclipse.org/downloads/drops/S-3.0M9-200405211200/download.php?
dropFile=eclipse-examples-3.0M9.zip
2. unzip it into the directory that contains your eclipse install.
3. start Eclipse. Open the Menu: Window > Show View > Other > SWT Examples. 
Select SWT Browser.

Do you get a working Browser or a message saying the Browser widget could not 
start?
Comment 14 Cherie Wong CLA 2004-05-26 11:39:51 EDT
I have tried our RHEL3.0.  No embedded help in M9.

Using 20040526-0800 build, no embedded help, and SWT browser exaple displays:
Error - The Browser widget could not be instantiated.  Please check the Browser
widget is supported on this platform.  Supported platforms and sotware
requirements for the Browser widget are listed on the SWT FAQ web page.
Comment 15 Konrad Kolosowski CLA 2004-05-26 11:45:04 EDT
Thanks Cherie, in reality it was me posting comment #14, but bugzilla have not 
bothered to ask me to log in.
Comment 16 Christophe Cornu CLA 2004-05-26 12:38:11 EDT
Konrad:

can you try running the following SWT snippet from within Eclipse M9 - and 
paste back the exception stack trace. I am trying to reproduce the problem on 
my RHEL3.

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.browser.*;

public class PRBrowser {

	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setText("PRBrowser");
		shell.setLayout(new FillLayout());
		Browser browser = new Browser(shell, SWT.NONE);
		browser.setUrl("http://www.eclipse.org");
		shell.open();
		
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}		
	}
}
Comment 17 Konrad Kolosowski CLA 2004-05-26 13:14:55 EDT
Exception in thread "main" org.eclipse.swt.SWTError: No more handles
(java.lang.UnsatisfiedLinkError:
/home/eclipse/eclipse-M9/eclipse/workspace/BrowserTest/libswt-mozilla-gtk-3052.so:
libxpcom.so: cannot open shared object file: No such file or directory)
	at org.eclipse.swt.SWT.error(SWT.java:2715)
	at org.eclipse.swt.SWT.error(SWT.java:2614)
	at org.eclipse.swt.browser.Browser.<init>(Browser.java:122)
	at PRBrowser.main(PRBrowser.java:15)
*** Stack trace of contained error ***
java.lang.UnsatisfiedLinkError:
/home/eclipse/eclipse-M9/eclipse/workspace/BrowserTest/libswt-mozilla-gtk-3052.so:
libxpcom.so: cannot open shared object file: No such file or directory
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2014)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1892)
	at java.lang.Runtime.loadLibrary0(Runtime.java:823)
	at java.lang.System.loadLibrary(System.java:885)
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:100)
	at org.eclipse.swt.browser.Browser.<init>(Browser.java:119)
	at PRBrowser.main(PRBrowser.java:15)
Comment 18 Christophe Cornu CLA 2004-05-26 14:13:37 EDT
Weird, it is still working for me with the latest RH EL3 update. Maybe the 
eclipse launcher is not setting the environment properly on your machine.

Konrad:

1. Can you paste the content of the file /etc/gre.conf
2. Assuming your Mozilla is /usr/lib/mozilla-1.4.2 can you:
- open a new terminal (don't reuse an existing one)
- csh
- setenv MOZILLA_FIVE_HOME /usr/lib/mozilla-1.4.2
- setenv LD_LIBRARY_PATH /usr/lib/mozilla-1.4.2
- eclipse
Does this work better?
(I am assuming you are starting eclipse with the eclipse launcher, not with 
the java command line. It is supposed to set these variables automatically on 
RH).
Comment 19 Konrad Kolosowski CLA 2004-05-26 14:40:12 EDT
1.
[1.4.2]
GRE_PATH=/usr/lib/mozilla-1.4.2

2.  Help does not work better.
Comment 20 Konrad Kolosowski CLA 2004-05-26 14:46:09 EDT
Chris,
There have been nothing (except Eclipse drops) installed on our machine since 
this bug was opened and fixed (for the first time).  So it looks like there is 
a regression in SWT.  Since Masayuki Fuse is not sharing machine with me and 
we both see the problem, I suspect there is some forgotten workaround applied 
to your machine that Masayuki Fuse or I do not have.
This problem is again RHEL3.0 specific as it works fine on my RH9.0.
Comment 21 Konrad Kolosowski CLA 2004-05-26 16:22:54 EDT
I installed latest updates from RHN, it did not fix the problem.
Comment 22 Christophe Cornu CLA 2004-05-26 17:06:03 EDT
Created attachment 11163 [details]
eclipse launcher for M9 with some debug info
Comment 23 Konrad Kolosowski CLA 2004-05-26 17:13:57 EDT
DEBUG ECLIPSE LAUNCHER
LD_LIBRARY_PATH <(null)>
MOZILLA_FIVE_HOME <(null)>
2- LD_LIBRARY_PATH </usr/lib/mozilla-1.4.2>
3- GRE PATH </usr/lib/mozilla-1.4.2>
Comment 24 Christophe Cornu CLA 2004-05-26 18:25:59 EDT
thanks - I've mailed you a test (attaching a 1Mo zip file to bugzilla crashes 
IE :-( to determine whether the problem is with the eclipse launcher or not.
Comment 25 Konrad Kolosowski CLA 2004-05-27 01:20:25 EDT
SWT - LD_LIBRARY_PATH </opt/IBMJava/IBMJava2-141/bin/../jre/bin:/opt/IBMJava/IBM
Java2-141/jre/bin/classic:/opt/IBMJava/IBMJava2-141/jre/bin>
SWT - MOZILLA_FIVE_HOME </usr/lib/mozilla-1.4.2>
Exception in thread "main" org.eclipse.swt.SWTError: No more handles (java.lang.
UnsatisfiedLinkError: /home/eclipse/58346/libswt-mozilla-gtk-3054.so: libxpcom.s
o: cannot open shared object file: No such file or directory)
        at org.eclipse.swt.SWT.error(SWT.java:2717)
        at org.eclipse.swt.SWT.error(SWT.java:2616)
        at org.eclipse.swt.browser.Browser.<init>(Browser.java:122)
        at Test.main(Test.java:17)
*** Stack trace of contained error ***
java.lang.UnsatisfiedLinkError: /home/eclipse/58346/libswt-mozilla-gtk-3054.so:
libxpcom.so: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2014)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1892)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:885)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:100)
        at org.eclipse.swt.browser.Browser.<init>(Browser.java:119)
        at Test.main(Test.java:17)
Comment 26 Christophe Cornu CLA 2004-05-27 10:06:07 EDT
The output differs from mine. In my case (JVM 1.4.2 b28), the JVM prepends its 
paths to the LD_LIBRARY_PATH - <VM paths>:/usrlib/mozilla-1.4.2 . In your 
case, it looks like the VM simply sets the LD_LIBRARY_PATH erasing any 
previous value.

What is the output of java -version in your case? Do you pass special 
arguments (it looks like you use the classic VM, not hotspot). Please email me 
how you got that VM.
Do you use the same JVM on both RH EL3 and RH9? This may explain why it fails 
in one case and not the other.
Comment 27 Konrad Kolosowski CLA 2004-05-27 10:35:54 EDT
Chris,
On My RH9.0 I have Sun JDK.
RHEL3.0 has IBM JDK.  I think it was installed from IBMJava2-SDK-1.4.1-
1.0.i386.rpm available from Java Information Manager - 
http://w3.hursley.ibm.com/java/JIM.html (IBM internal site).
I passed no extra arguments.
Comment 28 Konrad Kolosowski CLA 2004-05-27 12:17:21 EDT
I ran Eclipse on RHEL3.0 using Sun's JDK 1.4.2_04 and it worked.

output of java -version from IBM's JDK 1.4.1sr1 for which browser does not work is:

java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1)
Classic VM (build 1.4.1, J2RE 1.4.1 IBM build cxia321411-20030930 (JIT enabled:
jitc))

IBM's JDK 1.4.1.sr2 is not better in this regard.
Comment 29 Christophe Cornu CLA 2004-05-27 12:35:33 EDT
I've opened a bug report against the IBM VM and will update this PR based on 
what we decide to do.
Comment 30 Konrad Kolosowski CLA 2004-05-27 12:52:19 EDT
According to 
http://eclipse.org/eclipse/development/eclipse_project_plan_3_0.html, IBM 32-
bit SDK for Linux on Intel architecture, Java 2 Technology Edition, Version 
1.4.1 is one of the two supported JDKs.  Even if IBM JDK fixes the problem in 
the next release we still are in a need for a fix using this VM or change 
required level of supported JDK.
Comment 31 Christophe Cornu CLA 2004-05-28 16:12:17 EDT
Konrad, Masayuki: the current way to work around the VM bug is
- open a terminal
- csh
- setenv MOZILLA_FIVE_HOME /usr/../usr/lib/mozilla-1.4.2
- eclipse

This writing works around a bizarre parsing behaviour of this VM that affects 
the LD_LIBRARY_PATH entries. We will decide the final shape of the fix when we 
get more details about this VM parsing issue.

----
changing title from
[browser] Browser not working with default RH EL3 update 1
to
[browser] Browser not working with IBM VM java

This is a new problem. Since there is already a lot of history for this new 
problem, I won't open a separate PR.

Comment 32 Konrad Kolosowski CLA 2004-05-28 21:00:53 EDT
Thanks Christophe.
export MOZILLA_FIVE_HOME=/usr/../usr/lib/mozilla-1.4.2 (using default bash 
shell) works.
Comment 33 Masayuki Fuse CLA 2004-05-31 00:41:42 EDT
The export MOZILLA_FIVE_HOME=/usr/../usr/lib/mozilla-1.4.2 works on my 
RHEL3.0WS U2 on M9 and IBM JRE 1.4.2 cxia32dev-20040524.

On SLES9 Beta5, M9 and IBM JRE 1.4.2 cxia32dev-20040524, it works without the 
workaround.
Comment 34 Christophe Cornu CLA 2004-05-31 11:17:47 EDT
>On SLES9 Beta5, M9 and IBM JRE 1.4.2 cxia32dev-20040524, it works without 
>the workaround.
Yes. On this platform, Mozilla is usually installed in /opt/mozilla/lib and 
for some reason the VM bug does not touch this kind of path. It seems to 
remove entries that start with /lib or /usr/lib.
Comment 35 Steven Wasleski CLA 2004-06-04 14:51:45 EDT
I have pinged the VM team to get their opinion on the workaround and to find 
out when we might see a fix.  See Hursley defect 74242 for details if you have 
access.
Comment 36 Christophe Cornu CLA 2004-06-04 15:23:41 EDT
Thanks Steven. No I don't have access to this other database. Please let me 
(and/or Kevin Haaland) when you get details on this - even if they just send 
us the section of the code that does the parsing. We want to know which paths 
will fail and deduct the formatting that should be used to circumvent it.
Comment 37 Christophe Cornu CLA 2004-06-10 18:25:37 EDT
The VM bug has been confirmed. and is expected to be fixed in a future release.

This bug affects RedHat users. The SWT workaround is to set MOZILLA_FIVE_HOME 
to /usr/../usr/lib/mozilla-1.x instead of the default /usr/lib/mozilla-1.x

The following SWT FAQ documents this issue and the workaround:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-
home/faq.html#browserlinuxibm

Closing PR. This PR will be updated to notify which future version of the IBM 
VM contains the fix.
Comment 38 Steven Wasleski CLA 2004-06-14 13:19:29 EDT
I have been informed that the VM bug will be fixed in the IBM 1.4.2 JRE GM 
release.  The Hursley defect 74242 indicates that it was integrated into their 
build the evening of June 9th.

Christophe, please verify the fix as soon as possible.
Comment 39 Masayuki Fuse CLA 2004-06-18 04:36:17 EDT
I've verified the fix with IBM JVM 1.4.2 build date 20040616a on ja_JP locale.