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

Bug 525287

Summary: Comparator violation in progress monitor
Product: [Eclipse Project] Platform Reporter: DJ Houghton <dj.houghton>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: loskutov
Version: 4.2.2   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=371354
https://bugs.eclipse.org/bugs/show_bug.cgi?id=361121
Whiteboard:

Description DJ Houghton CLA 2017-09-27 15:46:44 EDT
Eclipse 4.7.1 + RTC product

Similar to bug 512334.

I was loading a lot of files from our repository (using our SCM) and I got a dialog informing me about a comparator violation. 

Note the 2 log entries. 
Also note that in the second entry, there were 168 "(Waiting)" entries but I removed most of them from this report.

----------

eclipse.buildId=unknown
java.version=1.7.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CA
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -data w3

Error
Wed Sep 27 14:39:26 EDT 2017
An internal error has occurred.

java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at java.util.TimSort.mergeLo(TimSort.java:751)
	at java.util.TimSort.mergeAt(TimSort.java:487)
	at java.util.TimSort.mergeCollapse(TimSort.java:414)
	at java.util.TimSort.sort(TimSort.java:218)
	at java.util.TimSort.sort(TimSort.java:177)
	at java.util.Arrays.sort(Arrays.java:659)
	at org.eclipse.jface.viewers.ViewerComparator.sort(ViewerComparator.java:187)
	at org.eclipse.ui.internal.progress.DetailedProgressViewer.add(DetailedProgressViewer.java:166)
	at org.eclipse.ui.internal.progress.ProgressViewerContentProvider.add(ProgressViewerContentProvider.java:224)
	at org.eclipse.ui.internal.progress.ProgressViewUpdater$1.runInUIThread(ProgressViewUpdater.java:285)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	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:3959)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3636)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1054)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:943)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:88)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:596)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:550)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	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:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

---------

eclipse.buildId=unknown
java.version=1.7.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CA
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -data w3

Error
Wed Sep 27 14:39:25 EDT 2017
Workaround for comparator violation:
	- set system property java.util.Arrays.useLegacyMergeSort=true
	- use a 1.6 JRE 
message: Comparison method violates its general contract!
this: org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog$1
comparator: null
array:
	(53%) Loading repository items: Loading [fs-lof - Component4] (6/10 components)
	 (Waiting)
	Updating Local Conflicts (Blocked: Waiting for Loading repository items)
	 (Waiting)
	(100%) Updating changes: Reconciling component(s)
	 (Waiting)
         ...
Comment 1 DJ Houghton CLA 2017-09-27 16:01:39 EDT
Ignore the Eclipse version in comment 1 - I was using Eclipse 4.2.2 *not* 4.7.1.
Comment 2 Andrey Loskutov CLA 2017-09-27 16:30:37 EDT
Bug 361121 or bug 371354? Whatever, should be fixed already.

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