java.lang.ArrayIndexOutOfBoundsException: -255

Jenkins JIRA | Marco Rothe | 6 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    On our jenkins (1.403) the following exception occured (only a restart can the system bring back to a normal behaviour): java.lang.ArrayIndexOutOfBoundsException: -255 at hudson.util.RingBufferLogHandler.publish(RingBufferLogHandler.java:52) at java.util.logging.Logger.log(Unknown Source) at java.util.logging.Logger.doLog(Unknown Source) at java.util.logging.Logger.log(Unknown Source) at java.util.logging.Logger.fine(Unknown Source) at hudson.security.SidACL.hasPermission(SidACL.java:54) at hudson.security.ACL.checkPermission(ACL.java:52) at hudson.model.Node.checkPermission(Node.java:316) at hudson.model.Hudson.getTarget(Hudson.java:3409) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:497) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:640) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:478) at org.kohsuke.stapler.Stapler.service(Stapler.java:160) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ... more After that all requests to jenkins fail with the same exception. The source of RingBufferLogHandler shows the usage of the primitive int's start and size which are incremented but never decremented ... private int start = 0; private final LogRecord[] records; private volatile int size = 0; ... public synchronized void publish(LogRecord record) { int len = records.length; records[(start+size)%len]=record; if(size==len) { start++; } else { size++; } } So after a time an overflow occures and cause the ArrayIndexOutOfBoundsException.

    Jenkins JIRA | 6 years ago | Marco Rothe
    java.lang.ArrayIndexOutOfBoundsException: -255
  2. 0

    On our jenkins (1.403) the following exception occured (only a restart can the system bring back to a normal behaviour): java.lang.ArrayIndexOutOfBoundsException: -255 at hudson.util.RingBufferLogHandler.publish(RingBufferLogHandler.java:52) at java.util.logging.Logger.log(Unknown Source) at java.util.logging.Logger.doLog(Unknown Source) at java.util.logging.Logger.log(Unknown Source) at java.util.logging.Logger.fine(Unknown Source) at hudson.security.SidACL.hasPermission(SidACL.java:54) at hudson.security.ACL.checkPermission(ACL.java:52) at hudson.model.Node.checkPermission(Node.java:316) at hudson.model.Hudson.getTarget(Hudson.java:3409) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:497) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:640) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:478) at org.kohsuke.stapler.Stapler.service(Stapler.java:160) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ... more After that all requests to jenkins fail with the same exception. The source of RingBufferLogHandler shows the usage of the primitive int's start and size which are incremented but never decremented ... private int start = 0; private final LogRecord[] records; private volatile int size = 0; ... public synchronized void publish(LogRecord record) { int len = records.length; records[(start+size)%len]=record; if(size==len) { start++; } else { size++; } } So after a time an overflow occures and cause the ArrayIndexOutOfBoundsException.

    Jenkins JIRA | 6 years ago | Marco Rothe
    java.lang.ArrayIndexOutOfBoundsException: -255

    Root Cause Analysis

    1. java.lang.ArrayIndexOutOfBoundsException

      -255

      at hudson.util.RingBufferLogHandler.publish()
    2. Hudson
      RingBufferLogHandler.publish
      1. hudson.util.RingBufferLogHandler.publish(RingBufferLogHandler.java:52)
      1 frame
    3. Java RT
      Logger.fine
      1. java.util.logging.Logger.log(Unknown Source)
      2. java.util.logging.Logger.doLog(Unknown Source)
      3. java.util.logging.Logger.log(Unknown Source)
      4. java.util.logging.Logger.fine(Unknown Source)
      4 frames
    4. Hudson
      Hudson.getTarget
      1. hudson.security.SidACL.hasPermission(SidACL.java:54)
      2. hudson.security.ACL.checkPermission(ACL.java:52)
      3. hudson.model.Node.checkPermission(Node.java:316)
      4. hudson.model.Hudson.getTarget(Hudson.java:3409)
      4 frames
    5. Stapler
      Stapler.service
      1. org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:497)
      2. org.kohsuke.stapler.Stapler.invoke(Stapler.java:640)
      3. org.kohsuke.stapler.Stapler.invoke(Stapler.java:478)
      4. org.kohsuke.stapler.Stapler.service(Stapler.java:160)
      4 frames
    6. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      1 frame
    7. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames