You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ivan Popov (JIRA)" <ji...@apache.org> on 2007/06/09 18:26:26 UTC
[jira] Created: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
[classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
-------------------------------------------------------------------------------------------------------------
Key: HARMONY-4119
URL: https://issues.apache.org/jira/browse/HARMONY-4119
Project: Harmony
Issue Type: Bug
Components: Classlib
Environment: Windows/x86, harmony-jdk-r545696
Reporter: Ivan Popov
Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
For BEA JRockit JDK this produces the following output:
------------------------------------------------------------------------------------
> %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
*** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
*** Process started
*** Streams obtained
*** Output streams redirected
*** Buffered input stream created
*** Sending input text: one
two
*** Input text sent
STDOUT: one
two
*** Close input buffered stream
*** Input buffered stream closed
STDOUT: EOF
STDOUT:
STDOUT: <close>
STDERR: <close>
------------------------------------------------------------------------------------
For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
------------------------------------------------------------------------------------
>%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
*** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
*** Process started
*** Streams obtained
*** Output streams redirected
*** Buffered input stream created
*** Sending input text: one
two
*** Input text sent
STDOUT: one
two
*** Close input buffered stream
*** Input buffered stream closed
STDOUT: one
two
STDOUT:
STDOUT:
STDOUT:
<....>
^C
------------------------------------------------------------------------------------
Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504864 ]
Mikhail Markov commented on HARMONY-4119:
-----------------------------------------
Thanks, Alexei! Applied as expected.
> [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
> -------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4119
> URL: https://issues.apache.org/jira/browse/HARMONY-4119
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows/x86, harmony-jdk-r545696
> Reporter: Ivan Popov
> Assignee: Alexei Zakharov
> Attachments: H-4119.patch, TerminateTest.zip
>
>
> Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
> Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
> For BEA JRockit JDK this produces the following output:
> ------------------------------------------------------------------------------------
> > %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: EOF
> STDOUT:
> STDOUT: <close>
> STDERR: <close>
> ------------------------------------------------------------------------------------
> For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
> ------------------------------------------------------------------------------------
> >%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: one
> two
> STDOUT:
> STDOUT:
> STDOUT:
> <....>
> ^C
> ------------------------------------------------------------------------------------
> Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
Posted by "Ivan Popov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ivan Popov updated HARMONY-4119:
--------------------------------
Attachment: TerminateTest.zip
> [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
> -------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4119
> URL: https://issues.apache.org/jira/browse/HARMONY-4119
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows/x86, harmony-jdk-r545696
> Reporter: Ivan Popov
> Attachments: TerminateTest.zip
>
>
> Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
> Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
> For BEA JRockit JDK this produces the following output:
> ------------------------------------------------------------------------------------
> > %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: EOF
> STDOUT:
> STDOUT: <close>
> STDERR: <close>
> ------------------------------------------------------------------------------------
> For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
> ------------------------------------------------------------------------------------
> >%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: one
> two
> STDOUT:
> STDOUT:
> STDOUT:
> <....>
> ^C
> ------------------------------------------------------------------------------------
> Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
Posted by "Ivan Popov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504637 ]
Ivan Popov commented on HARMONY-4119:
-------------------------------------
Thanks, Mikhail. I've checked your patch applied to r547139 and it solves this problem, as well as HARMONY-4066. I'd like to see it committed ASAP.
> [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
> -------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4119
> URL: https://issues.apache.org/jira/browse/HARMONY-4119
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows/x86, harmony-jdk-r545696
> Reporter: Ivan Popov
> Attachments: H-4119.patch, TerminateTest.zip
>
>
> Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
> Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
> For BEA JRockit JDK this produces the following output:
> ------------------------------------------------------------------------------------
> > %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: EOF
> STDOUT:
> STDOUT: <close>
> STDERR: <close>
> ------------------------------------------------------------------------------------
> For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
> ------------------------------------------------------------------------------------
> >%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: one
> two
> STDOUT:
> STDOUT:
> STDOUT:
> <....>
> ^C
> ------------------------------------------------------------------------------------
> Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mikhail Markov updated HARMONY-4119:
------------------------------------
Attachment: H-4119.patch
Here is the patch fixing the issue.
Fix description: while trying to fix HARMONY-3854, i've found that InputStreamReader has a major problem due to which prevent's it from working as designed (see my comments in 3854). I've tried to fix the existing algorithm, but failed to make all unit tests pass, so i've rewritten it (now all unit tests pass on my machine) - it was possible after new nio charsets integration as ICU has some bugs (see HARMONY-4117 - i'll close it as it's not reproducible with new charsets). Also I've found 1 problem in UTF-8 CharsetDecoder from these new charsets :-) and fix it in my patch.
> [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
> -------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4119
> URL: https://issues.apache.org/jira/browse/HARMONY-4119
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows/x86, harmony-jdk-r545696
> Reporter: Ivan Popov
> Attachments: H-4119.patch, TerminateTest.zip
>
>
> Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
> Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
> For BEA JRockit JDK this produces the following output:
> ------------------------------------------------------------------------------------
> > %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: EOF
> STDOUT:
> STDOUT: <close>
> STDERR: <close>
> ------------------------------------------------------------------------------------
> For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
> ------------------------------------------------------------------------------------
> >%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: one
> two
> STDOUT:
> STDOUT:
> STDOUT:
> <....>
> ^C
> ------------------------------------------------------------------------------------
> Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504858 ]
Alexei Zakharov commented on HARMONY-4119:
------------------------------------------
Thanks Mikhail and Ivan. Mikhail's patch was applied at the revision 547329. Please verify it was applied as expected.
> [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
> -------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4119
> URL: https://issues.apache.org/jira/browse/HARMONY-4119
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows/x86, harmony-jdk-r545696
> Reporter: Ivan Popov
> Assignee: Alexei Zakharov
> Attachments: H-4119.patch, TerminateTest.zip
>
>
> Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
> Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
> For BEA JRockit JDK this produces the following output:
> ------------------------------------------------------------------------------------
> > %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: EOF
> STDOUT:
> STDOUT: <close>
> STDERR: <close>
> ------------------------------------------------------------------------------------
> For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
> ------------------------------------------------------------------------------------
> >%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: one
> two
> STDOUT:
> STDOUT:
> STDOUT:
> <....>
> ^C
> ------------------------------------------------------------------------------------
> Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov resolved HARMONY-4119.
--------------------------------------
Resolution: Fixed
> [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
> -------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4119
> URL: https://issues.apache.org/jira/browse/HARMONY-4119
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows/x86, harmony-jdk-r545696
> Reporter: Ivan Popov
> Assignee: Alexei Zakharov
> Attachments: H-4119.patch, TerminateTest.zip
>
>
> Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
> Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
> For BEA JRockit JDK this produces the following output:
> ------------------------------------------------------------------------------------
> > %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: EOF
> STDOUT:
> STDOUT: <close>
> STDERR: <close>
> ------------------------------------------------------------------------------------
> For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
> ------------------------------------------------------------------------------------
> >%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: one
> two
> STDOUT:
> STDOUT:
> STDOUT:
> <....>
> ^C
> ------------------------------------------------------------------------------------
> Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov updated HARMONY-4119:
-------------------------------------
Patch Info: [Patch Available]
> [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
> -------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4119
> URL: https://issues.apache.org/jira/browse/HARMONY-4119
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows/x86, harmony-jdk-r545696
> Reporter: Ivan Popov
> Attachments: H-4119.patch, TerminateTest.zip
>
>
> Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
> Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
> For BEA JRockit JDK this produces the following output:
> ------------------------------------------------------------------------------------
> > %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: EOF
> STDOUT:
> STDOUT: <close>
> STDERR: <close>
> ------------------------------------------------------------------------------------
> For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
> ------------------------------------------------------------------------------------
> >%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: one
> two
> STDOUT:
> STDOUT:
> STDOUT:
> <....>
> ^C
> ------------------------------------------------------------------------------------
> Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov reassigned HARMONY-4119:
----------------------------------------
Assignee: Alexei Zakharov
> [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
> -------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4119
> URL: https://issues.apache.org/jira/browse/HARMONY-4119
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows/x86, harmony-jdk-r545696
> Reporter: Ivan Popov
> Assignee: Alexei Zakharov
> Attachments: H-4119.patch, TerminateTest.zip
>
>
> Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
> Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
> For BEA JRockit JDK this produces the following output:
> ------------------------------------------------------------------------------------
> > %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: EOF
> STDOUT:
> STDOUT: <close>
> STDERR: <close>
> ------------------------------------------------------------------------------------
> For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
> ------------------------------------------------------------------------------------
> >%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: one
> two
> STDOUT:
> STDOUT:
> STDOUT:
> <....>
> ^C
> ------------------------------------------------------------------------------------
> Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (HARMONY-4119) [classlib][luni] Reading from
InputStreamReader(System.in) does not finish after closing process input
stream
Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov closed HARMONY-4119.
------------------------------------
Was verified by Mikhail.
> [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
> -------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4119
> URL: https://issues.apache.org/jira/browse/HARMONY-4119
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows/x86, harmony-jdk-r545696
> Reporter: Ivan Popov
> Assignee: Alexei Zakharov
> Attachments: H-4119.patch, TerminateTest.zip
>
>
> Reading from InputStreamReader(System.in) in a child process does not finish after process input stream is closed.
> Attached test TerminateTest launches ConsoleInput class in a child JVM process, sends string "one\ntwo\n" to its input stream, closes input stream and redirects output. ConsoleInput class just echoes data from input stream until it is closed.
> For BEA JRockit JDK this produces the following output:
> ------------------------------------------------------------------------------------
> > %BEA_JDK%\bin\java.exe -cp . TerminateTest %BEA_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\jrockit-jdk1.5.0_06-windows-ia32\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: EOF
> STDOUT:
> STDOUT: <close>
> STDERR: <close>
> ------------------------------------------------------------------------------------
> For Harmony JDK with DRLVM child JVM echoes a lot of empty strings after process input stream is closed:
> ------------------------------------------------------------------------------------
> >%HY_JDK%\bin\java.exe -cp . TerminateTest %HY_JDK%\jre\bin\java.exe -cp . ConsoleInput
> *** Starting process: ...\hdk\jdk\jre\bin\java.exe -cp . ConsoleInput
> *** Process started
> *** Streams obtained
> *** Output streams redirected
> *** Buffered input stream created
> *** Sending input text: one
> two
> *** Input text sent
> STDOUT: one
> two
> *** Close input buffered stream
> *** Input buffered stream closed
> STDOUT: one
> two
> STDOUT:
> STDOUT:
> STDOUT:
> <....>
> ^C
> ------------------------------------------------------------------------------------
> Child DRLVM process may remain alive and eat CPU after killing parent JVM process with ^C, especially if parent is started with JRockit JVM.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.