c++filt causing flashing console windows
Ranjit Mathew
rmathew@hotmail.com
Tue Sep 9 12:27:00 GMT 2003
Andrew Haley wrote:
> Ranjit Mathew writes:
> > Andrew Haley wrote:
> > > > If a GUI application spawns a console application, Windows will
> > > > launch the application with an attached console (a Command Prompt
> > > > window).
> > >
> > > But that makes no sense in the context of Runtime.exec(), which
> > > creates an instance of Process. The Java spec says:
> > >
> > > "The created subprocess does not have its own terminal or console."
> > >
> > > How much clearer can it be?
> >
> > Ummm... it's not *that* clear you know. The line just before the
> > line you quote (from the JavaDoc for java.lang.Process in JDK
> > 1.4.1) reads "The Runtime.exec methods may not work well for
> > special processes on certain native platforms, such as *native
> > windowing processes*, daemon processes, Win16/DOS processes on
> > Microsoft Windows, or shell scripts" (emphasis mine).
>> I don't see how that makes any difference. c++filt and addr2line
> should not be not *native windowing processes*, daemon processes,
> Win16/DOS processes on Microsoft Windows, or shell scripts.
I was interpreting it to mean that it may not work
correctly when a GUI application spawns it. But now I
realise that they meant it the other way round.
In any case, even in the JDK, this problem has only
recently been "fixed" - I say "fixed" since they
do not seem to be that clear about it themselves. ;-)
http://developer.java.sun.com/developer/bugParade/bugs/4244515.html
I wrote a simple Java program (attached) that shows
that this problem exists in at least JDK 1.3.1-b24
and is fixed in at least JDK 1.4.1_01.
Interestingly, a related bug:
http://developer.java.sun.com/developer/bugParade/bugs/4321955.html
has this nugget from a Java JDK developer on the
line from java.lang.Process's JavaDoc that Andrew
had quoted:
"This document, which I wrote it, is misleading. What I really
meant was the child process inherits the console/tty of parent
process. If the parent process does not have a console/tty,
the child process may nor may not create its own console/tty.
There is no way to fix this problem, because this is the
intrinsic behavior of win32. If you use Windows Explorer or
File Manager and double click on any console application,
you will see the console window pop up. It is the same as
javaw. Both javaw and explorer are window application which
does not have a console. When they create child processes,
the child process will allocate their own console. If
the child process want to allocate a console, there is
really nothing we can do with it. (Console is allocated
by win32 loader)"
Ranjit.
--
Ranjit Mathew Email: rmathew AT hotmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Hello.java
URL: <http://gcc.gnu.org/pipermail/java/attachments/20030909/7a6109e4/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hello.c
URL: <http://gcc.gnu.org/pipermail/java/attachments/20030909/7a6109e4/attachment.c>
More information about the Java
mailing list