bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/27888] New: Arrays.binarySearch broken for large arrays


From: green at redhat dot com
Subject: [Bug classpath/27888] New: Arrays.binarySearch broken for large arrays
Date: 4 Jun 2006 05:56:57 -0000

Read this...

http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html

...then try this...

class Search {
  public static void main (String[] args)
    {
      byte[] b = new byte[1100000000];
      b[b.length - 1] = 1;
      int index = java.util.Arrays.binarySearch(b, (byte) 1);
      System.out.println ("index = " + index);
    }
}

After a lot of swapping, I get...

$ gij Search
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:
-1064671149
   at java.util.Arrays.binarySearch (libgcj.so.7)
   at Search.main (Search.java:6)


-- 
           Summary: Arrays.binarySearch broken for large arrays
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: green at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27888





reply via email to

[Prev in Thread] Current Thread [Next in Thread]