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

StringIndexOutOfBoundsException when running external jobs that output non-ASCII characters

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      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";

          [JENKINS-4877] StringIndexOutOfBoundsException when running external jobs that output non-ASCII characters

          Alan Harder added a comment -

          yup, I'm able to reproduce this problem.

          Alan Harder added a comment - yup, I'm able to reproduce this problem.

          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

          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

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

              Created:
              Updated:
              Resolved: