Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19799

IndexOutOfBoundsException from MappingWorksheet$ReadOnlyList.get in executor threads

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • 1.509.2

      When clicking on the Dead link in the executors widget:

      java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
      	at java.util.ArrayList.rangeCheck(Unknown Source)
      	at java.util.ArrayList.get(Unknown Source)
      	at hudson.model.queue.MappingWorksheet$ReadOnlyList.get(MappingWorksheet.java:102)
      	at hudson.model.queue.MappingWorksheet$ExecutorChunk.execute(MappingWorksheet.java:150)
      	at hudson.model.queue.MappingWorksheet$ExecutorChunk.access$000(MappingWorksheet.java:110)
      	at hudson.model.queue.MappingWorksheet$Mapping.execute(MappingWorksheet.java:298)
      	at hudson.model.Queue.maintain(Queue.java:1045)
      	at hudson.model.Queue.pop(Queue.java:863)
      	at hudson.model.Executor.grabJob(Executor.java:285)
      	at hudson.model.Executor.run(Executor.java:206)
      

      Looking at the code

      assert capacity() >= wc.size();
      int e = 0;
      for (SubTask s : wc) {
          while (!get(e).isAvailable()) // IOOBE
              e++;
          get(e++).set(wuc.createWorkUnit(s));
      }
      

      it seems wrong: when isAvailable is false, you are almost sure to run out of slots, since there is no range check on e.

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: