Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347558 - Investigate why SaveableCompareEditorInput.handleDispose() method is called multiple times
Summary: Investigate why SaveableCompareEditorInput.handleDispose() method is called m...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P2 major with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 367234 370346 372005 395073 397759 402197 403253 409813 418131 443557 448969 449613 451022 454060 456097 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-28 15:39 EDT by James Blackburn CLA
Modified: 2020-06-09 16:00 EDT (History)
22 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Blackburn CLA 2011-05-28 15:39:01 EDT
I got this in 3.7RC3:

  Eclipse SDK	3.7.0.I20110526-1708	org.eclipse.sdk.ide

java.lang.IllegalArgumentException
	at org.eclipse.core.runtime.ListenerList.remove(ListenerList.java:155)
	at org.eclipse.compare.structuremergeviewer.DiffNode.removeCompareInputChangeListener(DiffNode.java:124)
	at org.eclipse.team.ui.synchronize.SaveableCompareEditorInput.handleDispose(SaveableCompareEditorInput.java:209)
	at org.eclipse.compare.CompareEditorInput$4.widgetDisposed(CompareEditorInput.java:578)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:123)
	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:3475)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1294)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1083)
	at org.eclipse.swt.widgets.Control.release(Control.java:3475)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1294)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1083)
	at org.eclipse.swt.widgets.Control.release(Control.java:3475)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1294)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1083)
	at org.eclipse.swt.widgets.Control.release(Control.java:3475)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1294)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1083)
	at org.eclipse.swt.widgets.Control.release(Control.java:3475)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:462)
	at org.eclipse.ui.internal.PartPane.dispose(PartPane.java:180)
	at org.eclipse.ui.internal.WorkbenchPartReference.dispose(WorkbenchPartReference.java:681)
	at org.eclipse.ui.internal.WorkbenchPage.disposePart(WorkbenchPage.java:1797)
	at org.eclipse.ui.internal.WorkbenchPage.handleDeferredEvents(WorkbenchPage.java:1501)
	at org.eclipse.ui.internal.WorkbenchPage.deferUpdates(WorkbenchPage.java:1485)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1459)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1514)
	at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:61)
	at org.eclipse.ui.internal.PartStack.close(PartStack.java:537)
	at org.eclipse.ui.internal.EditorStack.close(EditorStack.java:206)
	at org.eclipse.ui.internal.PartStack$1.close(PartStack.java:120)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:83)
	at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:269)
	at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:278)
	at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1(DefaultTabFolder.java:1)
	at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$1.closeButtonPressed(DefaultTabFolder.java:71)
	at org.eclipse.ui.internal.presentations.PaneFolder.notifyCloseListeners(PaneFolder.java:631)
	at org.eclipse.ui.internal.presentations.PaneFolder$3.close(PaneFolder.java:206)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1598)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:261)
	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.Display.runDeferredEvents(Display.java:3586)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3207)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 1 Tomasz Zarna CLA 2011-08-22 07:16:44 EDT
James any chance for steps? I've just spotted in when working with Current vs Index editor from EGit (see bug 347557, comment 9). The problem with EGit case is that for some cases the editor doesn't open at all and for others two editors are open. Closing one of them results in throwing the exception. It doesn't look good, but imo it's an echo of a bug in EGit which caused two editors to be open. Have you seen it working with CVS?
Comment 2 Remy Suen CLA 2012-01-30 14:14:05 EST
Just got hit by this. Unlike James, I was on 4.x.
Comment 3 Remy Suen CLA 2012-01-30 15:09:40 EST
This bug seems to be causing bug 348429.

For whatever reasons, there are two dispose listeners (line 576 of CompareEditorInput it seems) attached to the control which causes the handleDispose() to be invoked twice.

this	EventTable  (id=2338)	
	level	1	
	listeners	Listener[12]  (id=1417)	
		[0]	TypedListener  (id=1347)	
		[1]	TypedListener  (id=1344)	
		[2]	TypedListener  (id=1341)	
		[3]	TypedListener  (id=1341)	
		[4]	TypedListener  (id=1341)	
		[5]	TypedListener  (id=1338)	
		[6]	TypedListener  (id=1335)	
		[7]	TypedListener  (id=1316)	
			eventListener	CompareEditorInput$4  (id=1313)	
		[8]	TypedListener  (id=1406)	
			eventListener	CompareEditorInput$4  (id=1403)
Comment 4 Remy Suen CLA 2012-01-30 16:16:33 EST
createContents(Composite) gets called twice for some reasons.

java.lang.Throwable
	at org.eclipse.compare.CompareEditorInput.createContents(CompareEditorInput.java:555)
	at org.eclipse.compare.internal.CompareEditor.createCompareControl(CompareEditor.java:462)
	at org.eclipse.compare.internal.CompareEditor.access$6(CompareEditor.java:422)
	at org.eclipse.compare.internal.CompareEditor$4.run(CompareEditor.java:490)
	at org.eclipse.swt.widgets.Display.runTimer(Display.java:4266)
	at org.eclipse.swt.widgets.Display.messageProc(Display.java:3353)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2545)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:999)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:893)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:85)

java.lang.Throwable
	at org.eclipse.compare.CompareEditorInput.createContents(CompareEditorInput.java:555)
	at org.eclipse.compare.internal.CompareEditor.createCompareControl(CompareEditor.java:462)
	at org.eclipse.compare.internal.CompareEditor.access$6(CompareEditor.java:422)
	at org.eclipse.compare.internal.CompareEditor$3.run(CompareEditor.java:378)
	at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)
	at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
	at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)
	at org.eclipse.ui.internal.progress.ProgressManager$3.run(ProgressManager.java:960)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:995)
	at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:970)
	at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1166)
	at org.eclipse.compare.internal.CompareContainer.run(CompareContainer.java:80)
	at org.eclipse.compare.CompareEditorInput.run(CompareEditorInput.java:1373)
	at org.eclipse.compare.internal.merge.DocumentMerger.doDiff(DocumentMerger.java:460)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.doDiff(TextMergeViewer.java:3275)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.update(TextMergeViewer.java:4999)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.updateContent(TextMergeViewer.java:2847)
	at org.eclipse.compare.contentmergeviewer.ContentMergeViewer.internalRefresh(ContentMergeViewer.java:743)
	at org.eclipse.compare.contentmergeviewer.ContentMergeViewer.inputChanged(ContentMergeViewer.java:643)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:280)
	at org.eclipse.compare.CompareViewerSwitchingPane.setInput(CompareViewerSwitchingPane.java:277)
	at org.eclipse.compare.internal.CompareContentViewerSwitchingPane.setInput(CompareContentViewerSwitchingPane.java:158)
	at org.eclipse.compare.CompareEditorInput.internalSetContentPaneInput(CompareEditorInput.java:845)
	at org.eclipse.compare.CompareEditorInput.access$8(CompareEditorInput.java:843)
	at org.eclipse.compare.CompareEditorInput$11.run(CompareEditorInput.java:779)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.compare.CompareEditorInput.feed1(CompareEditorInput.java:773)
	at org.eclipse.compare.CompareEditorInput.feedInput(CompareEditorInput.java:751)
	at org.eclipse.compare.CompareEditorInput.createContents(CompareEditorInput.java:555)
	at org.eclipse.compare.internal.CompareEditor.createCompareControl(CompareEditor.java:462)
	at org.eclipse.compare.internal.CompareEditor.access$6(CompareEditor.java:422)
	at org.eclipse.compare.internal.CompareEditor$4.run(CompareEditor.java:490)
	at org.eclipse.swt.widgets.Display.runTimer(Display.java:4266)
	at org.eclipse.swt.widgets.Display.messageProc(Display.java:3353)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2545)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:999)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:893)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:85)
Comment 5 Tomasz Zarna CLA 2012-02-03 09:44:55 EST
*** Bug 370346 has been marked as a duplicate of this bug. ***
Comment 6 Tomasz Zarna CLA 2012-02-21 10:03:57 EST
*** Bug 372005 has been marked as a duplicate of this bug. ***
Comment 7 Holger Klene CLA 2012-07-11 19:33:04 EDT
bug 274823 has a similar stacktrace, though it was marked as a duplicate of the solved bug 261430

This bug was mentioned in bug 347557 comment 9 possibly related ...

Also it was part of a stacktrace for bug 373398 which is marked as a duplicate of bug 348429

Finally there is another duplicate of this as bug 367234

As of today it still occurs with Juno release 4.2.0 and egit 2.0.0.201206130900-r:

!SESSION 2012-07-08 12:36:26.485 -----------------------------------------------
eclipse.buildId=I20120608-1400
java.version=1.7.0_04
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=de_DE
Command-line arguments:  -os linux -ws gtk -arch x86
Comment 8 Robin Stocker CLA 2013-06-04 09:18:03 EDT
*** Bug 367234 has been marked as a duplicate of this bug. ***
Comment 9 Robin Stocker CLA 2013-06-04 09:18:49 EDT
*** Bug 409813 has been marked as a duplicate of this bug. ***
Comment 10 Robin Stocker CLA 2013-06-04 09:31:09 EDT
Is someone looking into this? Another 6 possible duplicates here:

https://bugs.eclipse.org/bugs/buglist.cgi?quicksearch=SaveableCompareEditorInput.handleDispose

The IAE could be avoided by checking if compareInputChangeListener is null in SaveableCompareEditorInput#handleDispose. But I'm not sure if this would just paper over the issue instead of solving the root cause.
Comment 11 Matthias Sohn CLA 2013-09-29 17:33:07 EDT
*** Bug 418131 has been marked as a duplicate of this bug. ***
Comment 12 Matthias Sohn CLA 2013-09-29 17:33:41 EDT
*** Bug 402197 has been marked as a duplicate of this bug. ***
Comment 13 Holger Klene CLA 2013-09-30 13:57:00 EDT
@Matthias

Bug 402197 and bug 418131 both feature a NullPointerException at:
org.eclipse.egit.ui.internal.CompareUtils.getIndexTypedElement(CompareUtils.java:469) and
org.eclipse.egit.ui.internal.CompareUtils.getIndexTypedElement(CompareUtils.java:581)

I'm curious, what makes you think, they are related to the original IllegalArgumentException at:
org.eclipse.core.runtime.ListenerList.remove(ListenerList.java:155)
Comment 14 Martin Mathew CLA 2014-05-14 02:48:45 EDT
Got hit by this exact exception today with Eclipse 4.4 Build id: I20140510-1500. 
My WS was clean without any outgoing changes. Applied a patch and from Git staging view, double clicked and opened one of the file. First i noticed the below 'Conflicting handlers' error:

Conflicting handlers for org.eclipse.ui.editors.lineNumberToggle: {ActionHandler(org.eclipse.compare.internal.TextEditorPropertyAction@602edfb5)} vs {ActionHandler(org.eclipse.compare.internal.TextEditorPropertyAction@4a794f40)}

Conflicting handlers for org.eclipse.ui.edit.text.toggleShowWhitespaceCharacters: {ActionHandler(org.eclipse.compare.internal.ShowWhitespaceAction@246cf272)} vs {ActionHandler(org.eclipse.compare.internal.ShowWhitespaceAction@55224f77)}

When i closed the file opened in compare editor the exception mentioned in comment 1 was thrown.
Comment 15 Martin Mathew CLA 2014-05-14 02:50:44 EDT
(In reply to Manju Mathew from comment #14)

> When i closed the file opened in compare editor the exception mentioned in
> comment 1 was thrown.
Sorry, exception mentioned in comment 0.
Comment 16 Szymon Ptaszkiewicz CLA 2014-12-24 04:09:38 EST
*** Bug 395073 has been marked as a duplicate of this bug. ***
Comment 17 Szymon Ptaszkiewicz CLA 2014-12-24 04:12:13 EST
*** Bug 397759 has been marked as a duplicate of this bug. ***
Comment 18 Szymon Ptaszkiewicz CLA 2014-12-24 04:16:37 EST
*** Bug 403253 has been marked as a duplicate of this bug. ***
Comment 19 Szymon Ptaszkiewicz CLA 2014-12-24 04:17:53 EST
*** Bug 443557 has been marked as a duplicate of this bug. ***
Comment 20 Szymon Ptaszkiewicz CLA 2014-12-24 04:20:57 EST
*** Bug 448969 has been marked as a duplicate of this bug. ***
Comment 21 Szymon Ptaszkiewicz CLA 2014-12-24 04:25:32 EST
*** Bug 454060 has been marked as a duplicate of this bug. ***
Comment 22 Szymon Ptaszkiewicz CLA 2014-12-24 04:26:08 EST
*** Bug 456097 has been marked as a duplicate of this bug. ***
Comment 23 Szymon Ptaszkiewicz CLA 2014-12-24 04:26:47 EST
*** Bug 449613 has been marked as a duplicate of this bug. ***
Comment 24 Szymon Ptaszkiewicz CLA 2014-12-24 04:28:14 EST
*** Bug 451022 has been marked as a duplicate of this bug. ***
Comment 25 Szymon Ptaszkiewicz CLA 2015-01-09 10:40:27 EST
In bug 261430 there was a similar exception which was identified in bug 261430 comment 5 to be caused by a result of SaveableCompareEditorInput.handleDispose() being called twice. The same could cause this bug as mentioned in comment 3. That means we need to look at it from a more general perspective because avoiding another IAE as it was done in bug 261430 does not seem to be the right solution. We should find the reason why SaveableCompareEditorInput.handleDispose() seems to be called twice and make sure it is called only once and in the right moment.

Dani, any thoughts?
Comment 26 Dani Megert CLA 2015-01-27 05:01:50 EST
(In reply to Szymon Ptaszkiewicz from comment #25)
> In bug 261430 there was a similar exception which was identified in bug
> 261430 comment 5 to be caused by a result of
> SaveableCompareEditorInput.handleDispose() being called twice. The same
> could cause this bug as mentioned in comment 3. That means we need to look
> at it from a more general perspective because avoiding another IAE as it was
> done in bug 261430 does not seem to be the right solution. We should find
> the reason why SaveableCompareEditorInput.handleDispose() seems to be called
> twice and make sure it is called only once and in the right moment.
> 
> Dani, any thoughts?

Looks like a bug in the life cycle. Needs to be debugged.
Comment 27 Stefan Xenos CLA 2015-11-19 16:01:56 EST
I've added some logging to help track this down further.

If you can reproduce this, please follow the steps in bug 448968, comment 61 in order to enable the logging. Then attach the resulting trace file here.
Comment 28 Stefan Xenos CLA 2015-11-20 10:31:18 EST
Ping. Is anyone cc'd here able to reproduce this? I really need one of those trace files in order to proceed with a fix.
Comment 29 Dani Megert CLA 2016-05-06 10:12:35 EDT
Stefan, I guess this is too late for RC*
Comment 30 Stefan Xenos CLA 2016-05-06 12:15:06 EDT
I can't do much without the assistance of someone who can reproduce it.
Comment 31 Mickael Istria CLA 2016-12-05 03:47:16 EST
Raising priority as this is currently the #2 most frequent bug for users: https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/problems/54c4ef8bbee810030da07087
Comment 32 Mickael Istria CLA 2016-12-06 04:20:32 EST
Proposed dummy patch: https://git.eclipse.org/r/#/c/86441/
This is not tested, nor tries to find a root cause (if we need to find one...), but it should avoid the error.
Comment 33 Eclipse Genie CLA 2016-12-06 08:21:09 EST
New Gerrit change created: https://git.eclipse.org/r/86441
Comment 34 Eclipse Genie CLA 2017-01-17 16:59:37 EST
New Gerrit change created: https://git.eclipse.org/r/88908
Comment 36 Sergey Prigogin CLA 2017-01-17 17:28:22 EST
Passing null to removeCompareInputChangeListener has been avoided. To debug the underlying issue with widgetDisposed method being called multiple times, enable the org.eclipse.team.ui/compare_editor_input debugging option.
Comment 37 Eclipse Genie CLA 2020-06-09 16:00:31 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.