Harmony
  1. Harmony
  2. HARMONY-6395

[classlib][luni] Arrays.sort(double []) will result in StackOverflowError for specific arrays input

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M11
    • Fix Version/s: 5.0M13
    • Component/s: Classlib
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      There is a simple testcase as below. You can see StackOverflowError if run this testcase. This is a defect of Arrays.sort(double []), I have attached a fix for it.

      import java.util.Arrays;

      public class SortTest {
      public static void main(String[] args) {
      double[] array =

      { Double.NaN, 1.0, 2.0, Double.NaN, Double.NaN, 3.0, 4.0 }

      ;
      displayArray(array);
      Arrays.sort(array);
      displayArray(array);

      System.out.println();
      }

      private static void displayArray(double[] array)

      { for (double d : array) System.out.print(d + " "); System.out.println(); }

      }

      1. HARMONY-6395.diff
        3 kB
        Jim Yu
      2. harmony-6395-2.patch
        5 kB
        Tim Ellison

        Activity

        Tim Ellison made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0M13 [ 12314443 ]
        Resolution Fixed [ 1 ]
        Tim Ellison made changes -
        Fix Version/s 5.0M12 [ 12314191 ]
        Tim Ellison made changes -
        Attachment harmony-6395-2.patch [ 12426902 ]
        Sean Qiu made changes -
        Assignee Sean Qiu [ qiuxiaox ]
        Jim Yu made changes -
        Field Original Value New Value
        Attachment HARMONY-6395.diff [ 12426402 ]
        Jim Yu created issue -

          People

          • Assignee:
            Sean Qiu
            Reporter:
            Jim Yu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development