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

        There are no subversion log entries for this issue yet.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: