Recurring error message

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
Hypatia
Cave Troll
Posts: 29
Joined: Sun Oct 21, 2012 5:30 am

Recurring error message

Post by Hypatia »

Having a recurrent error message. I cannot figure out what is causing it as it appears randomly and can then disappear as well. Once it has triggered I cannot move tokens, copy paste or anything really. I can close it and sometimes continue for a bit but then it pops up again. It happens both when I am working on the campaign on my own and when I am running a server (LAN, just 2 computers) and also pops up on the 2nd screen ( though not always at the same time as on mine). Driving me mad.
I am running 1.4 and Java 8.
Here is the message. Followed by the debug info

java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeLo(TimSort.java:777)
at java.util.TimSort.mergeAt(TimSort.java:514)
at java.util.TimSort.mergeCollapse(TimSort.java:441)
at java.util.TimSort.sort(TimSort.java:245)
at java.util.Arrays.sort(Arrays.java:1438)
at java.util.List.sort(List.java:478)
at java.util.Collections.sort(Collections.java:175)
at net.rptools.maptool.model.Zone.putToken(Zone.java:1114)
at net.rptools.maptool.client.ServerCommandClientImpl.putToken(ServerCommandClientImpl.java:116)
at net.rptools.maptool.client.tool.StampTool.mouseReleased(StampTool.java:417)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:36)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)



==== MapTool Information ====
MapTool Version: 1.4.1.8
MapTool Home...: C:\Users\Sanders\.maptool
Max mem avail..: 910M
Max mem used...: 849M
Custom Property: -DMAPTOOL_DATADIR=C:\Users\Sanders\.maptool

==== Java Information ====
Java Vendor.: Oracle Corporation
Java Home...: C:\Users\Sanders\AppData\Roaming\JWrapper-MapTool\JWrapper-Windows64JRE-00053600256-complete
Java Version: 1.8.0_101
Result of executing 'java -version':
............: Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
............: Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)


==== OS Information ====
OS Name........: Windows 10
OS Version.....: 10.0
OS Architecture: amd64
PATH...........: C:\Users\Sanders\AppData\Roaming\JWrapper-MapTool\JWrapper-Windows64JRE-00053600256-complete\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Users\Sanders\AppData\Local\Microsoft\WindowsApps;;.
Number of Procs: 8

==== User Information ====
User Name: Sanders
User Home: C:\Users\Sanders
User Dir.: C:\Users\Sanders\AppData\Roaming\JWrapper-MapTool\JWrapper-MapTool-00053648849-complete

==== Network Interfaces ====
Display Name..: Software Loopback Interface 1
Interface Name: lo
Address...: 127.0.0.1
Address...: 0:0:0:0:0:0:0:1

Display Name..: Qualcomm Atheros AR5BWB222 Wireless Network Adapter
Interface Name: wlan1
Address...: 192.168.1.2
Address...: fdf8:23b2:3fc6:d900:b5dc:c49d:f4d6:8008
Address...: fdf8:23b2:3fc6:d900:6c97:a33e:5787:4184
Address...: fe80:0:0:0:b5dc:c49d:f4d6:8008%wlan1

Display Name..: Microsoft Teredo Tunneling Adapter
Interface Name: net1
Address...: 2001:0:4137:9e76:56:524:a3fc:4228
Address...: fe80:0:0:0:56:524:a3fc:4228%net1

Host Address...: 192.168.1.2
Default Gateway: 192.168.1.1

==== Locale Information ====
Country.: United Kingdom
Language: English
Locale..: English (United Kingdom)
Variant.:

==== Display Information ====
Number of Displays: 1
Display 1: 1600x900(32)

==== Internet Gateway Devices ====
Device Name.: Huawei Home Gateway
Model Name..: HG633
Manufacturer: Huawei Technologies Co., Ltd.
Model Number: Huawei Model
Model Desc..: Huawei Home Gateway
Firmware....: Linux UPnP/1.0 Huawei-ATP-IGD
External IP.: 92.3.189.215

bobifle
Giant
Posts: 219
Joined: Thu Oct 19, 2017 12:36 pm

Re: Recurring error message

Post by bobifle »

Someone posted a similar issue viewtopic.php?f=86&t=27481

Have a look.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Recurring error message

Post by Jagged »

Indeed, you have a matching stacktrace. So I suspect the same error, that there is a corrupted token somewhere.

Suspicious that we have had two recently. Mind you the other thread was with 1.4.1.7, which is a long standing release so probably just coincidence. Unless its brought about by a recent Java update :?

User avatar
Full Bleed
Demigod
Posts: 4558
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

Re: Recurring error message

Post by Full Bleed »

Jagged wrote:Suspicious that we have had two recently. Mind you the other thread was with 1.4.1.7, which is a long standing release so probably just coincidence. Unless its brought about by a recent Java update :?

Does Xavram's fix (duplicating the map) generate new asset id's for tokens?

If so... that's probably the issue.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Recurring error message

Post by Phergus »

If you duplicate a map the tokens on the new map get new IDs but the asset IDs for the images used by the tokens are the same.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Recurring error message

Post by Jagged »

The stacktrace points to token comparison rather than asset id, so hopefully duplicating the map will cure the problem.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Recurring error message

Post by Phergus »

What's being sorted is:

Code: Select all

   private final List<Token> tokenOrderedList = new LinkedList<Token>();

And the only thing the Comparator for the Token class does is compare the names:

Code: Select all

   public static final Comparator<Token> NAME_COMPARATOR = new Comparator<Token>() {
      public int compare(Token o1, Token o2) {
         return o1.getName().compareToIgnoreCase(o2.getName());
      }
   };


Hmm, compareToIgnoreCase() returns just a signed integer and is not restricted to just {-1, 0, 1}. Does that matter when implementing compare()?

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Recurring error message

Post by Jagged »

The zone.putToken is also doing a zorder comparison. Which although still fairly simple, is slightly more complex and perhaps a more likely candidate for the error.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Recurring error message

Post by Phergus »

I dare say that without a problem map/campaign file to work with no one is likely to find the actual cause of the problem.

username
Dragon
Posts: 274
Joined: Sun Sep 04, 2011 7:01 am

Re: Recurring error message

Post by username »

This is all over the forum since months and I have been away some time, so maybe I'm missing something.

But timsort, the (new) default sorting algorithm in Java, reacts allergic to comparators not compatible with equals. The above mentioned comparator is not compatible. You have three choices: (a) make the comparator compatible to the default equals, (b) implement equals on the objects being compared, (c) ignore the problem and add the -DuseLegacySort switch in the startup scripts.

Michael

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Recurring error message

Post by JamzTheMan »

There has been some headway...

@OP Do you happen to be using Isometric/Figure tokens?
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Recurring error message

Post by Jagged »

username wrote:This is all over the forum since months and I have been away some time, so maybe I'm missing something.

Feel free to submit a push request.

username
Dragon
Posts: 274
Joined: Sun Sep 04, 2011 7:01 am

Re: Recurring error message

Post by username »

Again, I have the feeling I am missing something. The NAME_COMPARATOR is not used and I would completely remove it.
In other words, I cloned the repo https://github.com/RPTools/maptool, removed this static instance completely and everything built (./gradlew clean release) fine. (Maybe getting to techy here?)

But that wouldn't solve the problem. :?

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Recurring error message

Post by Phergus »

As Jagged pointed out, there is a zorder comparator in there as well and it is used.

The suspicion is that this is only affecting users using iso grids and figure tokens though we haven't been able to reproduce the issue. While there have been several people who have reported it none of them have provided us with a campaign file or map that reproduces it.

If you can reproduce it and identify the exact problem, great.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Recurring error message

Post by Jagged »

Not sure it necessarily has to be on an iso map or using figure tokens. Since all maps will be using the same z-order comparator.

Still, an example map/campaign would help greatly.

Post Reply

Return to “MapTool 1.4”