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

Applies to 1.3.1 only - ServerSocket's accept() throws unexpected SocketExceptio

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.1_09
    • 1.3.1_07
    • hotspot
    • None
    • 09
    • x86
    • linux

      "This bug is specific to 1.3.1 and is not applicable to 1.4.x.

      On Linux, with 1.3.1, the accept function in the HPI is not
      automatically restarted in the event that it is interrupted by a signal.
      It can be interrupted by a signal when the preemptive close interposer
      library used (enabled via J2SE_PREEMPTCLOSE environment variable).

      The implication of this bug is that java.net.ServerSocket's accept()
      method may throw an unexpected SocketException indicating a system call
      has been interrupted.

      Note that a complete fix for this bug also requires that 4503974 be
      fixed in 1.3.1. This is necessary to preserve the semantics of read and
      accept timeouts."

      (we do not have a test case, at present. But verified with Cu's application)
      Got the testcase:
      //Test.java
      import java.io.*;

      class Exec extends Thread {
           public void run () {
              try {
                      Thread.sleep(5000);
                      Runtime.getRuntime().exec("/bin/ls");
                      System.out.println("Hello");
              } catch (Exception ee){System.out.println("ex"+ ee);}
           }

      }
      public class Test {
           public static void main(String args[]) throws IOException {
              Exec e1 = new Exec();
              e1.start();
              (new java.net.ServerSocket(0)).accept();


           }
      }

            hgodugusunw Harsha Godugu (Inactive)
            hgodugusunw Harsha Godugu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: