public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/1366: Process doesn't throw IOException
@ 2000-12-20 12:25 osk
0 siblings, 0 replies; only message in thread
From: osk @ 2000-12-20 12:25 UTC (permalink / raw)
To: java-gnats
>Number: 1366
>Category: libgcj
>Synopsis: Process doesn't throw IOException
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: tromey
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:19:19 PST 2000
>Closed-Date: Mon Oct 09 17:55:16 PDT 2000
>Last-Modified: Mon Oct 9 18:00:01 PDT 2000
>Originator: Oskar Liljeblad
>Release: unknown-1.0
>Organization:
>Environment:
egcs 2000-08-14
libgcj 2000-09-04
>Description:
java.lang.Process doesn't throw an IOException when it
fails to execute a program (for example when the
program can't be found).
Oskar Liljeblad (osk@hem.passagen.se)
>How-To-Repeat:
import java.io.*;
class Dummy {
public static void main(String[] args)
throws IOException {
String[] procArgs = { "very-much-non-existing-program" };
Process proc = Runtime.getRuntime().exec(procArgs);
BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
System.err.println("["+in.readLine()+"]");
}
}
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR java.lang/339
From: Bryce McKinlay <bryce@albatross.co.nz>
To: osk@hem.passagen.se
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/339: Process doesn't throw IOException
Date: Tue, 05 Sep 2000 22:54:24 +1200
osk@hem.passagen.se wrote:
> >Description:
> java.lang.Process doesn't throw an IOException when it
> fails to execute a program (for example when the
> program can't be found).
Yeah, known problem. See the comments in natPosixProcess.cc (but thanks for the PR)
regards
[ bryce ]
From: Tom Tromey <tromey@cygnus.com>
To: Bryce McKinlay <bryce@albatross.co.nz>
Cc: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com
Subject: Re: gcj/339: Process doesn't throw IOException
Date: 05 Sep 2000 11:02:07 -0600
Bryce> Yeah, known problem. See the comments in natPosixProcess.cc
Bryce> (but thanks for the PR)
One way that I've implemented this in the past is to make a status
pipe. If the exec fails, we write `errno' as a single byte to the
pipe from the child. We also mark the write end close-on-exec, so if
the exec succeeds the parent sees the pipe close without any data
being written.
Not sure why I didn't just implement it when I wrote the code.
Tom
Responsible-Changed-From-To: apbianco->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Tue Sep 5 14:02:36 2000
Responsible-Changed-Why:
This is mine.
State-Changed-From-To: open->analyzed
State-Changed-By: tromey
State-Changed-When: Tue Sep 5 14:02:36 2000
State-Changed-Why:
I'm working on it.
I have a patch but I don't want to check it in until
I can verify it (I'm having compiler problems right now)
From: tromey@cygnus.com
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com,
osk@hem.passagen.se, tromey@cygnus.com
Cc:
Subject: Re: java.lang/339
Date: 5 Sep 2000 21:02:36 -0000
Synopsis: Process doesn't throw IOException
Responsible-Changed-From-To: apbianco->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Tue Sep 5 14:02:36 2000
Responsible-Changed-Why:
This is mine.
State-Changed-From-To: open->analyzed
State-Changed-By: tromey
State-Changed-When: Tue Sep 5 14:02:36 2000
State-Changed-Why:
I'm working on it.
I have a patch but I don't want to check it in until
I can verify it (I'm having compiler problems right now)
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=339&database=java
From: tromey@sourceware.cygnus.com
To: java-gnats@sources.redhat.com
Cc:
Subject: java.lang/339
Date: 6 Sep 2000 18:14:16 -0000
CVSROOT: /cvs/java
Module name: libgcj
Changes by: tromey@sourceware.cygnus.com 2000-09-06 11:14:16
Modified files:
libjava : ChangeLog
libjava/java/lang: natPosixProcess.cc
Log message:
Fix for PR java.lang/339:
* java/lang/natPosixProcess.cc (fail): New function.
(cleanup): New function.
(startProcess): Use them. Create pipe so child can communicate
exec failure back to parent.
Patches:
http://gcc.gnu.org/cgi-bin/gcc/libjava/ChangeLog.diff?cvsroot=java&r1=1.482&r2=1.483
http://gcc.gnu.org/cgi-bin/gcc/libjava/java/lang/natPosixProcess.cc.diff?cvsroot=java&r1=1.6&r2=1.7
State-Changed-From-To: analyzed->feedback
State-Changed-By: tromey
State-Changed-When: Wed Sep 6 11:26:57 2000
State-Changed-Why:
I've checked in a fix for this. Please try it out and
get back to me.
Thanks.
From: tromey@cygnus.com
To: java-gnats@sourceware.cygnus.com, osk@hem.passagen.se, tromey@cygnus.com
Cc:
Subject: Re: java.lang/339
Date: 6 Sep 2000 18:26:57 -0000
Synopsis: Process doesn't throw IOException
State-Changed-From-To: analyzed->feedback
State-Changed-By: tromey
State-Changed-When: Wed Sep 6 11:26:57 2000
State-Changed-Why:
I've checked in a fix for this. Please try it out and
get back to me.
Thanks.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=339&database=java
State-Changed-From-To: feedback->closed
State-Changed-By: bryce
State-Changed-When: Mon Oct 9 17:55:16 2000
State-Changed-Why:
Tom's fix works fine.
From: bryce@albatross.co.nz
To: java-gnats@sourceware.cygnus.com, osk@hem.passagen.se, tromey@cygnus.com
Cc:
Subject: Re: java.lang/339
Date: 10 Oct 2000 00:55:16 -0000
Synopsis: Process doesn't throw IOException
State-Changed-From-To: feedback->closed
State-Changed-By: bryce
State-Changed-When: Mon Oct 9 17:55:16 2000
State-Changed-Why:
Tom's fix works fine.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=339&database=java
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-12-20 12:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:25 libgcj/1366: Process doesn't throw IOException osk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).