Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:744)
at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:481)
at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:406)
at java.util.ComparableTimSort.sort(ComparableTimSort.java:213)
at java.util.Arrays.sort(Arrays.java:1312)
at de.fau.cs.osr.utils.visitor.VisitorLogic.sweepCache(VisitorLogic.java:225)
at de.fau.cs.osr.utils.visitor.VisitorLogic.findVisit(VisitorLogic.java:205)
at de.fau.cs.osr.utils.visitor.VisitorLogic.resolveAndVisit(VisitorLogic.java:105)
This is probably caused by multiple threads being used, and thus lastUse changing. The synchronization on sweepCache is not enough to prevent other threads from changing lastUse. It may be enough to just attempt to partially sort the targets to identify the least frequently used, rather than calling Arrays.sort. A quick select strategy may be worth trying. (Note: this bug likely doesn't appear in older Java versions, which did not use TimSort).
P.S. the osr-common repository, where this is supposed to be in, is currently empty.
This is probably caused by multiple threads being used, and thus
lastUse
changing. The synchronization onsweepCache
is not enough to prevent other threads from changinglastUse
. It may be enough to just attempt to partially sort the targets to identify the least frequently used, rather than callingArrays.sort
. A quick select strategy may be worth trying. (Note: this bug likely doesn't appear in older Java versions, which did not use TimSort).P.S. the osr-common repository, where this is supposed to be in, is currently empty.