From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25879 invoked by alias); 24 Mar 2004 06:33:00 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 25864 invoked by uid 48); 24 Mar 2004 06:32:59 -0000 Date: Wed, 24 Mar 2004 06:33:00 -0000 From: "debian-gcc at lists dot debian dot org" To: java-prs@gcc.gnu.org Message-ID: <20040324063256.14709.debian-gcc@lists.debian.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/14709] New: gcj fails to wait for its child processes on exec() X-Bugzilla-Reason: CC X-SW-Source: 2004-q1/txt/msg00021.txt.bz2 List-Id: [forwarded from http://bugs.debian.org/238432] When calling Runtime.getRuntime.exec(String) in program that has been compiled with gcj-3.3.3, process is created and works as expected, but process is not reaped. With Sun JVM 1.5.0-beta the same programs work fine. We tested this also with gcc-3.4 CVS 20040314-1, with same results. Steps to reproduce: 1) Write a program that calls Runtime.getRuntime.exec("uptime"), opens and closes both input and output stream and calls destroy() to process (or use the one I attach when this report hits the web) and that continues to run. 2) See process listing: the processes created by exec() show there as . import java.io.*; /** * This program demonstrates bug in gcj Runtime.exec(). * * @author Jari Juslin, zds@iki.fi * * @version $Revision$ */ public class GcjExecBugDemo { /* **************************************************************** */ void run() { Process uptimeProcess; Reader stdoutReader; while (true) { try { uptimeProcess = Runtime.getRuntime().exec("uptime"); // Just to make sure that bug is not in not opening // input to process. uptimeProcess.getOutputStream().close(); stdoutReader = new InputStreamReader(uptimeProcess.getInputStream()); while (stdoutReader.read() != -1) ; stdoutReader.close(); uptimeProcess.destroy(); try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } catch (IOException e) { System.out.println("IOException: " + e.getMessage()); try { Thread.sleep(2000); } catch (InterruptedException ex) { ex.printStackTrace(); } } } } /* **************************************************************** */ public static void main(String[] args) { GcjExecBugDemo gcjExecBugDemo; gcjExecBugDemo = new GcjExecBugDemo(); gcjExecBugDemo.run(); } } -- Summary: gcj fails to wait for its child processes on exec() Product: gcc Version: 3.3.4 Status: UNCONFIRMED Severity: normal Priority: P2 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: debian-gcc at lists dot debian dot org CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14709