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

bytecode-compatibility-transformer produces malformed bytecode

      In the case where we see this issue, an @AdaptField annotation on Queue.Item was causing transformations in other classes not intended for transformation (in our case, in an elasticsearch class). The result of this transformation was a StackMapFrame verifier error.

      this issue tracks the tracks:

        • bytecode-compatibility-transformer doesn't properly support updating of StackMapFrames after manipulation.

          [JENKINS-28781] bytecode-compatibility-transformer produces malformed bytecode

          Tom FENNELLY added a comment -

          Root cause seems to be the same as with JENKINS-19383 i.e. rewriting methods/fields that should not be rewritten.

          Tom FENNELLY added a comment - Root cause seems to be the same as with JENKINS-19383 i.e. rewriting methods/fields that should not be rewritten.

          James Nord added a comment -

          unfortunately the binaries for this are not available (unreleased version).

          Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 20
          Exception Details:
            Location:
              org/elasticsearch/common/settings/ImmutableSettings$Builder.get(Ljava/lang/String;)Ljava/lang/String; @15: ifnull
            Reason:
              Expected stackmap frame at this location.
            Bytecode:
              0x0000000: 2ab4 002a 2bb9 003a 0200 c000 354d 2cc6
              0x0000010: 0005 2cb0 2ab4 002a 2bb8 003f b900 3a02
              0x0000020: 00c0 0035 b0
          
                  at org.elasticsearch.common.settings.ImmutableSettings.<clinit>(ImmutableSettings.java:57)
                  at com.cloudbees.opscenter.elasticsearch.embedded.EmbeddedNode.start(EmbeddedNode.java:94)
          

          James Nord added a comment - unfortunately the binaries for this are not available (unreleased version). Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 20 Exception Details: Location: org/elasticsearch/common/settings/ImmutableSettings$Builder.get(Ljava/lang/String;)Ljava/lang/String; @15: ifnull Reason: Expected stackmap frame at this location. Bytecode: 0x0000000: 2ab4 002a 2bb9 003a 0200 c000 354d 2cc6 0x0000010: 0005 2cb0 2ab4 002a 2bb8 003f b900 3a02 0x0000020: 00c0 0035 b0 at org.elasticsearch.common.settings.ImmutableSettings.<clinit>(ImmutableSettings.java:57) at com.cloudbees.opscenter.elasticsearch.embedded.EmbeddedNode.start(EmbeddedNode.java:94)

          James Nord added a comment -

          James Nord added a comment - https://github.com/jenkinsci/bytecode-compatibility-transformer/pull/2

          Code changed in jenkins
          User: James Nord
          Path:
          src/main/java/org/jenkinsci/bytecode/Transformer.java
          http://jenkins-ci.org/commit/bytecode-compatibility-transformer/33cd0196b5f7e1957534ab1d2dae4de78a1bfd5d
          Log:
          [ISSUE JENKINS-28781] Regernate the stack frames.

          We should always re-generate the stack map frames when re-writing methods.

          As the asm can not compute frames for code with subroutines we also need
          to inline any subroutines.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: src/main/java/org/jenkinsci/bytecode/Transformer.java http://jenkins-ci.org/commit/bytecode-compatibility-transformer/33cd0196b5f7e1957534ab1d2dae4de78a1bfd5d Log: [ISSUE JENKINS-28781] Regernate the stack frames. We should always re-generate the stack map frames when re-writing methods. As the asm can not compute frames for code with subroutines we also need to inline any subroutines.

          Code changed in jenkins
          User: James Nord
          Path:
          .gitignore
          src/main/java/org/jenkinsci/bytecode/Transformer.java
          http://jenkins-ci.org/commit/bytecode-compatibility-transformer/cda6033617f92a6acbe571fdb09efafdc4921dab
          Log:
          Merge pull request #2 from jtnord/JENKINS-28781-part1

          JENKINS-28781 Fix generated bytecode

          Compare: https://github.com/jenkinsci/bytecode-compatibility-transformer/compare/494273053c7c...cda6033617f9

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: .gitignore src/main/java/org/jenkinsci/bytecode/Transformer.java http://jenkins-ci.org/commit/bytecode-compatibility-transformer/cda6033617f92a6acbe571fdb09efafdc4921dab Log: Merge pull request #2 from jtnord/ JENKINS-28781 -part1 JENKINS-28781 Fix generated bytecode Compare: https://github.com/jenkinsci/bytecode-compatibility-transformer/compare/494273053c7c...cda6033617f9

          Code changed in jenkins
          User: James Nord
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/80ea8982f35119a19e2d5b36ba3cfefe125d367d
          Log:
          JENKINS-28781 update the bct library to 1.6.2.

          Pickup the changes in the bytecode-compatibility-transformer for
          JENKINS-28781

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/80ea8982f35119a19e2d5b36ba3cfefe125d367d Log: JENKINS-28781 update the bct library to 1.6.2. Pickup the changes in the bytecode-compatibility-transformer for JENKINS-28781

          Code changed in jenkins
          User: James Nord
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/6af3df951fef38e89fe8d01e8b827e8164565171
          Log:
          Merge pull request #1857 from jtnord/JENKINS-28781

          JENKINS-28781 update the bct library to 1.6.2.

          Compare: https://github.com/jenkinsci/jenkins/compare/a79e2f144a93...6af3df951fef

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/6af3df951fef38e89fe8d01e8b827e8164565171 Log: Merge pull request #1857 from jtnord/ JENKINS-28781 JENKINS-28781 update the bct library to 1.6.2. Compare: https://github.com/jenkinsci/jenkins/compare/a79e2f144a93...6af3df951fef

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4308
          JENKINS-28781 update the bct library to 1.6.2. (Revision 80ea8982f35119a19e2d5b36ba3cfefe125d367d)

          Result = SUCCESS
          james nord : 80ea8982f35119a19e2d5b36ba3cfefe125d367d
          Files :

          • core/pom.xml

          dogfood added a comment - Integrated in jenkins_main_trunk #4308 JENKINS-28781 update the bct library to 1.6.2. (Revision 80ea8982f35119a19e2d5b36ba3cfefe125d367d) Result = SUCCESS james nord : 80ea8982f35119a19e2d5b36ba3cfefe125d367d Files : core/pom.xml

          Code changed in jenkins
          User: James Nord
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/7f1ad86d646204fbda45bfcf7a7c044d0d81adce
          Log:
          Noting JENKINS-28781

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: changelog.html http://jenkins-ci.org/commit/jenkins/7f1ad86d646204fbda45bfcf7a7c044d0d81adce Log: Noting JENKINS-28781

          James Nord added a comment -

          Fixed in bytecode-compatability-transformer version 1.6.2
          integrated into Jenkins 1.633

          James Nord added a comment - Fixed in bytecode-compatability-transformer version 1.6.2 integrated into Jenkins 1.633

            Unassigned Unassigned
            tfennelly Tom FENNELLY
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: