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

(process) appA hangs when read output stream of appB which starts appC that runs forever

XMLWordPrintable

    • b105
    • x86
    • windows_7
    • Verified

        FULL PRODUCT VERSION :
        Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7601]

        A DESCRIPTION OF THE PROBLEM :
        There are three Java applications, processB just starts processC which would run forever. main program starts processB and read its output. But if I use InputStream.read, it hangs at FileInputStream.readBytes.
        private native int readBytes(byte b[], int off, int len) throws IOException;

        If I use BufferedReader.readLine, it hangs at BufferedReader.read(),
        public int read(char cbuf[], int offset, int length) throws IOException
        Which calls StreamDecoder.read(char[], int, int) ===> hangs here.

        I have tested this in JDK7, JDK6 and JDK1.5.
        The code is as below - you will find that the main program never exits.

        (EDITED BY uta: the code is in attachment)

        REGRESSION. Last worked in version 6u29

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The main program will not hang.

        REPRODUCIBILITY :
        This bug can be reproduced always.

              uta Alexey Utkin (Inactive)
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: