Menu

#2867 Uncaught Exceptions

Fixed_0.12.0
closed-fixed
nobody
None
5
2022-05-01
2015-06-13
Fenyo
No

I have found several exceptions in the log file when i have playtested today.

Like these:
java.lang.IllegalArgumentException: illegal component position
java.util.ConcurrentModificationException
java.lang.NullPointerException
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 32; The markup in the document following the root element must be well-formed.

I have pressed and hold down the Enter for a lot of time, that has to do something about it.

I have attached this logfile.

I used the Newest GIT version (June 10).

1 Attachments

Discussion

  • Mike Pope

    Mike Pope - 2015-06-15
    • illegal component position

    I have seen this a fair bit, but it is mysterious, as AFAICT the position referenced is fine. Also AFAICT this is harmless.

    • ConcurrentModification

    This is interesting. There is probably something worth fixing here.

    • NPE

    No idea what is going on here, but AFAICT the effect is minor. Might be worth looking at if it is reproducible.

    • SAX exception

    Nasty failure, but I would need the COMMS debug output to make progress here.

    Result: I will check the code for the second case, and keep an eye out for the fourth one in debug games where I have adequate logging turned on. The others are unimportant ATM until a consequence is identified.

    I realize these cases have a connecting theme, but they are almost certainly distinct problems. In general, one problem per bug report please. Multiple cases are harder to track.

     
  • Fenyo

    Fenyo - 2015-06-16

    I have seen this a fair bit, but it is mysterious, as AFAICT the position referenced is fine. Also AFAICT this is harmless.

    Isn't that possible that it considers the position illegal because the component is INVISIBLE?

    NPE: No idea what is going on here, but AFAICT the effect is minor. Might be worth looking at if it is reproducible.

    And what about checking the code indicated by the stack trace? Anything suspicious?

    In general, one problem per bug report please.

    Ok, sorry.

     
    • Mike Pope

      Mike Pope - 2015-06-16

      Isn't that possible that it considers the position illegal because the component is INVISIBLE?

      You tell me:-). Graphics is not my area.

      And what about checking the code indicated by the stack trace? Anything suspicious?

      No idea. That NPE is very low priority IMHO.

      Please be realistic about responses from your friendly but time-limited FreeCol maintainers. I have looked at the ConcurrentModification and have a change that may help, but it needs play testing. I have a check for the SAXException in the regression tests. Those two were potential game-stoppers and deserved some immediate attention. The others, at lot less so.

       
  • wintertime

    wintertime - 2015-07-29

    I read the log and checked all stack traces, but it seems impossible that the illegal position exceptions could get triggered.
    Somehow NetBeans even let me see into the implementation of the classes triggering the exceptions, though it looks like not the x-y-position, but the layer index can cause the illegalArgumentException("illegal component position") from being outside the allowed range of -1 or 0 to less than size of the internal ArrayList.
    But we always use the same constant for the second argument to canvas.add in CornerMapControls.addToCanvas() and still it does work most of the times.

    The NPE happens in the same classes, but there the reason seems a UnitButton having the am member==null, which can only happen from MapControls constructor passing null to the UnitButton constructor, but it should have access to the ActionManager, unless this happened before FreeColClient.ActionManager being initialized.
    At that point I have no idea how to anticipate what could have happened to trigger this from the information contained in the log, though the stack trace shows setCurrentPlayer and autoSaveGame triggered by a network message and later on there is a SaxParseException which opens the possibility of malformed network data being a trigger for subtly corrupting the game state in the client over a longer period.
    Even the concurrentModificationException has a similar call stack.
    Its near impossible to pinpoint the root cause, it might be use of uninitialized data, race conditions, wrong data from corrupted network messages which slipped through validation or even sporadic memory corruption. You will need to provide a savegame from which this can be reliably reproduced and maybe a log with --log-level finest to have more information about whats going on (though that log would take even longer to check), unless Mike got some new idea!

     
    • Mike Pope

      Mike Pope - 2015-07-29

      Even the concurrentModificationException has a similar call stack...
      ...unless Mike got some new idea!

      Not a new idea, but it looks very like a race condition to me. Most of the concurrent modification bugs I have fixed were. I too have been unable to reproduce the problem, but in my patch queue is an obvious simplification that has survived some play testing and will definitely prevent it. I will commit that soon.

      The SAXException is also being elusive. I have tracing code for it in my overnight test runs, but there have been no sightings. It is potentially quite serious.

       
      • Mike Pope

        Mike Pope - 2015-07-31

        I will commit that soon.

        Its git.1728101.

         
  • wintertime

    wintertime - 2015-07-29
    • status: open --> open-needs-info
     
  • Fenyo

    Fenyo - 2017-02-05

    I think we can close this, these are no longer valid.

     
    • Mike Pope

      Mike Pope - 2017-02-05

      OK, closing.

       
  • Mike Pope

    Mike Pope - 2017-02-05
    • status: open-needs-info --> pending-fixed
    • Group: Current --> Fixed_trunk
     
  • Fenyo

    Fenyo - 2017-02-05

    Why is the status 'pending'?

     
  • Mike Pope

    Mike Pope - 2022-05-01
    • Group: Fixed_trunk --> Fixed_0.12.0
     
  • Mike Pope

    Mike Pope - 2022-05-01
    • Status: pending-fixed --> closed-fixed
     

Log in to post a comment.