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

Race condition in creating fingerprints for artifacts

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

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

        Attachments

          Issue Links

            Activity

            Hide
            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;
                }
            
            Show
            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; }
            Hide
            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

            Show
            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
            Hide
            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
            Show
            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
            Hide
            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

            Show
            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
            Hide
            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

            Show
            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
            Hide
            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

            Show
            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

              • Assignee:
                kutzi kutzi
                Reporter:
                kutzi kutzi
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: