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

Runtime exec hangs if ulimit nofiles is unlimited.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0_03
    • 1.4a, 1.3.0, 1.4.0
    • core-libs
    • 03
    • sparc
    • solaris_7, solaris_9
    • Verified

        Name: boT120536 Date: 02/08/2001


        java version "1.3.0"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
        Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)


          To reproduce this problem, as root, do:

        # ulimit -n unlimited
        # java foo

        Where foo.class is from:
        public class foo
        {
            public static void main(String argv[] ) throws IOException,
        InterruptedException {
                String command = new String ("/bin/touch /tmp/junkexec");
                // then write the data of the response

                Process process = Runtime.getRuntime().exec(command);
                System.out.println ("The process returned " + process.waitFor());
            }
        }
         

        This is actually a modification of bug id 4043528 which I know has
        been closed. However, if the system limit is unlimited, Runtime
        exec will loop effectively forever. I think it's a sign problem
        in a max close routine, as it never gets out of trying to close
        file descriptors.

        Now, perhaps a way to fix this problem for solaris is to open
        /proc/XXXX/fd and try to close only the ones that are open.
        This way, it will be independent of the max_filedescriptor value.
        (Review ID: 114796)
        ======================================================================
        ###@###.### 10/5/04 22:28 GMT

              minqi Yumin Qi
              bonealsunw Bret O'neal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: