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

Socket Exception from bind to localhost if JVM installed on a share.

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      C:\Programme\java>jdk1.6.0_31\bin\java -version
      java version "1.6.0_31"
      Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
      Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

      This errors also shows on each of the following jre's , jdk's:
      1.5.0_10
      1.6.0_45
      1.7.0_17_32 (32-bit Version)
      1.7.0_17_64 (64-bit Version) on 64-bit Windows

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]
      Windows 8
      Windows 7

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      The JVM is installed in a folger residing on a shared file system.
      The right to list the folder' content is withdrawn on one of its parent folders.
      If each of the parent folders can be listet, the error doesn't show.
      If the JVM-Folder resides on a local disk, and the user doesn't have the right to list one of its parent folders, the error doesn't show.

      A DESCRIPTION OF THE PROBLEM :
      Running
      1 import java.net.*;
      2 public class helbig2 {
      3 public static void main(String[] arg) throws Exception {
      4 ServerSocket serverSocket = new ServerSocket();
      5 InetSocketAddress inetSocketAddress = new InetSocketAddress(InetAddress.
      6 getByName("127.0.0.1"), 0);
      7 serverSocket.bind(inetSocketAddress, 0);
      8 int port=serverSocket.getLocalPort();
      9 Socket socket = new Socket();
      10 socket.connect(new InetSocketAddress("127.0.0.1", port), 500);
      11 }
      12 }

      outputs

      W:\HFDBtest>jdk1.6.0_31\bin\java helbig2
      Exception in thread "main" java.net.SocketException: Invalid argument: create
              at java.net.ServerSocket.createImpl(ServerSocket.java:264)
              at java.net.ServerSocket.getImpl(ServerSocket.java:214)
              at java.net.ServerSocket.bind(ServerSocket.java:328)
              at helbig2.main(helbig2.java:7)

      Of course, the program shouldn't output anything.

      Two of this enterprise's critical java applications rely on running a JVM which resides on a shared folder. Security polices enforce some of its parent folders being unreadable.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. copy a jre-folder to a folder whose parent folder cannot be listed because of restricted rights given to the windows user.

      2. compile the following program:
      1 import java.net.*;
      2 public class helbig2 {
      3 public static void main(String[] arg) throws Exception {
      4 ServerSocket serverSocket = new ServerSocket();
      5 InetSocketAddress inetSocketAddress = new InetSocketAddress(InetAddress.
      6 getByName("127.0.0.1"), 0);
      7 serverSocket.bind(inetSocketAddress, 0);
      8 int port=serverSocket.getLocalPort();
      9 Socket socket = new Socket();
      10 socket.connect(new InetSocketAddress("127.0.0.1", port), 500);
      11 }
      12 }


      3. Run the program with java from the jre-folder.
      W:\HFDBtest>jdk1.6.0_31\bin\java helbig2



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No output.
      ACTUAL -
      W:\HFDBtest>jdk1.6.0_31\bin\java helbig2
      Exception in thread "main" java.net.SocketException: Invalid argument: create
              at java.net.ServerSocket.createImpl(ServerSocket.java:264)
              at java.net.ServerSocket.getImpl(ServerSocket.java:214)
              at java.net.ServerSocket.bind(ServerSocket.java:328)
              at helbig2.main(helbig2.java:7)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      There is no feasable work around for this company.
      The java programs depend on the right java version being deployed. It would be an administrators nightmare to deploy the JVM locally on each of the thousands PCs. Webstart was too buggy. Granting the rights to list each parent folder is ruled out be the companies security policies.

        Attachments

          Activity

            People

            • Assignee:
              robm Robert Mckenna
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: