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

(process) Runtime.exec unnecessarily inherits open files (win)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • core-libs
    • x86
    • windows_2000

      Name: js151677 Date: 06/30/2004


      A DESCRIPTION OF THE REQUEST :
      Process launched from Runtime.exec() unnecessarily inherits open files in Windows 2000 with java 1.4.2.

      Look at bug entries:
      4153564 , 4200502 , 4228651 , 4744948



      JUSTIFICATION :
      Process launched from Runtime.exec() unnecessarily inherits open files in Windows 2000.

      This is especially nasty feature with sockets. I'm currenlty trying to achieve following:
       - Java application receives a SOAP request with HTTP 1.0
       - Java application passes the request to JCA adapter, which starts a native program with Runtime.exec(..). (Only when needed)
       - Java application receives the response from native program
       - Java application sends the response to SOAP client and closes the socket. But because the native program
         is still around and has inherited the socket - the socket is still open and the SOAP client does not get
         the socket close event - and doesn't receive the data.

      Look at entries:
      4153564 , 4200502 , 4228651 , 4744948

      In these cases the bug was closed with explanation:

      "It appears that we've called CreateProcess with a value
      of "TRUE" for inheritance of system handles since at least jdk1.1.8."

      I'd like to say: You have has a bug since jdk1.1.8 - and got it reported - and done nothing.

      I don't believe anyone is counting on inherited sockets/files. And if I've understood correctly, the open sockets
      are not inherited in Unix. Shouldn't these work in a same way in both cases? I think the correct way should be to start the process with createProcess but set the file descriptor inheritance flag off.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      By default don't inherit sockets. If this is needed then add this as an option to new ProcessBuilder class in java 1.5.
      (Incident Review ID: 281895)
      ======================================================================

            uta Alexey Utkin (Inactive)
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: