-
Bug
-
Resolution: Fixed
-
Critical
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)
else
{ size++; }}
So after a time an overflow occures and cause the ArrayIndexOutOfBoundsException.
- is related to
-
JENKINS-20863 Integer overflow in SupportLogHandler
-
- Closed
-
[JENKINS-9120] RingBufferLogHandler throws ArrayIndexOutOfBoundsException after int-overflow
Priority | Original: Minor [ 4 ] | New: Critical [ 2 ] |
Attachment | New: JENKINS-9120-ringbuffer-stacktrace-cr.log [ 23805 ] |
Same issue on our jenkins (1.499), the stacktrace:
Jan 22, 2013 4:11:23 AM winstone.Logger logInternal
WARNING: Untrapped Error in Servlet
java.lang.ArrayIndexOutOfBoundsException: -255
at hudson.util.RingBufferLogHandler.publish(RingBufferLogHandler.java:52)
at java.util.logging.Logger.log(Logger.java:478)
at java.util.logging.Logger.doLog(Logger.java:500)
at java.util.logging.Logger.logp(Logger.java:616)
at java.util.logging.Logger.entering(Logger.java:872)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:155)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)
at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:215)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)