Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313769 - [cdt][performance] task focused Project Explorer sometimes hang when opened for the first time
Summary: [cdt][performance] task focused Project Explorer sometimes hang when opened f...
Status: CLOSED DUPLICATE of bug 315618
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Shawn Minto CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 12:59 EDT by Marc-André Laperle CLA
Modified: 2010-06-04 12:44 EDT (History)
3 users (show)

See Also:


Attachments
Stack (21.65 KB, text/plain)
2010-05-21 10:21 EDT, Marc-André Laperle CLA
no flags Details
New stack (34.16 KB, text/plain)
2010-05-23 00:49 EDT, Marc-André Laperle CLA
eclipse.sprigogin: iplog-
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2010-05-20 12:59:05 EDT
Build id: 20100506-2000

CDT 7.0.0.20100503 (M7?)
Mylyn 3.3.3.20100330

I remember this happening with previous versions also. When the Project Explorer is opened for the first time and it is focused, sometimes it hangs and I have to restart Eclipse several times. I'll try to add more info.
Comment 1 Shawn Minto CLA 2010-05-20 13:56:11 EDT
Hi Marc-Andre, Any more information that you can provide to reproduce this or track down the issue would be great.  The next time that it hangs, you could try using jstack from the Sun JDK to capture a stack trace of what is happening currently and attach it to this bug.  Here is some information on jstack:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstack.html
Comment 2 Marc-André Laperle CLA 2010-05-21 10:21:46 EDT
Created attachment 169504 [details]
Stack

Weird, I don't see Mylyn in the stack.
Comment 3 Marc-André Laperle CLA 2010-05-23 00:49:13 EDT
Created attachment 169604 [details]
New stack

I can reproduce this on a different PC, workspace and project. In this new stack dump, we can see Mylyn. I'll try to narrow down the steps and provide a sample project if necessary.
Comment 4 Shawn Minto CLA 2010-05-25 12:21:12 EDT
Hi Marc-Andre,

Any more information that you can provide is great!  What it looks like to me is that the expansion of elements in the Project Explorer is causing the CDT indexer to run in the UI thread and therefore lock up Eclipse until it is complete.  From the first stack trace that you provided, it seems that this can occur without Mylyn installed.  Maybe we should raise this with CDT as well?
Comment 5 Marc-André Laperle CLA 2010-05-25 16:04:19 EDT
Here's some steps to reproduce the bug:

1. Get the Ogre source code, http://www.ogre3d.org/download/source (OGRE 1.6.5 Source For Windows)
2. Create a empty C++ project with the extracted folder
3. Create a local task, activate it, open a couple of files
4. Restart Eclipse a couple of times with the task still activated and it should "hang"

This is on Windows 7 64, using the MinGW toolchain but it probably doesn't matter.

(In reply to comment #4)
> From the first stack trace that you provided, it seems that this can
> occur without Mylyn installed.  Maybe we should raise this with CDT as well?

Maybe, although I've only seen this bug using Mylyn, the problem might be in CDT.
Comment 6 Marc-André Laperle CLA 2010-05-30 01:44:26 EDT
(In reply to comment #4)
> What it looks like to me is that the expansion of elements in the Project 
> Explorer is causing the CDT indexer to run in the UI thread and therefore lock > Eclipse until it is complete.

But wouldn't it happen every time? Also, one of my test projects is only around 10K LoC so if it was actually indexing as usual, it would complete in a reasonable amount of time (around 30 secs when I rebuild the index). I left it running for 30 mins and it was still locked.

(In reply to comment #5)
> This is on Windows 7 64, using the MinGW toolchain but it probably doesn't
> matter.

I can also reproduce this on Mac OS X.

It happens more often with the two (completely different) projects I have but unfortunately I can't share them.
Comment 7 Shawn Minto CLA 2010-05-31 12:15:24 EDT
Hi Marc-Andre,

We will have to look into this further to figure out what is going on.  As a temporary work around, could you try disabling the auto-focus views and auto-expand preferences in Window > Preferences > Tasks > Context and see if that helps?  Also, if this happens only on startup, try disabling task activation on startup by adding the following parameter to the top of you eclipse.ini file:

-no-activate-task
Comment 8 Marc-André Laperle CLA 2010-06-02 21:08:29 EDT
(In reply to comment #7)
> could you try disabling the auto-focus views and auto-expand preferences in 
> Window > Preferences > Tasks > Context and see if that helps?  

I only disabled auto-focus and it definitely helps. Thanks!

> Also, if this happens only on startup, 

It also happens if I go to the Planning perspective (without Project
Explorer view visible), activate a task then switch back to C/C++. Then the tree tries to focus and expand but it hangs.
Comment 9 Marc-André Laperle CLA 2010-06-02 22:35:37 EDT
So far what we know:
- To reproduce, open Eclipse with a task-focused Project Explorer OR activate a task in the Planning perspective and switch back to C/C++ (with Project Explorer visible).
- Only certain CDT projects are affected (a simple Hello world project won't work). It's probably easier to reproduce the bigger the project are.
- Happens more frequently (maybe only?) when auto-focus is on
- It seems to be related to the indexer and the UI
- Not OS specific
- I remember this happening also with CDT 6.0.2

I'll poke around the code but this is very much unknown territory for me.
Comment 10 Shawn Minto CLA 2010-06-03 12:57:36 EDT
Hi Marc-Andre, Thanks for all of the great information!  I think that we may have tracked what you are seeing.  Just to confirm, are you seeing this on Eclipse 3.6 (Helios)?

For more information see:
315618: common navigator working set filter changes remove focus filter on startup causing expand all for everything in the project explorer
https://bugs.eclipse.org/bugs/show_bug.cgi?id=315618
Comment 11 Marc-André Laperle CLA 2010-06-04 09:06:17 EDT
(In reply to comment #10)
> Hi Marc-Andre, Thanks for all of the great information!  I think that we may
> have tracked what you are seeing.  Just to confirm, are you seeing this on
> Eclipse 3.6 (Helios)?
> 
> For more information see:
> 315618: common navigator working set filter changes remove focus filter on
> startup causing expand all for everything in the project explorer
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=315618

Yes, I think it only happens in 3.6. I will test the fix in bug 315618.
Comment 12 Shawn Minto CLA 2010-06-04 11:26:46 EDT
Great!  Let me know how this goes for you so we can determine if this bug can be closed or not.
Comment 13 Marc-André Laperle CLA 2010-06-04 12:44:41 EDT
(In reply to comment #12)
> Great!  Let me know how this goes for you so we can determine if this bug can
> be closed or not.

I tried to reproduce the bug 20 times with my biggest project and everything went fine. Thanks for the quick response and fix!

*** This bug has been marked as a duplicate of bug 315618 ***