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

Bug 304780

Summary: Eclipse hangs while using FileDialog
Product: [Eclipse Project] Platform Reporter: Praveen <pinnamur>
Component: SWTAssignee: Praveen <pinnamur>
Status: RESOLVED FIXED QA Contact: Carolyn MacLeod <carolynmacleod4>
Severity: normal    
Priority: P3 CC: eclipse.felipe, gheorghe, Silenio_Quarti, vilmar
Version: 3.6   
Target Milestone: 3.6 M7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Java core dump
none
Testcase - SWT Snippet
none
Patch v01 none

Description Praveen CLA 2010-03-05 03:36:29 EST
Eclipse always hangs when I attempt to import any project/archive. Infact, UI freezes when any filedialog is opened.
Suprisingly, when I tried to recreate the problem using standalone SWT (referencing to SWT jar files of the eclipse installation), FileDialog does not cause eclipse to hang.

Build id: N20100303-2000
Reproducible : Always
Comment 1 Praveen CLA 2010-03-05 05:25:36 EST
Created attachment 161095 [details]
Java core dump

Java core dump when the UI is freezed
Comment 2 Felipe Heidrich CLA 2010-03-05 09:52:52 EST
Works for me with this week I-build.
Praveen, get to the bottom of this problem, is it a problem on your machine ? what version of GTK / Linux are you running ?

my system:
Fedora 11, GTK 2.16
Build id: N20100302-0800
Comment 3 Praveen CLA 2010-03-05 10:03:33 EST
(In reply to comment #2)
> Works for me with this week I-build.
The problem has started from nightly build N20100303-2000

> Praveen, get to the bottom of this problem, is it a problem on your machine ?
I tried debugging this - the hang happens in the native function gtk_dialog_run() of DirectoryDialog. Also, this problem is not reproducible using a simple SWT snippet that launches DirectoryDialog with same style/settings as Import wizard do.
So, I am not sure whether there is a deadlock in eclipse at Platform UI level when the dialog is launched.

> what version of GTK / Linux are you running ?
I'm on Ubuntu9.04 (GTKv2.16) and the problem is reproducible on Ubuntu9.10 as well - when the eclipse is self-hosted using the latest HEAD as well.
So, you should be able to see the problem on build N20100303-2000
Comment 4 Felipe Heidrich CLA 2010-03-05 10:21:11 EST
(In reply to comment #3)
> (In reply to comment #2)
> > Works for me with this week I-build.
> The problem has started from nightly build N20100303-2000

Works for me on N20100304-2130
Comment 5 Praveen CLA 2010-03-08 10:47:38 EST
(In reply to comment #4)
> Works for me on N20100304-2130
Unfortunately, the problem is still visible with I20100305-1011 on Ubuntu machines (both 9.04 and 9.10) here. I am slightly concerned whether the problem happens on only Ubuntu machines itself.
Comment 6 Grant Gayed CLA 2010-03-08 11:00:39 EST
(Bogdan says:) Tried out I20100307-2000 on our Ubuntu, file dialogs were fine.
Comment 7 Markus Keller CLA 2010-04-06 08:07:08 EDT
*** Bug 307967 has been marked as a duplicate of this bug. ***
Comment 8 Felipe Heidrich CLA 2010-04-06 09:11:36 EDT
Praveen, do you hava assistive Technologies enabled ?
See Bug 307967
Comment 9 Praveen CLA 2010-04-06 14:12:14 EDT
Yes Felipe - You are right ! I realized that this problem happens only when the assistive technologies are enabled.
Once I disable them, all native file/directory dialogs works without any issues. Please note that the workspace selection file dialog does not hang even if the assistive technologies are ON. So, I guess the problem crops up after eclipse load the accessibility stuff.
Comment 10 Felipe Heidrich CLA 2010-04-06 14:59:08 EDT
Praveen, this is important. Please find out what our code is doing to cause this problem. Thank you.
Comment 11 jose vilmar estacio de souza CLA 2010-04-06 15:12:15 EDT
I have all concerned that this bug is resolved as quickly as possible. Anything I can do to help?
Comment 12 Praveen CLA 2010-04-07 14:22:34 EDT
Created attachment 164107 [details]
Testcase - SWT Snippet

Turn on the Assistive Technologies.
Run the SWT snippet - file/directory dialog hangs and does not respond further. I suspect this is caused due to the new code added into Accessibility (around 2nd March, 2010).
The problem happens when a Accessibility listener is added to Text control and then the fileDialog (as it contains a text widget for path/fileName) is popped up in the application.
Comment 13 Praveen CLA 2010-04-07 15:04:55 EDT
I just figured out that the problem was actually caused due to registering Entry widget with ATK through atk_registry_set_factory_type() in AccessibleFactory.registerAccessible(). May be, this info is helpful for digging further.
Comment 14 Silenio Quarti CLA 2010-04-07 16:45:41 EDT
I cannot reproduce this problem with Ubuntu 9.10

orca version: 2.28.1-0ubuntu1
atk version: 1.28.0-0ubuntu1
gtk version: 2.18.3-1ubuntu2.2

The bug#307967 has slightly different versions. Is this the reason why I cannot reproduce it? Or am I just missing some step?

Praveen what versions are you running?
Comment 15 Praveen CLA 2010-04-08 10:24:25 EDT
(In reply to comment #14)
> Praveen what versions are you running?
I am able to recreate the problem on both Ubuntu 9.04 and 9.10
Comment 16 Silenio Quarti CLA 2010-04-08 10:59:57 EDT
(In reply to comment #15)
> (In reply to comment #14)
> > Praveen what versions are you running?
> I am able to recreate the problem on both Ubuntu 9.04 and 9.10

Does your Ubuntu 9.10 have the exact same versions of atk, gtk and orca as mine?
Comment 17 Praveen CLA 2010-04-09 01:02:40 EDT
(In reply to comment #16)
> Does your Ubuntu 9.10 have the exact same versions of atk, gtk and orca as
> mine?
Yes! the versions are exactly matching. Initially I couldn't reproduce the hang though the Assistive Technologies are ON. So, I have to atleast logout (or restart) the system to affect the state of Assistive Tech as ON. I suspect that might be missing on your end as well.
Comment 18 Silenio Quarti CLA 2010-04-09 14:05:55 EDT
I did logout and I still cannot reproduce it. Praveen, please investigate this further (since you have the only machine that can reproduce it).

The code in AccessibleFactory.registerAccessible() has changed a lot, but we have been changing the ATK factory for GtkEntry even before the changes in March 2010. So it must be some change in the AtkText callbacks of AccessibleObject (i.e atkText_* methods) or in AccessibleFactory.atkObjectFactory_create_accessible().

You can turn on AccessibleObject.DEBUG. This will show which call backs are being called.
Comment 19 jose vilmar estacio de souza CLA 2010-04-11 05:28:27 EDT
Using eclipse-SDK-N20100409-2000-linux-gtk-x86_64.tar.gz under ubuntu 10.04.
There are at least three situations in which i can reproduce this problem.

The first happens when I try to add a jar file in a system library. Eclipse hangs after I click in add jars button.

The second happens if I try to install a new software and decide to add a local/archive repository. Eclipse hangs when I click in the local button.

The third happens when I try to open a file using eclipse, but it only happens after I have tried to import a project from an archive.
Try the following steps:
1. Launch eclipse and choose an empty workspace.
2. Press alt+f and press the down key until you find the import menu.
3. Press the enter key.
4. Expand the general tree, choose archive file and press the enter key.
5. Press the escape key to abort.
6. Press alt+f end using the down key choose open file and press the enter key.
After execute the step number 6 eclipse hangs and I have to kill java.
Comment 20 Praveen CLA 2010-04-12 11:14:17 EDT
Created attachment 164572 [details]
Patch v01

Silenio, Please review the patch and post your comments. Thanks.
Comment 21 Carolyn MacLeod CLA 2010-04-12 11:27:41 EDT
Praveen, does this patch keep your system from hanging?
Were you able to try it with Jose's three situations in comment 19?
Comment 22 Silenio Quarti CLA 2010-04-12 11:30:14 EDT
I understand now why I could not reproduce the problem. My FileDialog was not showing the "Location" entry field. When I toogle the button to show it, I get the hang.
Comment 23 Silenio Quarti CLA 2010-04-12 11:31:20 EDT
(In reply to comment #21)
> Praveen, does this patch keep your system from hanging?
> Were you able to try it with Jose's three situations in comment 19?

yes, it does. We were debugging it together.
Comment 24 Silenio Quarti CLA 2010-04-12 11:54:04 EDT
Fixed > 20100412. I released the patch so that it goes in today's I-build.
Comment 25 jose vilmar estacio de souza CLA 2010-04-13 07:36:54 EDT
(In reply to comment #24)
> Fixed > 20100412. I released the patch so that it goes in today's I-build.

Tested and approved!
Thanks Guys.
Comment 26 jose vilmar estacio de souza CLA 2010-04-15 09:51:54 EDT
Maybe I I should open another bug to report the problem I encountered, however it seems like the current one.

Eclipse hangs when I try switch to another workspace.
To reproduce try the following steps:
1. Make sure that assistive technologies is enabled and launch orca.
2. Launch eclipse and choose a workspace.
3. Press alt+f and look for switch to workspace in the menu.
4. Press the right arrow key and choose other.
5. Type a name and press the enter key.

Two things happen:
Orca is completly silent and I have to restart it.

No screen related to eclipse is shown and I have to kill it.

Please, let me know if this should be reported in another bug.
Comment 27 Praveen CLA 2010-04-16 03:29:06 EDT
(In reply to comment #26)
> Orca is completly silent and I have to restart it.
> No screen related to eclipse is shown and I have to kill it.
> 
> Please, let me know if this should be reported in another bug.
I am not able to reproduce it on Ubuntu(Gtkv2.16). I see that Eclipse (I20100414-1200) works fine with the provided reproducible steps. Since the reported problem  of this bug has already been resolved, please raise a different bug for handling the problem you are seeing.
Please provide the GTK version, distro of Linux, eclipse build-ID for our further investigation.