Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 92841 invoked from network); 27 Nov 2008 06:56:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Nov 2008 06:56:27 -0000 Received: (qmail 3012 invoked by uid 500); 27 Nov 2008 06:56:38 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 2996 invoked by uid 500); 27 Nov 2008 06:56:38 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 2987 invoked by uid 99); 27 Nov 2008 06:56:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Nov 2008 22:56:38 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Nov 2008 06:55:20 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id CC9EC234C2A5; Wed, 26 Nov 2008 22:55:36 -0800 (PST) From: bugzilla@apache.org To: notifications@ant.apache.org Subject: DO NOT REPLY [Bug 46305] New: Hung forked JVM when reading from standard input X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: newchanged X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ant X-Bugzilla-Component: Core tasks X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slackiz@fansbola.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: notifications@ant.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 26 Nov 2008 22:55:36 -0800 (PST) X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=46305 Summary: Hung forked JVM when reading from standard input Product: Ant Version: 1.7.1 Platform: PC OS/Version: Windows XP Status: NEW Severity: normal Priority: P2 Component: Core tasks AssignedTo: notifications@ant.apache.org ReportedBy: slackiz@fansbola.com Hi, When launching a Java program from ant with "fork=true", the launched program seems to have *no* problem reading from the standard input (e.g. via System.in.read()), however this seems to stuff up the thread management of the launched program (i.e. the forked/child JVM) and possibly also crashes the child JVM. To reproduce this on a Windows XP (with Service Pack 3) using Sun JDK 6 update 10, I wrote a class with a main method that simply contains: try { System.out.println("X[Return] to quit"); while (System.in.read() != 'X') ; System.exit(0); // see shutdown hook for subsequent shutdown operations } catch (IOException e) { e.printStackTrace(); } When the program runs and blocks/waits for input from the user, if attached via JMX using JVisualVM (a tool that comes with Sun JDK 6 installation, for viewing the memory and thread state of a VM), JVisualVM will freeze and could not return any info about the JVM. The main thread of the JVM itself still works since System.in.read() still responds to user input, but the other threads of the program's JVM seem to have died and therefore the program/JVM cannot be connected via RMI, remote debugging, using -QUIT signal to get JVM thread dump, etc. The above is just a straightforward way to demostrate the problem, but in practice, without using JMX, the problem can also be reproduced using certain combinations of operations involving "complex" thread management, such as AWT event handling, RMI connection, etc. As such, it looks like that the problem is caused by a combination of the following factors: 1. Launching a program from ant using "fork=true" 2. The program blocks to receive input from user, e.g. System.in.read() 3. The program performs "complex" threading operation, such as exporting RMI remote objects, displaying a java.awt.Frame, connecting to the VM via JMX etc. The JVM hang problem is noticeable/reproducable: - On Windows XP (Service Pack 3, not sure about other service packs), but *no* problem on Linux and Windows Vista. - Using Sun JDK 1.4.2_14, 1.5.0_12, 1.6.0_10, and IBM J9 2.3 - Ant 1.7.0 and 1.7.1 I have no idea what could cause this problem, but I suspect that I/O redirection is not properly implemented in Windows XP, and thus crashing the JVM (e.g. interfering with the JVM's thread management). Thanks, Hendrik -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.