Uploaded image for project: 'Beehive'
  1. Beehive
  2. BEEHIVE-1231

Apache Beehive concurrent use of unsynchronized HashMap can cause threads to go into an infinite loop.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 1.0.2
    • None
    • NetUI
    • None

    Description

      Apache Beehive concurrent use of unsynchronized HashMap can cause threads to go into an infinite loop.
      Description: The observed behavior is STUCK threads with the following stack trace (first N lines of):

      at java.util.HashMap.get(HashMap.java:346)
      at org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext.getActionInterceptors(ActionInterceptorContext.java:159)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2066)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
      at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
      at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      ...

      The problem occurs when (some unknown) ill synchronized concurrent access to the HashMap produces a loop in the Entry "e.next" data members, causing the get() code to loop:

      public V get(Object key) {
      if (key == null)
      return getForNullKey();
      int hash = hash(key.hashCode());
      for (Entry<K,V> e = table[indexFor(hash, table.length)];
      e != null;
      e = e.next)

      { Object k; if (e.hash == hash && ((k = e.key) == key || key.equals(k))) return e.value; }

      return null;
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mspeer Michael Speer
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: