| Summary: | VE will be hang up when reopen the workspace | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Huo Zhen Zhong <huozz> | ||||||
| Component: | EDT | Assignee: | Justin Spadea <jspadea> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P1 | CC: | chenzhh, jinfahua, jspadea, pharmon, svihovec, xiaobinc | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Huo Zhen Zhong
This is a thread dead lock, when open VE, the workingCopyCompiler Thread and the WidgetDescriptorFactory Thread will access IR model at the same time, in this case, when use SUN JRE, it will dead lock in the class loader. Add below Arguments to SUN JRE can avoid this problem: -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass Brian, I think we need to add the two arguments to EDT when SUN JRE is used. Are there any recommendations from Eclipse on adding these vm args when using a Sun JRE? While this may solve the problem, I'm not sure anyone will see the information before they run into a problem. I have subscribed Paul and Justin, since I believe we have heard of this deadlock issue before. What code are both teh WCC and WDF accessing, and should that code be synchronized? We really need to solve this and not require JVM arguments. Users aren't going to know to add that to eclipse.ini - they'll just say "it keeps freezing, I'm done using this product". The previous deadlock was caused by plug-in dependency activation where two threads (one UI and one plug-in startup) were loading the same MOF classes. Removing system eglar initialization when the mof plug-in was initialized removed this deadlock. There are many threads that can initiate Mof model, actually any thread that uses Mof model will initialize it (and loading the classes) if Mof has not been initialized when it is needed in that thread. Below is some I'm aware of.
Main thread. (for example, opening VE will start a WCC which needs Mof)
The thread to initialize VE Palette (this one and the above one are cause the problems forest is seeing.
ProblemReconciler thread
Build thread
Sun JRE has known issues when multiple threads are trying to load dependent classes. Here's one bug about that.
Bug 121737 - Class cycles may cause loading deadlocks
The arguments Forest mentioned is one way to avoid this.
Besides ClassLoader, Mof model's initialization code is not thread safe. I have a bug about this
Bug 357642 - Bootstrap initialization not thread safe
I think one option for us is to initialize Mof before any EDT plugin will use that. Then we can avoid both problems.
I've modified the following to make initialization of system libraries synchronized: BaseCompiler.java IDEBaseCompiler.java SystemEnvironmentManager.java This seems to have done the trick but I'm going to leave this open for a few days and continue running with Sun to see if I still hit any freezes. If anyone else still has freezes then please provide the steps to reproduce (or describe what you were doing when it happened). If you run in debug mode you can suspend the target which causes all threads to suspend, then manually expand each thread to see its stack, and finally when they're all expanded right-click on the tree and select "Copy Stack". You can paste the contents into here to show exactly what was running when it happened. I haven't hit any deadlocks since my fix went in. verified in 0.7.0.v201111132101 Created attachment 207081 [details]
log 1
Created attachment 207082 [details]
log 2
Hi, Justin, after remove the sun jre arguments, Xiao Bin and Rokey has meet the a problem that eclipse will be crashed using VE, I have attached the logs. What browser is being used by the VE (specific version)? Does the IBM JRE crash? (In reply to comment #12) > What browser is being used by the VE (specific version)? Does the IBM JRE > crash? I'm using the WebKit, which is set to default after installing the Safari 5.1.1. (In reply to comment #13) > (In reply to comment #12) > > What browser is being used by the VE (specific version)? Does the IBM JRE > > crash? > > I'm using the WebKit, which is set to default after installing the Safari > 5.1.1. It looks like the problem does not happen when configured with IE 6. What you've reported is a separate issue from the deadlock. I've opened bug 364058 to track it. close base on comment 15 |