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

Bug 325952

Summary: swt browser fails if $HOME contains a symbolic link symlink
Product: [Eclipse Project] Platform Reporter: c.handel
Component: SWTAssignee: Grant Gayed <grant_gayed>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description c.handel CLA 2010-09-22 08:09:25 EDT
Build Identifier: I2010608-911 helios

if a users home directory contains a symlink (like user builder's home is /builder and /builder links to /home/builder) 

The first time eclipse is started and displays a SWT-Browser widget (like the welcome screen) it registers with xul. 

On the second time (or any later) start of eclipse access to a SWT-Browser widget will result in an XPCOM error.

eclipse helios on 64bit linux rhel5.5 with 64bit jdk 1.6.0_21. Tested xulrunner 1.9.2.7 and 1.9.2.9.

Reproducible: Always

Steps to Reproduce:
0) have a user with a symlink in the path to his $HOME

somethink like this

useradd -d /tmp/builder -m
mv /tmp/builder /home
ln -s /home/builder /tmp/builder

1) get the DisplayMozilla code from
http://www.eclipse.org/swt/faq.php#printmozillapath

2) get an eclipse (classic) unpack

3) compile 
javac  -cp .:/eclipse-helios/plugins/org.eclipse.swt.gtk.linux.x86_64_3.6.0.v3650b.jar DisplayMozillaVersion.java

4) run it
java  -cp .:/eclipse-helios/plugins/org.eclipse.swt.gtk.linux.x86_64_3.6.0.v3650b.jar DisplayMozillaVersion


First run

>>>Snippet creating SWT.MOZILLA-style Browser
XULRunner path: /usr/lib64/xulrunner-1.9.2/libxpcom.so
>>>succeeded

Second Run (and any other)
>>>Snippet creating SWT.MOZILLA-style Browser
XULRunner path: /usr/lib64/xulrunner-1.9.2/libxpcom.so
>>>succeeded
Exception in thread "main" org.eclipse.swt.SWTError: XPCOM error -2147467262
        at org.eclipse.swt.browser.Mozilla.error(Mozilla.java:2347)
        at org.eclipse.swt.browser.Mozilla.unhookDOMListeners(Mozilla.java:2777)
        at org.eclipse.swt.browser.Mozilla.onDispose(Mozilla.java:2370)
        at org.eclipse.swt.browser.Mozilla$5.handleEvent(Mozilla.java:872)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1263)
        at org.eclipse.swt.widgets.Widget.release(Widget.java:1080)
        at org.eclipse.swt.widgets.Control.release(Control.java:3302)
        at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1293)
        at org.eclipse.swt.widgets.Canvas.releaseChildren(Canvas.java:208)
        at org.eclipse.swt.widgets.Decorations.releaseChildren(Decorations.java:469)
        at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:2303)
        at org.eclipse.swt.widgets.Widget.release(Widget.java:1083)
        at org.eclipse.swt.widgets.Control.release(Control.java:3302)
        at org.eclipse.swt.widgets.Widget.dispose(Widget.java:462)
        at org.eclipse.swt.widgets.Shell.dispose(Shell.java:2239)
        at org.eclipse.swt.widgets.Display.release(Display.java:3221)
        at org.eclipse.swt.graphics.Device.dispose(Device.java:237)
        at DisplayMozillaVersion.main(DisplayMozillaVersion.java:27)

With the jar of eclipse galileo there is no problem.

Removing $HOME/.mozilla/eclipse allows one successful run.
Comment 1 c.handel CLA 2010-09-22 08:31:23 EDT
for step 0) it is enough to move .mozilla

cd $HOME; mv .mozilla mozilla; ln -s mozilla .mozilla
Comment 2 Alexander Kurtakov CLA 2017-12-06 02:36:18 EST
This bug is against really old SWT version with no longer supported Browser backend. Closing. Please reopen if it still happens on supported versions for you.