ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5003] New: - exec task does not return after executed command finished on Windows only
Date Wed, 21 Nov 2001 16:22:33 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5003>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5003

exec task does not return after executed command finished on Windows only

           Summary: exec task does not return after executed command
                    finished on Windows only
           Product: Ant
           Version: 1.4.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: adam.sotona@sun.com


Exec command stays waiting for output and error streams to be closed even when 
executed command already finished.

This bug prevents Ant from execution of processes, that are not closing out and 
err stream correctly on Windows.

Small example is java class only executing its argument:
    public static void main (String args[]) throws Exception {
        Runtime.getRuntime().exec(args[0]);
        System.out.println("finished");
    }

and build.xml containing something like this:
        <exec executable="java" >
            <arg line=" -cp . test rmid"/>
        </exec>

This task starts rmid using test class, writes "finished" and stays hanged on 
Windows.
The same code on Linux(Solaris) starts rmid, writes "finshed" and realy 
finishes.

Main problem is waiting for error and output stream to be closed in 
org.apache.tools.ant.taskdefs.PumpStreamHandler method stop() code             
inputThread.join(); and errorThread.join();

Output with Full thread dump of blocked exec task is:
Buildfile: build.xml

test:
     [exec] finished
Full thread dump:

"Thread-1" daemon prio=5 tid=0x8b8ad48 nid=0x604 runnable [0x8f2f000..0x8f2fdbc]
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:166)
        at org.apache.tools.ant.taskdefs.StreamPumper.run(StreamPumper.java:99)
        at java.lang.Thread.run(Thread.java:484)

"Thread-0" daemon prio=5 tid=0x8b3da98 nid=0x57c runnable [0x8eef000..0x8eefdbc]
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:183)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:186)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:225)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:280)
        at java.io.FilterInputStream.read(FilterInputStream.java:93)
        at org.apache.tools.ant.taskdefs.StreamPumper.run(StreamPumper.java:99)
        at java.lang.Thread.run(Thread.java:484)

"Signal Dispatcher" daemon prio=10 tid=0x960620 nid=0x670 waiting on monitor 
[0..0]

"Finalizer" daemon prio=9 tid=0x95c880 nid=0x4e8 waiting on monitor 
[0x8daf000..0x8dafdbc]
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162)

"Reference Handler" daemon prio=10 tid=0x8af0368 nid=0x4fc waiting on monitor 
[0x8d6f000..0x8d6fdbc]
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:420)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110)

"main" prio=5 tid=0x284950 nid=0x60c waiting on monitor [0x6f000..0x6fc34]
        at java.lang.Object.wait(Native Method)
        at java.lang.Thread.join(Thread.java:930)
        at java.lang.Thread.join(Thread.java:983)
        at org.apache.tools.ant.taskdefs.PumpStreamHandler.stop
(PumpStreamHandler.java:111)
        at org.apache.tools.ant.taskdefs.LogStreamHandler.stop
(LogStreamHandler.java:85)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:397)
        at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:250)
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:279)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:177)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        at org.apache.tools.ant.Target.execute(Target.java:184)
        at org.apache.tools.ant.Target.performTasks(Target.java:202)
        at org.apache.tools.ant.Project.executeTarget(Project.java:601)
        at org.apache.tools.ant.Project.executeTargets(Project.java:560)
        at org.apache.tools.ant.Main.runBuild(Main.java:454)
        at org.apache.tools.ant.Main.start(Main.java:153)
        at org.apache.tools.ant.Main.main(Main.java:176)

"VM Thread" prio=5 tid=0x8b5e1c0 nid=0x3c8 runnable

"VM Periodic Task Thread" prio=10 tid=0x95f320 nid=0x558 waiting on monitor
"Suspend Checker Thread" prio=10 tid=0x95fc70 nid=0x608 runnable

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message