ICEpush
  1. ICEpush
  2. PUSH-151

BrowserDispatcher throws java.lang.NegativeArraySizeException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha3
    • Fix Version/s: EE-3.2.0.BETA, EE-3.2.0.GA, 3.3
    • Component/s: Integrations
    • Labels:
      None
    • Environment:
      Vaadin 6.6.8, Vaadin IcePush addon 0.2.1, Tomcat 6.0.33, JRockit JRE 1.6.0_24-b07

      Description

      I'm using IcePush with Vaadin and this addon https://vaadin.com/directory#addon/icepush

      For some reason Icepush occasionally throws java.lang.NegativeArraySizeException and stops working:

      Caused by: java.lang.NegativeArraySizeException
               at java.util.AbstractCollection.toArray(AbstractCollection.java:119)
               at java.util.ArrayList.<init>(ArrayList.java:131)
               at org.icepush.servlet.BrowserDispatcher.discardUnusedServlets(BrowserDispatcher.java:89)
               at org.icepush.servlet.BrowserDispatcher.service(BrowserDispatcher.java:47)
               at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:45)
               at org.icepush.servlet.MainServlet.service(MainServlet.java:71)
               ... 38 more

      When looking at the implementation of BrowserDispatcher.discardUnusedServlets()-method it seems like there has been two concurrent threads accessing this method and somehow managed to call BrowserDispatcher.BrowserEntry.discardIfExpired()-> browserBoundServlets.remove(id) in a way that makes browserBoundServlets.values().size() return value less than zero.

      By making browserBoundServlets map thread-safe or synchronizing related method accesses, could make this bug go away.

        Activity

        Gaz Limebranch created issue -
        Jack Van Ooststroom made changes -
        Field Original Value New Value
        Assignee Jack Van Ooststroom [ jack.van.ooststroom ]
        Ken Fyten made changes -
        Fix Version/s EE-3.2.0.GA [ 10323 ]
        Fix Version/s 3.3 [ 10374 ]
        Jack Van Ooststroom made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Jack Van Ooststroom added a comment -

        With PUSH-152 being fixed, I believe this should be fixed as well. Marking this one as FIXED.

        Show
        Jack Van Ooststroom added a comment - With PUSH-152 being fixed, I believe this should be fixed as well. Marking this one as FIXED.
        Jack Van Ooststroom made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s EE-3.2.0.BETA [ 10574 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Gaz Limebranch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: