c++filt causing flashing console windows

Andrew Haley aph@redhat.com
Tue Sep 9 12:43:00 GMT 2003


Ranjit Mathew writes:
 > Andrew Haley wrote:
 > > Ranjit Mathew writes:

 > >  > "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

"The page you've requested is available only to registered members of
 Sun Developer Network."

:-)

 > 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.

Ah, right.

 > 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.

Fair enough.

 > 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)"

It says above that "the child process may nor may not create its own
console/tty."  Is it possible to build c++filt and addr2line in such a
way that they do not try to create their own console/tty if the parent
process doesn't have one?  Or is this an unfixable Windows bug?

Andrew.



More information about the Java mailing list