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

Race condition in creating fingerprints for artifacts

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • None

      There's a race-condition when creating fingerprints because Util reuses the same byte buffer for all DigestInputStreams

          [JENKINS-10346] Race condition in creating fingerprints for artifacts

          This is because DigestInputStream implements the method in the following way.

              public int read(byte[] b, int off, int len) throws IOException {
                  int result = in.read(b, off, len);
                  if (on && result != -1) {
                      digest.update(b, off, result);
                  }
                  return result;
              }
          

          Kohsuke Kawaguchi added a comment - This is because DigestInputStream implements the method in the following way. public int read(byte[] b, int off, int len) throws IOException { int result = in.read(b, off, len); if (on && result != -1) { digest.update(b, off, result); } return result; }

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          core/src/main/java/hudson/Util.java
          core/src/test/java/hudson/UtilTest.java
          http://jenkins-ci.org/commit/jenkins/3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461
          Log:
          [FIXED JENKINS-10346] thread-safety problem when computing fingerprints

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html core/src/main/java/hudson/Util.java core/src/test/java/hudson/UtilTest.java http://jenkins-ci.org/commit/jenkins/3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461 Log: [FIXED JENKINS-10346] thread-safety problem when computing fingerprints

          dogfood added a comment -

          Integrated in jenkins_main_trunk #956
          [FIXED JENKINS-10346] thread-safety problem when computing fingerprints

          Kohsuke Kawaguchi : 3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461
          Files :

          • core/src/test/java/hudson/UtilTest.java
          • core/src/main/java/hudson/Util.java
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #956 [FIXED JENKINS-10346] thread-safety problem when computing fingerprints Kohsuke Kawaguchi : 3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461 Files : core/src/test/java/hudson/UtilTest.java core/src/main/java/hudson/Util.java changelog.html

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          core/src/main/java/hudson/Util.java
          core/src/test/java/hudson/UtilTest.java
          http://jenkins-ci.org/commit/jenkins/e436a288cb37c7ce0a635026598334f87e6e63e6
          Log:
          [FIXED JENKINS-10346] thread-safety problem when computing fingerprints
          (cherry picked from commit 3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461)

          Conflicts:

          changelog.html

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html core/src/main/java/hudson/Util.java core/src/test/java/hudson/UtilTest.java http://jenkins-ci.org/commit/jenkins/e436a288cb37c7ce0a635026598334f87e6e63e6 Log: [FIXED JENKINS-10346] thread-safety problem when computing fingerprints (cherry picked from commit 3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461) Conflicts: changelog.html

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          core/src/main/java/hudson/Util.java
          core/src/test/java/hudson/UtilTest.java
          http://jenkins-ci.org/commit/jenkins/3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461
          Log:
          [FIXED JENKINS-10346] thread-safety problem when computing fingerprints

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html core/src/main/java/hudson/Util.java core/src/test/java/hudson/UtilTest.java http://jenkins-ci.org/commit/jenkins/3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461 Log: [FIXED JENKINS-10346] thread-safety problem when computing fingerprints

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          core/src/main/java/hudson/Util.java
          core/src/test/java/hudson/UtilTest.java
          http://jenkins-ci.org/commit/jenkins/3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461
          Log:
          [FIXED JENKINS-10346] thread-safety problem when computing fingerprints

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html core/src/main/java/hudson/Util.java core/src/test/java/hudson/UtilTest.java http://jenkins-ci.org/commit/jenkins/3c09a0c43ac85c2f85a6fd25fc12c2ab357f1461 Log: [FIXED JENKINS-10346] thread-safety problem when computing fingerprints

            kutzi kutzi
            kutzi kutzi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: