Bug eating multiple hotdogs

whatevermancy

New member
I queued 10 hotdogs as separate items using "enqueue" in item manager. Then clicked consume 9 of 10 hotdog were consumed the mafia created the following debug log.



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
KoLmafia v17.3 r16902, Windows 7, Java 1.8.0_73
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Please note: do not post this log in the KoLmafia thread of KoL's
Gameplay-Discussion forum. If you would like the KoLmafia dev team
to look at it, please write a bug report at kolmafia.us. Include
specific information about what you were doing when you made this
and include this log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Timestamp: Wed Jun 01 00:35:44 EDT 2016
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.IllegalArgumentException: Comparison method violates its general contract!
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.ComparableTimSort.mergeHi(Unknown Source)
at java.util.ComparableTimSort.mergeAt(Unknown Source)
at java.util.ComparableTimSort.mergeCollapse(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.ArrayList.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at net.java.dev.spellcast.utilities.LockableListModel.sort(LockableListModel.java:164)
at net.java.dev.spellcast.utilities.LockableListModel.sort(LockableListModel.java:143)
at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.refreshConcoctionsNow(ConcoctionDatabase.java:1497)
at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.refreshConcoctions(ConcoctionDatabase.java:1330)
at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.refreshConcoctions(ConcoctionDatabase.java:1301)
at net.sourceforge.kolmafia.swingui.panel.UseItemEnqueuePanel$EnqueueListener.execute(UseItemEnqueuePanel.java:326)
at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
at net.sourceforge.kolmafia.RequestThread$SequencedRunnable.run(RequestThread.java:418)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
KoLmafia v17.3 r16902, Windows 7, Java 1.8.0_73
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Please note: do not post this log in the KoLmafia thread of KoL's
Gameplay-Discussion forum. If you would like the KoLmafia dev team
to look at it, please write a bug report at kolmafia.us. Include
specific information about what you were doing when you made this
and include this log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Timestamp: Wed Jun 01 00:37:04 EDT 2016
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.IllegalArgumentException: Comparison method violates its general contract!
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.ComparableTimSort.mergeHi(Unknown Source)
at java.util.ComparableTimSort.mergeAt(Unknown Source)
at java.util.ComparableTimSort.mergeCollapse(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.ArrayList.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at net.java.dev.spellcast.utilities.LockableListModel.sort(LockableListModel.java:164)
at net.java.dev.spellcast.utilities.LockableListModel.sort(LockableListModel.java:143)
at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.refreshConcoctionsNow(ConcoctionDatabase.java:1497)
at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.refreshConcoctions(ConcoctionDatabase.java:1330)
at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.refreshConcoctions(ConcoctionDatabase.java:1301)
at net.sourceforge.kolmafia.swingui.panel.UseItemDequeuePanel$UndoQueueRunnable.run(UseItemDequeuePanel.java:193)
at net.sourceforge.kolmafia.RequestThread$SequencedRunnable.run(RequestThread.java:418)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I don't have the food space to try to reproduce.
 

heeheehee

Developer
Staff member
What kind of hot dog? Basic hot dog? Did it bring you to max fullness?

I'm staring at the Concoction compareTo code, and the first thing I can think of is that two items will be equal yet compare differently if they have the same name but are different in some other way. While that might be a logical bug, it doesn't seem to be causing any problems (and if it were, they would be consistently showing up).

Java compareTo general contract said:
1. The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)

2. The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.

3. Finally, the implementor must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.
I'm placing my bets on "race condition", since otherwise, I'm confident that 1 and 3 are met, and I'm pretty sure than 2 is met.
 
Top