Crash when porting to town

Forum for bugs and technical problems.

Crash when porting to town

Postby Rifmaster » Mon Feb 05, 2018 6:45 pm

java.lang.RuntimeException: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
at javax.media.opengl.Threading.invoke(Threading.java:191)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:528)
at haven.HavenPanel.uglyjoglhack(HavenPanel.java:418)
at haven.HavenPanel.run(HavenPanel.java:453)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at haven.RenderList.fin(RenderList.java:217)
at haven.PView.draw(PView.java:225)
at haven.MapView.draw(MapView.java:1052)
at haven.GameUI.drawFiltered(GameUI.java:658)
at haven.GameUI.draw(GameUI.java:666)
at haven.Widget.draw(Widget.java:514)
at haven.Widget.draw(Widget.java:519)
at haven.RootWidget.draw(RootWidget.java:182)
at haven.UI.draw(UI.java:165)
at haven.HavenPanel.redraw(HavenPanel.java:296)
at haven.HavenPanel$1.display(HavenPanel.java:92)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:649)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:633)
at javax.media.opengl.awt.GLCanvas$9.run(GLCanvas.java:1271)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1103)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:978)
at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1282)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


Sometimes I can port to town normally, but sometimes i get this crash report, and when i try to log on again it just crashes again.
User avatar
Rifmaster
 
Posts: 1698
Joined: Fri Jun 27, 2014 9:13 am
Location: Chernobyl

Re: Crash when porting to town

Postby Taipion » Mon Feb 05, 2018 9:37 pm

Rifmaster wrote:
java.lang.RuntimeException: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
at javax.media.opengl.Threading.invoke(Threading.java:191)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:528)
at haven.HavenPanel.uglyjoglhack(HavenPanel.java:418)
at haven.HavenPanel.run(HavenPanel.java:453)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at haven.RenderList.fin(RenderList.java:217)
at haven.PView.draw(PView.java:225)
at haven.MapView.draw(MapView.java:1052)
at haven.GameUI.drawFiltered(GameUI.java:658)
at haven.GameUI.draw(GameUI.java:666)
at haven.Widget.draw(Widget.java:514)
at haven.Widget.draw(Widget.java:519)
at haven.RootWidget.draw(RootWidget.java:182)
at haven.UI.draw(UI.java:165)
at haven.HavenPanel.redraw(HavenPanel.java:296)
at haven.HavenPanel$1.display(HavenPanel.java:92)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:649)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:633)
at javax.media.opengl.awt.GLCanvas$9.run(GLCanvas.java:1271)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1103)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:978)
at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1282)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


Sometimes I can port to town normally, but sometimes i get this crash report, and when i try to log on again it just crashes again.


This one should be pretty rare actually, can happen to anyone, not really serious.

How frequently do you get this?
Need something? Here is my Shop (Including some useful info for new/returning players at the bottom of the first post)
Taipion
 
Posts: 2659
Joined: Fri Mar 08, 2013 4:12 pm

Re: Crash when porting to town

Postby Rifmaster » Mon Feb 05, 2018 11:30 pm

1-3 times a week
User avatar
Rifmaster
 
Posts: 1698
Joined: Fri Jun 27, 2014 9:13 am
Location: Chernobyl

Re: Crash when porting to town

Postby Taipion » Tue Feb 06, 2018 1:07 am

Rifmaster wrote:1-3 times a week


If it's important to you, your best bet is to ....kindly ask Kandarim, probably in the thread for his client, to put a try/catch around that sorting or something like that. ^^
Need something? Here is my Shop (Including some useful info for new/returning players at the bottom of the first post)
Taipion
 
Posts: 2659
Joined: Fri Mar 08, 2013 4:12 pm

Re: Crash when porting to town

Postby Meanz » Wed Feb 07, 2018 4:09 pm

You can avoid this issue by turning of continuous client side sorting.


Edit:
Taipion wrote:
Rifmaster wrote:1-3 times a week


If it's important to you, your best bet is to ....kindly ask Kandarim, probably in the thread for his client, to put a try/catch around that sorting or something like that. ^^


That's like ignoring the problem T_T
Meanz
 
Posts: 52
Joined: Sun Dec 02, 2012 11:45 am

Re: Crash when porting to town

Postby Taipion » Wed Feb 07, 2018 5:52 pm

Meanz wrote:You can avoid this issue by turning of continuous client side sorting.


Edit:
Taipion wrote:
Rifmaster wrote:1-3 times a week


If it's important to you, your best bet is to ....kindly ask Kandarim, probably in the thread for his client, to put a try/catch around that sorting or something like that. ^^


That's like ignoring the problem T_T


The crash through sorting has been fixed already,
if I see it right, this is another sorting crash due to things in the UI being sorted, not the inventory, and would require an additional fix.

And yes, "ignoring" the problem with a try/catch is probably the best solution here, except you want to implement your own sorting algorithm that has no problem with things changing while being sorted.
Need something? Here is my Shop (Including some useful info for new/returning players at the bottom of the first post)
Taipion
 
Posts: 2659
Joined: Fri Mar 08, 2013 4:12 pm

Re: Crash when porting to town

Postby Meanz » Wed Feb 07, 2018 10:09 pm

The crash through sorting has been fixed already,
if I see it right, this is another sorting crash due to things in the UI being sorted, not the inventory, and would require an additional fix.


My bad I dind't actually read the stack trace, I just guessed since it's been a problem in the past.

And yes, "ignoring" the problem with a try/catch is probably the best solution here, except you want to implement your own sorting algorithm that has no problem with things changing while being sorted.


I just don't like the way java uses exceptions, they have integrated" exceptions" as a core part of the language.
An example is if you're trying to open a file and it doesn't exist, it will throw a filenotfoundexception. And it's common practice to use that as a "code path" for when the file doesn't exist. Instead of calling java's equivalent of "does file exist" before actually trying to open the file.

The only way that the list can change while being sorted is if it's modified by the function sorting it, which ehem is like very good,
The other case is if a parallel process is modifying the list, in which case I'd say mutex the list while sorting.
Meanz
 
Posts: 52
Joined: Sun Dec 02, 2012 11:45 am

Re: Crash when porting to town

Postby Taipion » Wed Feb 07, 2018 11:27 pm

Meanz wrote:
The crash through sorting has been fixed already,
if I see it right, this is another sorting crash due to things in the UI being sorted, not the inventory, and would require an additional fix.


My bad I dind't actually read the stack trace, I just guessed since it's been a problem in the past.

And yes, "ignoring" the problem with a try/catch is probably the best solution here, except you want to implement your own sorting algorithm that has no problem with things changing while being sorted.


I just don't like the way java uses exceptions, they have integrated" exceptions" as a core part of the language.
An example is if you're trying to open a file and it doesn't exist, it will throw a filenotfoundexception. And it's common practice to use that as a "code path" for when the file doesn't exist. Instead of calling java's equivalent of "does file exist" before actually trying to open the file.

The only way that the list can change while being sorted is if it's modified by the function sorting it, which ehem is like very good,
The other case is if a parallel process is modifying the list, in which case I'd say mutex the list while sorting.


That is both a bad example and several wrong assumptions.
The map/list/whatever contains pointers and the actual objects behind those may change due to others things.

Your personal preference regarding exceptions in java is a whole different thing, as are your assumptions about it's (proper) usage.


Please don't take this too negative, I'm not trying to bash you here or start a wild java discussion.

IF you though want a proper solution, go check out the code from github and develop a fix, Kandarim will be likely more than happy to take it.
Need something? Here is my Shop (Including some useful info for new/returning players at the bottom of the first post)
Taipion
 
Posts: 2659
Joined: Fri Mar 08, 2013 4:12 pm

Re: Crash when porting to town

Postby Meanz » Thu Feb 08, 2018 1:23 pm

Taipion wrote:
That is both a bad example and several wrong assumptions.
The map/list/whatever contains pointers and the actual objects behind those may change due to others things.

Your personal preference regarding exceptions in java is a whole different thing, as are your assumptions about it's (proper) usage.


Please don't take this too negative, I'm not trying to bash you here or start a wild java discussion.

If you though want a proper solution, go check out the code from github and develop a fix, Kandarim will be likely more than happy to take it.


Whether it's a bad example or not I can't tell, but it's a recurring pattern that I see. And if you could specify what assumptions you mean I've made incorrectly, then that would help my future assumptions.

I'll be a bit more explicit then, if the contents of the list and or the data the contents point to are modified while iterating through the list, then there should be some sort of synchronization.

I only ment to state that I personally think that surrounding the code with a try catch in this situation is not a fix to the problem itself. Seeing as the problem is that some data is changed without proper synchronization, unless I am misunderstanding the problem.
And it's not an exception if two or more parties use (read/write) the same data without proper synchronization, that is a statistical expected outcome, so not an exception.

And yes, surrounding it with a try catch will most likely fix the symptoms, but not the underlying issue. So more of a philosophical standpoint from me.
Meanz
 
Posts: 52
Joined: Sun Dec 02, 2012 11:45 am


Return to Bugs & Technicalities

Who is online

Users browsing this forum: No registered users and 18 guests

cron