Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1294

Data race PolynomialUtils::buildPolynomial

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0, 3.6

      Description

      If you run PolynomialUtilsTest methods concurrently there will occur problem with ComparisonFailure due to incorrect building of coefficient list. https://github.com/apache/commons-math/blob/master/src/main/java/org/apache/commons/math4/analysis/polynomials/PolynomialsUtils.java#L368 should be in synchronized block. Explanation: polynomial of given degree can be created by other thread and when primary thread access synchronized block, there is already created coefficients for this degree, therefore no coefficients should be added to coefficients list.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fifol Kamil Włodarczyk
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: