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

Race condition in creating fingerprints for artifacts

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Fixed
    • core
    • None

    Description

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

      Attachments

        Issue Links

          Activity

            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 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_issue_link 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 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 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_issue_link 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_issue_link 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_issue_link 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

            People

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

              Dates

                Created:
                Updated:
                Resolved: