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

SandboxInterceptorTest "templates" test failure blocking compilation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: script-security-plugin
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      When running "mvn install" on the latest tagged release version (script-security-1.9) from the GitHub repo, I get the listed error:

      ```
      Tests in error:
      templates(org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest): Scripts not permitted to use method java.io.PrintWriter print java.lang.String

      Tests run: 46, Failures: 0, Errors: 1, Skipped: 2
      ```

      Same result when building the trunk/master branch (I assume the dev version).

      Please advise how to proceed, we are blocked on building this. Something is amiss.

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

          This is working fine for me under

          Linux jglick-t520 3.16.0-24-generic #32-Ubuntu SMP Tue Oct 28 13:07:32 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
          java version "1.7.0_67"
          Java(TM) SE Runtime Environment (build 1.7.0_67-b0
          Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

          I believe GroovyCallSiteSelector.staticMethod is failing to deterministically pick the most specific overload.

          Show
          jglick Jesse Glick added a comment - This is working fine for me under Linux jglick-t520 3.16.0-24-generic #32-Ubuntu SMP Tue Oct 28 13:07:32 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux java version "1.7.0_67" Java(TM) SE Runtime Environment (build 1.7.0_67-b0 Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode) I believe GroovyCallSiteSelector.staticMethod is failing to deterministically pick the most specific overload.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelector.java
          src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelectorTest.java
          src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java
          http://jenkins-ci.org/commit/script-security-plugin/a2c56252ec334d07e59f0c998e9c61324ad6baad
          Log:
          [FIXED JENKINS-25524] Wrong overload of PrintWriter.print was sometimes being selected, at random.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelector.java src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelectorTest.java src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java http://jenkins-ci.org/commit/script-security-plugin/a2c56252ec334d07e59f0c998e9c61324ad6baad Log: [FIXED JENKINS-25524] Wrong overload of PrintWriter.print was sometimes being selected, at random.
          Hide
          jklinect James Klinect added a comment -

          Saw this earlier, the total turnaround time (filing-to-fixed) is incredible. Remarkable. Astonishing? I can't decide which word does it the most justice. Pulling in the fix allowed me to build the plugin successfully. Thanks for patching this!

          Show
          jklinect James Klinect added a comment - Saw this earlier, the total turnaround time (filing-to-fixed) is incredible. Remarkable. Astonishing? I can't decide which word does it the most justice. Pulling in the fix allowed me to build the plugin successfully. Thanks for patching this!
          Hide
          jglick Jesse Glick added a comment -

          Sure. Fortunately this fix was pretty easy to make. I think there are probably more obscure corner cases that are not yet being handled correctly, so pull requests with accompanying tests are welcome. (In this case it was not the functionality you really cared about, but rather the fact that the test was nondeterministic on Java 7+. Ironically it was asserting the wrong overload, though it could have failed on some runs either way.)

          Show
          jglick Jesse Glick added a comment - Sure. Fortunately this fix was pretty easy to make. I think there are probably more obscure corner cases that are not yet being handled correctly, so pull requests with accompanying tests are welcome. (In this case it was not the functionality you really cared about, but rather the fact that the test was nondeterministic on Java 7+. Ironically it was asserting the wrong overload, though it could have failed on some runs either way.)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/resources/org/jenkinsci/plugins/scriptsecurity/sandbox/whitelists/generic-whitelist
          src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java
          http://jenkins-ci.org/commit/script-security-plugin/72c574d39f7a79c66574049642889a380aa608e0
          Log:
          JENKINS-25524 Making sure that the correct overload of PrintWriter.print is whitelisted by default for use from Groovy templates.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/resources/org/jenkinsci/plugins/scriptsecurity/sandbox/whitelists/generic-whitelist src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java http://jenkins-ci.org/commit/script-security-plugin/72c574d39f7a79c66574049642889a380aa608e0 Log: JENKINS-25524 Making sure that the correct overload of PrintWriter.print is whitelisted by default for use from Groovy templates.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelector.java
          src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java
          http://jenkins-ci.org/commit/script-security-plugin/bb4cafb542058271d753d8a2d56cc7f9ac0399c2
          Log:
          JENKINS-25524 There are cases where Groovy picks one of two incomparable overloads even where javac would report an error; they must be allowed.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelector.java src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java http://jenkins-ci.org/commit/script-security-plugin/bb4cafb542058271d753d8a2d56cc7f9ac0399c2 Log: JENKINS-25524 There are cases where Groovy picks one of two incomparable overloads even where javac would report an error; they must be allowed.

            People

            • Assignee:
              jglick Jesse Glick
              Reporter:
              jklinect James Klinect
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: