| Summary: | Deadlock in text editor | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Alain Lee <a-lee> |
| Component: | Text | Assignee: | Platform-Text-Inbox <platform-text-inbox> |
| Status: | RESOLVED NOT_ECLIPSE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, nsand.dev, rakes123, remy.suen, thatnitind |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Alain Lee
(In reply to comment #0) > com.ti.ccstudio.system.setup.ui.editors.MultiPageXMLEditor$1.modelChanged(MultiPageXMLEditor.java:178) What kind of files do you have open? XML? (In reply to comment #1) > (In reply to comment #0) > > com.ti.ccstudio.system.setup.ui.editors.MultiPageXMLEditor$1.modelChanged(MultiPageXMLEditor.java:178) > What kind of files do you have open? XML? Yes Please attach the full stack trace and provide either steps or the test. Which build ID? Moving to WTP since it happens with the XML editor. (In reply to comment #3) > Please attach the full stack trace and provide either steps or the test. > Which build ID? > Moving to WTP since it happens with the XML editor. Version: 3.6.0 Build id: I20100312-1448 Actually, it is not the XML editor. We have our own MultiPageXMLEditor that extneds from AbstractFormEditor. It happens randomly in our automated tests when changes were made to the editor immediately after it was opened. We tried the following steps manually and was able to reproduce: 1. Put a breakpoint inside the Job at org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.initialize(). The job should be halted after it acquires the lock on DocumentLineDiffer.this. 2. Open our MultiPageXMLEditor to edit a file. 3. Make changes on the editor. 4. Now, the UI is frozen and the main thread is waiting for DocumentLineDiffer. 5. Resume the job in org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.initialize(). 6. The UI was frozen forever. We captured the following trace: Thread [main] (Suspended) owns: Object (id=9270) waited by: Thread [Worker-4] (Suspended) waiting for: DocumentLineDiffer (id=9259) owned by: Thread [Worker-4] (Suspended) DocumentLineDiffer.documentAboutToBeChanged(DocumentEvent) line: 746 SynchronizableDocument(AbstractDocument).fireDocumentAboutToBeChanged(DocumentEvent) line: 665 SynchronizableDocument(AbstractDocument).replace(int, int, String, long) line: 1182 SynchronizableDocument.replace(int, int, String, long) line: 195 SynchronizableDocument(AbstractDocument).replace(int, int, String) line: 1210 SynchronizableDocument.replace(int, int, String) line: 181 MultiPageXMLEditor.saveUndoInfo() line: 646 MultiPageXMLEditor.saveUndoInfo(String) line: 610 SetupPropertyListDetails.saveUndoInfo(String) line: 347 SetupPropertyListDetails.access$1(SetupPropertyListDetails, String) line: 345 SetupPropertyListDetails$PropertyDataProvider.setValue(Object, String) line: 112 SetupPropertyListDetails$PropertyDataProvider.setFlag(Object, boolean) line: 135 CheckBoxPropertyField$1.widgetSelected(SelectionEvent) line: 34 TypedListener.handleEvent(Event) line: 234 EventTable.sendEvent(Event) line: 84 Button(Widget).sendEvent(Event) line: 1053 Display.runDeferredEvents() line: 4066 Display.readAndDispatch() line: 3657 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2629 Workbench.runUI() line: 2593 Workbench.access$4(Workbench) line: 2427 Workbench$7.run() line: 670 Realm.runWithDefault(Realm, Runnable) line: 332 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 663 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149 CCSWorkbench(IDEApplication).start(IApplicationContext) line: 115 EclipseAppHandle.run(Object) line: 196 EclipseAppLauncher.runApplication(Object) line: 110 EclipseAppLauncher.start(Object) line: 79 EclipseStarter.run(Object) line: 369 EclipseStarter.run(String[], Runnable) line: 179 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 585 Main.invokeFramework(String[], URL[]) line: 619 Main.basicRun(String[]) line: 574 Main.run(String[]) line: 1407 Main.main(String[]) line: 1383 Thread [Worker-4] (Suspended) owns: DocumentLineDiffer (id=9259) waited by: Thread [main] (Suspended) waiting for: Object (id=9270) owned by: Thread [main] (Suspended) AnnotationMap.keySetIterator() line: 82 AnnotationModel.getAnnotationIterator(boolean) line: 783 AnnotationModel.getAnnotationIterator(boolean, boolean) line: 758 AnnotationModel.getAnnotationIterator() line: 690 MultiPageXMLEditor$1.modelChanged(IAnnotationModel) line: 178 AnnotationModel.fireModelChanged(AnnotationModelEvent) line: 614 AnnotationModel$InternalModelListener.modelChanged(AnnotationModelEvent) line: 261 DocumentLineDiffer.fireModelChanged(AnnotationModelEvent) line: 1526 DocumentLineDiffer.fireModelChanged() line: 1509 DocumentLineDiffer$2.run(IProgressMonitor) line: 545 Worker.run() line: 54 (In reply to comment #3) > Please attach the full stack trace and provide either steps or the test. > Which build ID? > Moving to WTP since it happens with the XML editor. I meant MultiPageXMLEditor extends from FormEditor. (In reply to comment #4) > (In reply to comment #3) > > Please attach the full stack trace and provide either steps or the test. > > Which build ID? > > Moving to WTP since it happens with the XML editor. > Version: 3.6.0 > Build id: I20100312-1448 > Actually, it is not the XML editor. We have our own MultiPageXMLEditor that > extneds from AbstractFormEditor. It happens randomly in our automated tests > when changes were made to the editor immediately after it was opened. We tried > the following steps manually and was able to reproduce: > 1. Put a breakpoint inside the Job at > org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.initialize(). > The job should be halted after it acquires the lock on DocumentLineDiffer.this. > 2. Open our MultiPageXMLEditor to edit a file. > 3. Make changes on the editor. > 4. Now, the UI is frozen and the main thread is waiting for DocumentLineDiffer. > 5. Resume the job in > org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.initialize(). > 6. The UI was frozen forever. > We captured the following trace: > Thread [main] (Suspended) > owns: Object (id=9270) > waited by: Thread [Worker-4] (Suspended) > waiting for: DocumentLineDiffer (id=9259) > owned by: Thread [Worker-4] (Suspended) > DocumentLineDiffer.documentAboutToBeChanged(DocumentEvent) line: 746 > > SynchronizableDocument(AbstractDocument).fireDocumentAboutToBeChanged(DocumentEvent) > line: 665 > SynchronizableDocument(AbstractDocument).replace(int, int, String, long) > line: 1182 > SynchronizableDocument.replace(int, int, String, long) line: 195 > SynchronizableDocument(AbstractDocument).replace(int, int, String) line: > 1210 > SynchronizableDocument.replace(int, int, String) line: 181 > MultiPageXMLEditor.saveUndoInfo() line: 646 > MultiPageXMLEditor.saveUndoInfo(String) line: 610 > SetupPropertyListDetails.saveUndoInfo(String) line: 347 > SetupPropertyListDetails.access$1(SetupPropertyListDetails, String) line: > 345 > SetupPropertyListDetails$PropertyDataProvider.setValue(Object, String) > line: 112 > SetupPropertyListDetails$PropertyDataProvider.setFlag(Object, boolean) > line: 135 > CheckBoxPropertyField$1.widgetSelected(SelectionEvent) line: 34 > TypedListener.handleEvent(Event) line: 234 > EventTable.sendEvent(Event) line: 84 > Button(Widget).sendEvent(Event) line: 1053 > Display.runDeferredEvents() line: 4066 > Display.readAndDispatch() line: 3657 > Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2629 > Workbench.runUI() line: 2593 > Workbench.access$4(Workbench) line: 2427 > Workbench$7.run() line: 670 > Realm.runWithDefault(Realm, Runnable) line: 332 > Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 663 > PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149 > CCSWorkbench(IDEApplication).start(IApplicationContext) line: 115 > EclipseAppHandle.run(Object) line: 196 > EclipseAppLauncher.runApplication(Object) line: 110 > EclipseAppLauncher.start(Object) line: 79 > EclipseStarter.run(Object) line: 369 > EclipseStarter.run(String[], Runnable) line: 179 > NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not > available [native method] > NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 > DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 > Method.invoke(Object, Object...) line: 585 > Main.invokeFramework(String[], URL[]) line: 619 > Main.basicRun(String[]) line: 574 > Main.run(String[]) line: 1407 > Main.main(String[]) line: 1383 > Thread [Worker-4] (Suspended) > owns: DocumentLineDiffer (id=9259) > waited by: Thread [main] (Suspended) > waiting for: Object (id=9270) > owned by: Thread [main] (Suspended) > AnnotationMap.keySetIterator() line: 82 > AnnotationModel.getAnnotationIterator(boolean) line: 783 > AnnotationModel.getAnnotationIterator(boolean, boolean) line: 758 > AnnotationModel.getAnnotationIterator() line: 690 > MultiPageXMLEditor$1.modelChanged(IAnnotationModel) line: 178 > AnnotationModel.fireModelChanged(AnnotationModelEvent) line: 614 > AnnotationModel$InternalModelListener.modelChanged(AnnotationModelEvent) > line: 261 > DocumentLineDiffer.fireModelChanged(AnnotationModelEvent) line: 1526 > DocumentLineDiffer.fireModelChanged() line: 1509 > DocumentLineDiffer$2.run(IProgressMonitor) line: 545 > Worker.run() line: 54 > (In reply to comment #3) > > Please attach the full stack trace and provide either steps or the test. > > Which build ID? > > Moving to WTP since it happens with the XML editor. WTP is not involved here , since it is not wtp's editor.It looks like a synchronization issue between SynchronizableDocument ,AnnotationMap and DocumentLineDiffer. (In reply to comment #6) > WTP is not involved here , since it is not wtp's editor.It looks like a Please read comment 5: I meant MultiPageXMLEditor extends from FormEditor. (In reply to comment #7) > (In reply to comment #6) > > WTP is not involved here , since it is not wtp's editor.It looks like a > Please read comment 5: I meant MultiPageXMLEditor extends from FormEditor. This MultiPageXMLEditor is com.ti.ccstudio.system.setup.ui.editors.MultiPageXMLEditor. As far as I can tell from the stacktraces, nothing from SSE is involved. I think this might be better suited for Text. > com.ti.ccstudio.system.setup.ui.editors.MultiPageXMLEditor. As far as I can
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Please file the bug there.
(In reply to comment #9) > > com.ti.ccstudio.system.setup.ui.editors.MultiPageXMLEditor. As far as I can > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Please file the bug there. There must be a synchronization issue between SynchronizableDocument, AnnotationMap and DocumentLineDiffer. MultiPageXMLEditor only called SynchronizableDocument.replace() and the UI thread got frozen forever. MultiPageXMLEditor has not know whether the initialization job in DocumentLineDiffer is completed so it cannot delay the call to SynchronizableDocument.replace(). I can't find a better way to put a fix in MultiPageXMLEditor. The indicated build in comment 0 (Helio) does not match with the build ID given in comment 4: >Version: 3.6.0 >Build id: I20100312-1448 Please retry with 3.6.1 and if the problem can still be reproduced, attach the steps and/or test case here. Otherwise there's nothing we can do. (In reply to comment #11) > The indicated build in comment 0 (Helio) does not match with the build ID given > in comment 4: > >Version: 3.6.0 > >Build id: I20100312-1448 > Please retry with 3.6.1 and if the problem can still be reproduced, attach the > steps and/or test case here. Otherwise there's nothing we can do. As I said, this only happens in our automated tests when all usrs actions were performed very fast. I can't find an easy way to reproduce it manually other than the steps I mentioned previously. It is very unlikely that this situation will happen in our customers sites. We can workaround it in our automated tests. > As I said, this only happens in our automated tests when all usrs actions were
> performed very fast.
Did you try with 3.6.1?
|