Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6772303

(se) IOException: Invalid argument" thrown on a call to Selector.select(value) with -d64

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 7
    • 5.0u12, 5.0u15
    • core-libs
    • b55
    • x86, sparc
    • solaris_9, solaris_10

        On a SunFire X4200 (4 x 2593 MHz, 8192 MB) with Solaris 10:
        $ cat /etc/release
                                Solaris 10 8/07 s10x_u4wos_12b X86
                   Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
                                Use is subject to license terms.
                                    Assembled 16 August 2007

        the following application will throw an exception on the call to Selector's select() when the application is launched with the -d64 flag. This problem is systematically reproduced on one machine (the one described above - remulac) and it never happens on other platforms or on the same one but using the -d32 flag.


        --0<- bug.java --0<---0<---0<---0<---0<---0<---0<---0<--
        import java.io.*;
        import java.nio.channels.Selector;

        class bug {
            public static void main(String[] arg) {
            
        Selector selector = null;
            
                try {
                    System.out.println("Opening selector");
        selector = Selector.open();

                    System.out.println("Waiting on selector");
        selector.select(2000);
                    System.out.println("Waited 2000 ms");

                    System.out.println("Closing selector");
        selector.close();
        } catch (Exception e) {
        e.printStackTrace();
        }
            }
        }
        --0<---0<---0<---0<---0<---0<---0<---0<---0<--


        This is what happens:

        $ java -d64 bug
        Opening selector
        Waiting on selector
        java.io.IOException: Invalid argument
                at sun.nio.ch.DevPollArrayWrapper.poll0(Native Method)
                at sun.nio.ch.DevPollArrayWrapper.poll(DevPollArrayWrapper.java:164)
                at sun.nio.ch.DevPollSelectorImpl.doSelect(DevPollSelectorImpl.java:68)
                at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
                at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
                at bug.main(bug.java:14)

              alanb Alan Bateman
              alopez Alejandro Lopez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: