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

"incompatible InnerClasses attribute" error in IBM J9 VM

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • windows 2008 R2, Tomcat 6.0.32, IBM Java 1.6 SR15

      When starting Jenkins, it always happen that a Slave disappears. The node is simply vanished.
      I have tried looking for specific errors in the log without success, even looking at all log levels. There is an error while unmarshalling an xml, but unsure if it is related. See the stack trace below in any case.

      I have to note that only one disappears, not all.

      The curious thing comes that if I click "Reload configuration from disk", the disappeared slave is loaded correctly this time (the configuration was in the xml there all along, and I'm not overwriting it).

      Information about my instance:
      Version: 1.547 (happened with 1.532 as well)
      java.vm.info JRE 1.6.0 IBM J9 2.4 Windows Server 2008 R2 amd64-64 jvmwa6460sr15-20131016_170922 (JIT enabled, AOT enabled)>J9VM - 20131016_170922>JIT - r9_20130920_46510ifx2>GC - GA24_Java6_SR15_20131016_1337_B170922 (happened with an older version as well, tried updating. I'm aware that IBM Java is not officially supported).
      Using tomcat 6.0.32, on a windows 2008 R2 Standard.

      Possible related bug: https://issues.jenkins-ci.org/browse/JENKINS-21867
      (Also on Windows 2008)

      Error that might be related:
      FINE hudson.util.RobustReflectionConverter addErrorInContext
      Failed to load
      java.lang.IncompatibleClassChangeError: incompatible InnerClasses attribute between "hudson.model.Queue$ItemList" and "hudson.model.Queue"
      at java.lang.Class.getDeclaringClass(Class.java:781)
      at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:46)
      at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:89)
      at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:98)
      at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:134)
      at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:43)
      at sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:79)
      at java.lang.reflect.Field.getGenericType(Field.java:236)
      at com.thoughtworks.xstream.mapper.AnnotationMapper.processTypes(AnnotationMapper.java:207)
      at com.thoughtworks.xstream.mapper.AnnotationMapper.processAnnotations(AnnotationMapper.java:165)
      at com.thoughtworks.xstream.mapper.AnnotationMapper.defaultImplementationOf(AnnotationMapper.java:122)
      at hudson.util.xstream.MapperDelegate.defaultImplementationOf(MapperDelegate.java:59)
      at com.thoughtworks.xstream.mapper.MapperWrapper.defaultImplementationOf(MapperWrapper.java:46)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:54)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
      at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
      at hudson.util.RobustCollectionConverter.populateCollection(RobustCollectionConverter.java:83)
      at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61)
      at hudson.util.RobustCollectionConverter.unmarshal(RobustCollectionConverter.java:74)
      at hudson.slaves.NodeList$ConverterImpl.unmarshal(NodeList.java:162)
      at hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:338)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:328)
      at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:274)
      at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:221)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
      at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1061)
      at hudson.util.XStream2.unmarshal(XStream2.java:109)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1045)
      at hudson.XmlFile.unmarshal(XmlFile.java:163)
      at jenkins.model.Jenkins$17.run(Jenkins.java:2545)
      at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
      at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
      at jenkins.model.Jenkins$7.runTask(Jenkins.java:899)
      at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
      at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:906)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:929)
      at java.lang.Thread.run(Thread.java:761)

        1. Queue.diff
          116 kB
        2. Queue-compile.javap
          208 kB
        3. Queue-package.javap
          211 kB

          [JENKINS-22525] "incompatible InnerClasses attribute" error in IBM J9 VM

          Changed the title to accurately capture the issue.

          Kohsuke Kawaguchi added a comment - Changed the title to accurately capture the issue.

          Kohsuke Kawaguchi added a comment - - edited

          As for ItemList not in the InnerClasses attribute, I'm discovering with the following test case that if a nested/inner class is marked as private, it does not get recorded in the InnerClasses attribute:

          public class App 
          {
              private static class Foo {}
              private class Bar {}
          
              static class Alpha {}
              class Bravo {}
          
              public static void main( String[] args )
              {
                  System.out.println(Foo.class.getEnclosingClass());
                  System.out.println(Bar.class.getEnclosingClass());
          
                  System.out.println(Alpha.class.getEnclosingClass());
                  System.out.println(Bravo.class.getEnclosingClass());
              }
          }
          
          Classfile /files/kohsuke/ws/jenkins/investigations/JENKINS-22525/jenkins22525/target/classes/test/App.class
            Last modified Jul 31, 2014; size 1158 bytes
            MD5 checksum 264ed3611a578e1a4c8e2d4e0ea8b378
            Compiled from "App.java"
          public class test.App
            SourceFile: "App.java"
            InnerClasses: 
                 #11= #8 of #9; //Bravo=class test/App$Bravo of class test/App
                 static #13= #7 of #9; //Alpha=class test/App$Alpha of class test/App
            RuntimeInvisibleAnnotations:
              0: #57()
            minor version: 0
            major version: 49
            flags: ACC_PUBLIC, ACC_SUPER
          
          Classfile /files/kohsuke/ws/jenkins/investigations/JENKINS-22525/jenkins22525/target/classes/test/App$Foo.class
            Last modified Jul 31, 2014; size 303 bytes
            MD5 checksum 3f4b082e8d8c5cbf85d4afeb7807b253
            Compiled from "App.java"
          class test.App$Foo
            SourceFile: "App.java"
            minor version: 0
            major version: 49
            flags: ACC_SUPER
          
          Classfile /files/kohsuke/ws/jenkins/investigations/JENKINS-22525/jenkins22525/target/classes/test/App$Alpha.class
            Last modified Jul 31, 2014; size 309 bytes
            MD5 checksum df99610f5b28798c5f07f308b749df89
            Compiled from "App.java"
          class test.App$Alpha
            SourceFile: "App.java"
            InnerClasses: 
                 static #10= #2 of #16; //Alpha=class test/App$Alpha of class test/App
            minor version: 0
            major version: 49
            flags: ACC_SUPER
          

          This seems to violate JVM spec of the InnerClass attribute. J9 VM accepts this without reporting an error. In this case I don't understand how JVM can correctly determine that App$Foo has an enclosing class. From the byte code, there's no way to distinguish this vs compiling the following class:

          class App {}
          class App$Foo {} // '$' is a legal character in a class name in Java
          

          Kohsuke Kawaguchi added a comment - - edited As for ItemList not in the InnerClasses attribute, I'm discovering with the following test case that if a nested/inner class is marked as private, it does not get recorded in the InnerClasses attribute: public class App { private static class Foo {} private class Bar {} static class Alpha {} class Bravo {} public static void main( String [] args ) { System .out.println(Foo. class. getEnclosingClass()); System .out.println(Bar. class. getEnclosingClass()); System .out.println(Alpha. class. getEnclosingClass()); System .out.println(Bravo. class. getEnclosingClass()); } } Classfile /files/kohsuke/ws/jenkins/investigations/JENKINS-22525/jenkins22525/target/classes/test/App.class Last modified Jul 31, 2014; size 1158 bytes MD5 checksum 264ed3611a578e1a4c8e2d4e0ea8b378 Compiled from "App.java" public class test.App SourceFile: "App.java" InnerClasses: #11= #8 of #9; //Bravo=class test/App$Bravo of class test/App static #13= #7 of #9; //Alpha=class test/App$Alpha of class test/App RuntimeInvisibleAnnotations: 0: #57() minor version: 0 major version: 49 flags: ACC_PUBLIC, ACC_SUPER Classfile /files/kohsuke/ws/jenkins/investigations/JENKINS-22525/jenkins22525/target/classes/test/App$Foo.class Last modified Jul 31, 2014; size 303 bytes MD5 checksum 3f4b082e8d8c5cbf85d4afeb7807b253 Compiled from "App.java" class test.App$Foo SourceFile: "App.java" minor version: 0 major version: 49 flags: ACC_SUPER Classfile /files/kohsuke/ws/jenkins/investigations/JENKINS-22525/jenkins22525/target/classes/test/App$Alpha.class Last modified Jul 31, 2014; size 309 bytes MD5 checksum df99610f5b28798c5f07f308b749df89 Compiled from "App.java" class test.App$Alpha SourceFile: "App.java" InnerClasses: static #10= #2 of #16; //Alpha=class test/App$Alpha of class test/App minor version: 0 major version: 49 flags: ACC_SUPER This seems to violate JVM spec of the InnerClass attribute . J9 VM accepts this without reporting an error. In this case I don't understand how JVM can correctly determine that App$Foo has an enclosing class. From the byte code, there's no way to distinguish this vs compiling the following class: class App {} class App$Foo {} // '$' is a legal character in a class name in Java

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3569
          [FIXED JENKINS-22525] (Revision 4e23793f62aa5019226f2ba96f8063f01affeb92)

          Result = SUCCESS
          kohsuke : 4e23793f62aa5019226f2ba96f8063f01affeb92
          Files :

          • pom.xml
          • core/pom.xml
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #3569 [FIXED JENKINS-22525] (Revision 4e23793f62aa5019226f2ba96f8063f01affeb92) Result = SUCCESS kohsuke : 4e23793f62aa5019226f2ba96f8063f01affeb92 Files : pom.xml core/pom.xml changelog.html

          Martin Kutter added a comment -

          The fix seems to work around the issue - I've been unable to reproduce the error with a build from sources with the fix applied.

          Runtime: Windows 7, IBM J9 VM (build 2.6, JRE 1.7.0 Windows 7 amd64-64 Compressed References 20130617_152572 (JIT enabled, AOT enabled)

          Martin Kutter added a comment - The fix seems to work around the issue - I've been unable to reproduce the error with a build from sources with the fix applied. Runtime: Windows 7, IBM J9 VM (build 2.6, JRE 1.7.0 Windows 7 amd64-64 Compressed References 20130617_152572 (JIT enabled, AOT enabled)

          dan tran added a comment -

          dont see it at 1.575 http://jenkins-ci.org/changelog.

          dan tran added a comment - dont see it at 1.575 http://jenkins-ci.org/changelog .

          Jesse Glick added a comment -

          @dantran because it was committed toward 1.576.

          Jesse Glick added a comment - @dantran because it was committed toward 1.576.

          Daniel Beck added a comment -

          Literally one click away: "Upcoming changes"

          Daniel Beck added a comment - Literally one click away: "Upcoming changes"

          dan tran added a comment -

          thanks, I am now running 1.576-SNAPSHOT. Good to see this issue is fixed

          dan tran added a comment - thanks, I am now running 1.576-SNAPSHOT. Good to see this issue is fixed

          Martin Kutter added a comment -

          IBM has tracked the issue with "incompatible inner Class attribute" as APAR IV62298 - see http://www-01.ibm.com/support/docview.wss?uid=swg1IV62298
          I've received an iFix for Java 7SR7 from IBM, which fixes the issue.

          The fix will be applied in the upcoming IBM JDK 7 SR 8.

          Martin Kutter added a comment - IBM has tracked the issue with "incompatible inner Class attribute" as APAR IV62298 - see http://www-01.ibm.com/support/docview.wss?uid=swg1IV62298 I've received an iFix for Java 7SR7 from IBM, which fixes the issue. The fix will be applied in the upcoming IBM JDK 7 SR 8.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          core/pom.xml
          pom.xml
          http://jenkins-ci.org/commit/jenkins/e4dc3b4210fb6afd80ddf138cafc6bfcb866df5f
          Log:
          [FIXED JENKINS-22525]

          Integrated a bridge-method-injector that rebuilds the constant pool from
          scratch.

          (cherry picked from commit 4e23793f62aa5019226f2ba96f8063f01affeb92)

          Conflicts:
          changelog.html

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/pom.xml pom.xml http://jenkins-ci.org/commit/jenkins/e4dc3b4210fb6afd80ddf138cafc6bfcb866df5f Log: [FIXED JENKINS-22525] Integrated a bridge-method-injector that rebuilds the constant pool from scratch. (cherry picked from commit 4e23793f62aa5019226f2ba96f8063f01affeb92) Conflicts: changelog.html

            kohsuke Kohsuke Kawaguchi
            gabriel Gabriel Lopez
            Votes:
            6 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: