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

Build stats throws illegal argument exception on dashboard view

    XMLWordPrintable

Details

    Description

      Dear all,

      on jenkins 1.597 (and also 1.598) the build stats on Dashboard view (version 2.9.4) doesn't work because of:

      Caught exception evaluating: it.getBuildStat(jobs) in /ci/. Reason: java.lang.IllegalArgumentException: fromKey > toKey
      java.lang.IllegalArgumentException: fromKey > toKey
      	at java.util.TreeMap$NavigableSubMap.<init>(TreeMap.java:1261)
      	at java.util.TreeMap$AscendingSubMap.<init>(TreeMap.java:1699)
      	at java.util.TreeMap.subMap(TreeMap.java:877)
      	at java.util.TreeMap.subMap(TreeMap.java:918)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.subMap(AbstractLazyLoadRunMap.java:250)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.headMap(AbstractLazyLoadRunMap.java:254)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.headMap(AbstractLazyLoadRunMap.java:88)
      	at java.util.Collections$UnmodifiableSortedMap.headMap(Collections.java:1543)
      	at hudson.plugins.view.dashboard.stats.StatBuilds.getBuildStat(StatBuilds.java:48)
      

      etc.

      Please let me know if you need more info.

      Regards

      Davide

      Attachments

        Issue Links

          Activity

            dbolognini Davide Bolognini created issue -

            This problem exists in version 1.599 as well.

            spots107 Jason Spotswood added a comment - This problem exists in version 1.599 as well.
            danielbeck Daniel Beck added a comment -

            Tentatively assigning to jglick as he wrote the new build number based code.

            Current hypothesis is that AbstractLazyLoadRunMap.headMap(Integer) cannot handle negative arguments (as passed by Dashboard View Plugin's Build Statistics Widget when there are fewer builds/lower numbered builds than the limit of 10) since AbstractLazyLoadRunMap.COMPARATOR overflows when given o1=Integer.MAX, o2=-5.

            While there's a trivial workaround (remove that widget from dashboards), I'll leave the priority due to possible severity of the core bug.

            danielbeck Daniel Beck added a comment - Tentatively assigning to jglick as he wrote the new build number based code. Current hypothesis is that AbstractLazyLoadRunMap.headMap(Integer) cannot handle negative arguments (as passed by Dashboard View Plugin's Build Statistics Widget when there are fewer builds/lower numbered builds than the limit of 10) since AbstractLazyLoadRunMap.COMPARATOR overflows when given o1=Integer.MAX, o2=-5. While there's a trivial workaround (remove that widget from dashboards), I'll leave the priority due to possible severity of the core bug.
            danielbeck Daniel Beck made changes -
            Field Original Value New Value
            Component/s core [ 15593 ]
            Assignee Peter Hayes [ petehayes ] Jesse Glick [ jglick ]

            I have the same problem with Jenkins 1.599 on OS X 10.9 Server.

            flabrie Francis Labrie added a comment - I have the same problem with Jenkins 1.599 on OS X 10.9 Server.

            Looks like a pretty nasty issue...

            panajev Goffredo Marocchi added a comment - Looks like a pretty nasty issue...
            jglick Jesse Glick added a comment -

            SortedMap.headMap is documented to allow the implementation to throw IllegalArgumentException

            if this map itself has a restricted range, and toKey lies outside the bounds of the range

            and passing a negative argument is clearly “outside the bounds of the range” when the range is Jenkins build numbers, whether or not earlier versions of Jenkins happened to enforce that.

            However it looks like I wrote this call to headMap so I am on the hook to fix either the caller or the implementor.

            jglick Jesse Glick added a comment - SortedMap.headMap is documented to allow the implementation to throw IllegalArgumentException if this map itself has a restricted range, and toKey lies outside the bounds of the range and passing a negative argument is clearly “outside the bounds of the range” when the range is Jenkins build numbers, whether or not earlier versions of Jenkins happened to enforce that. However it looks like I wrote this call to headMap so I am on the hook to fix either the caller or the implementor.
            jglick Jesse Glick made changes -
            Description Dear all,

            on jenkins 1.597 (and also 1.598) the build stats on Dashboard view (version 2.9.4) doesn't work because of:

            Caught exception evaluating: it.getBuildStat(jobs) in /ci/. Reason: java.lang.IllegalArgumentException: fromKey > toKey
            java.lang.IllegalArgumentException: fromKey > toKey
            at java.util.TreeMap$NavigableSubMap.<init>(TreeMap.java:1261)
            at java.util.TreeMap$AscendingSubMap.<init>(TreeMap.java:1699)
            at java.util.TreeMap.subMap(TreeMap.java:877)
            at java.util.TreeMap.subMap(TreeMap.java:918)
            at jenkins.model.lazy.AbstractLazyLoadRunMap.subMap(AbstractLazyLoadRunMap.java:250)
            at jenkins.model.lazy.AbstractLazyLoadRunMap.headMap(AbstractLazyLoadRunMap.java:254)
            at jenkins.model.lazy.AbstractLazyLoadRunMap.headMap(AbstractLazyLoadRunMap.java:88)
            at java.util.Collections$UnmodifiableSortedMap.headMap(Collections.java:1543)
            at hudson.plugins.view.dashboard.stats.StatBuilds.getBuildStat(StatBuilds.java:48)
            etc.

            Please let me know if you need more info.

            Regards

            Davide



            Dear all,

            on jenkins 1.597 (and also 1.598) the build stats on Dashboard view (version 2.9.4) doesn't work because of:

            {code:none}
            Caught exception evaluating: it.getBuildStat(jobs) in /ci/. Reason: java.lang.IllegalArgumentException: fromKey > toKey
            java.lang.IllegalArgumentException: fromKey > toKey
            at java.util.TreeMap$NavigableSubMap.<init>(TreeMap.java:1261)
            at java.util.TreeMap$AscendingSubMap.<init>(TreeMap.java:1699)
            at java.util.TreeMap.subMap(TreeMap.java:877)
            at java.util.TreeMap.subMap(TreeMap.java:918)
            at jenkins.model.lazy.AbstractLazyLoadRunMap.subMap(AbstractLazyLoadRunMap.java:250)
            at jenkins.model.lazy.AbstractLazyLoadRunMap.headMap(AbstractLazyLoadRunMap.java:254)
            at jenkins.model.lazy.AbstractLazyLoadRunMap.headMap(AbstractLazyLoadRunMap.java:88)
            at java.util.Collections$UnmodifiableSortedMap.headMap(Collections.java:1543)
            at hudson.plugins.view.dashboard.stats.StatBuilds.getBuildStat(StatBuilds.java:48)
            {code}
            etc.

            Please let me know if you need more info.

            Regards

            Davide
            jglick Jesse Glick made changes -
            Component/s dashboard-view-plugin [ 15679 ]
            Labels regression
            jglick Jesse Glick added a comment - - edited

            danielbeck’s hypothesis is correct, this was a regression in the fix of JENKINS-24380.

            jglick Jesse Glick added a comment - - edited danielbeck ’s hypothesis is correct, this was a regression in the fix of JENKINS-24380 .
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-24380 [ JENKINS-24380 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 1586 (Web Link)" [ 12128 ]

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java
            core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java
            http://jenkins-ci.org/commit/jenkins/db1f805d68a1aaf8e2d6d1c96cb006fc1dd4c087
            Log:
            [FIXED JENKINS-26690] Integer overflow in AbstractLazyLoadRunMap.headMap with negative arguments.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java http://jenkins-ci.org/commit/jenkins/db1f805d68a1aaf8e2d6d1c96cb006fc1dd4c087 Log: [FIXED JENKINS-26690] Integer overflow in AbstractLazyLoadRunMap.headMap with negative arguments.
            scm_issue_link SCM/JIRA link daemon made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java
            core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java
            http://jenkins-ci.org/commit/jenkins/dac7dfe94e6c21eee92704acace2079668a023b1
            Log:
            JENKINS-26690 Noting merge of #1586.

            Compare: https://github.com/jenkinsci/jenkins/compare/a452023789cc...dac7dfe94e6c

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java http://jenkins-ci.org/commit/jenkins/dac7dfe94e6c21eee92704acace2079668a023b1 Log: JENKINS-26690 Noting merge of #1586. Compare: https://github.com/jenkinsci/jenkins/compare/a452023789cc...dac7dfe94e6c
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3987
            [FIXED JENKINS-26690] Integer overflow in AbstractLazyLoadRunMap.headMap with negative arguments. (Revision db1f805d68a1aaf8e2d6d1c96cb006fc1dd4c087)

            Result = SUCCESS
            jesse glick : db1f805d68a1aaf8e2d6d1c96cb006fc1dd4c087
            Files :

            • core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java
            • core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3987 [FIXED JENKINS-26690] Integer overflow in AbstractLazyLoadRunMap.headMap with negative arguments. (Revision db1f805d68a1aaf8e2d6d1c96cb006fc1dd4c087) Result = SUCCESS jesse glick : db1f805d68a1aaf8e2d6d1c96cb006fc1dd4c087 Files : core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java
            sfin Sven Finsterwalder made changes -
            Link This issue is related to JENKINS-27186 [ JENKINS-27186 ]
            imakowski Ireneusz Makowski made changes -
            Labels regression lts-candidate regression
            olivergondza Oliver Gondža made changes -
            Labels lts-candidate regression regression
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 160765 ] JNJira + In-Review [ 196562 ]

            People

              jglick Jesse Glick
              dbolognini Davide Bolognini
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: