Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 78521 invoked from network); 14 Jun 2007 08:09:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jun 2007 08:09:51 -0000 Received: (qmail 618 invoked by uid 500); 14 Jun 2007 08:09:52 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 602 invoked by uid 500); 14 Jun 2007 08:09:52 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 584 invoked by uid 99); 14 Jun 2007 08:09:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2007 01:09:52 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2007 01:09:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3987C714168 for ; Thu, 14 Jun 2007 01:09:26 -0700 (PDT) Message-ID: <32787943.1181808566232.JavaMail.jira@brutus> Date: Thu, 14 Jun 2007 01:09:26 -0700 (PDT) From: "Mikhail Markov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-4119) [classlib][luni] Reading from InputStreamReader(System.in) does not finish after closing process input stream In-Reply-To: <27684624.1181406386085.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on 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: > STDERR: > ------------------------------------------------------------------------------------ > 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.