Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Travis-CI with "Comparison method violates its general contract!" #916

Closed
avernet opened this issue Apr 5, 2013 · 1 comment
Assignees

Comments

@avernet
Copy link
Collaborator

avernet commented Apr 5, 2013

Full error message:

[junit] Comparison method violates its general contract!
[junit] java.lang.IllegalArgumentException: Comparison method violates its general contract!
[junit]     at java.util.TimSort.mergeLo(TimSort.java:747)
[junit]     at java.util.TimSort.mergeAt(TimSort.java:483)
[junit]     at java.util.TimSort.mergeCollapse(TimSort.java:410)
[junit]     at java.util.TimSort.sort(TimSort.java:214)
[junit]     at java.util.TimSort.sort(TimSort.java:173)
[junit]     at java.util.Arrays.sort(Arrays.java:659)
[junit]     at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
@ghost ghost assigned avernet Apr 5, 2013
avernet added a commit that referenced this issue Apr 5, 2013
@avernet
Copy link
Collaborator Author

avernet commented Apr 5, 2013

This was caused to a JDK 7 bug. We had this on Travis-CI, which at the time was running:

Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

I couldn't reproduce this locally on OS X with exactly the same version of Java. Setting the java.util.Arrays.useLegacyMergeSort system property to true, as suggested in this Stack Overflow answer, gets us around the problem.

@avernet avernet closed this as completed Apr 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant