harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Markov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-4119) [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream
Date Thu, 14 Jun 2007 08:09:26 GMT

     [ 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.


Mime
View raw message