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

StringIndexOutOfBoundsException when running external jobs that output non-ASCII characters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      When running an external job through "java jar .../hudson-core*.jar jobname
      job.sh", I get a StringIndexOutOfBoundsException if the external program
      outputs non-ASCII characters:

      Exception in thread "/backup/rundar asimov asimov-home: stdout copier"
      java.lang.StringIndexOutOfBoundsException: String index out of range: -3
      at java.lang.String.charAt(String.java:686)
      at hudson.util.EncodingStream.write(EncodingStream.java:45)
      at java.io.FilterOutputStream.write(FilterOutputStream.java:108)
      at hudson.util.DualOutputStream.write(DualOutputStream.java:54)
      at hudson.util.StreamCopyThread.run(StreamCopyThread.java:58)

      I assume this is caused by the following code in EncodingStream.java (b will
      probably be larger than 255 for non-ASCII characters):

      public void write(int b) throws IOException

      { out.write(chars.charAt(b/16)); out.write(chars.charAt(b%16)); }

      private static final String chars = "0123456789ABCDEF";

        Attachments

          Issue Links

            Activity

            Hide
            mindless Alan Harder added a comment -

            yup, I'm able to reproduce this problem.

            Show
            mindless Alan Harder added a comment - yup, I'm able to reproduce this problem.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in hudson
            User: : mindless
            Path:
            trunk/hudson/main/core/src/main/java/hudson/util/EncodingStream.java
            trunk/www/changelog.html
            http://fisheye4.cenqua.com/changelog/hudson/?cs=23819
            Log:
            [FIXED JENKINS-4877] Fixed handling of non-ASCII characters in external job submission

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/util/EncodingStream.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=23819 Log: [FIXED JENKINS-4877] Fixed handling of non-ASCII characters in external job submission

              People

              Assignee:
              mindless Alan Harder
              Reporter:
              rickynils rickynils
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: