Bug 37887 - exec task hangs when starting background processes
Summary: exec task hangs when starting background processes
Status: RESOLVED DUPLICATE of bug 34461
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.5
Hardware: HP other
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-13 16:05 UTC by Uwe Voellger
Modified: 2008-08-20 08:04 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Voellger 2005-12-13 16:05:05 UTC
On HP-UX, the exec task hangs when used to start processes that starts 
background processes.

In our environment, we use Ant to start a shell script, which starts the 
weblogic server. The exec command is completely finished, but does not return 
so following tasks are not executed. STDOUT and STDERR are forwarded to files. 
The same problem occurs when starting other background processes.

Everything works fine on Solaris, Linux and Windows.

Here is an example of our exec task:
        <exec executable="/usr/bin/sh"
              dir="/export/weblogic/weblogic8.1.4/user_projects/domains/ES2"
              failonerror="true">
            <arg value="-c"/>
            <arg 
value="/export/weblogic/weblogic8.1.4/user_projects/domains/ES2/startWebLogic.sh
 1&gt;/expot/autotest/start2.log 2&gt;&amp;1 &amp;"/>
        </exec>

If spawn is used, everything works fine, but that is not what I need since 
controlling of the shell script execution is missing:
        <exec executable="/usr/bin/sh"
              dir="/export/weblogic/weblogic8.1.4/user_projects/domains/ES2"
              spawn="true">
            <arg value="-c"/>
            <arg 
value="/export/weblogic/weblogic8.1.4/user_projects/domains/ES2/startWebLogic.sh
 1&gt;/expot/autotest/start2.log 2&gt;&amp;1 &amp;"/>
        </exec>

Here is an stack trace:
Full thread dump  [Tue Dec 13 15:06:57 MET 2005] (Java HotSpot(TM) Server VM 
1.4.2 1.4.2.09-050713-05:46-PA_RISC2.0 PA2.0 (aCC_AP) mixed mode):

"Thread-3" daemon prio=10 tid=00051008 nid=17 lwp_id=212267 runnable 
[0x53ef7000..0x53ef74f0]
	at java.io.FileInputStream.readBytes(Native Method)
	at java.io.FileInputStream.read(FileInputStream.java:177)
	at java.lang.UNIXProcess$DeferredCloseInputStream.read
(UNIXProcess.java:243)
	at org.apache.tools.ant.taskdefs.StreamPumper.run(StreamPumper.java:90)
	at java.lang.Thread.run(Thread.java:534)

"Thread-0" daemon prio=10 tid=00050bd0 nid=14 lwp_id=212255 runnable 
[0x5407a000..0x5407a4f0]
	at java.io.FileInputStream.readBytes(Native Method)
	at java.io.FileInputStream.read(FileInputStream.java:177)
	at java.lang.UNIXProcess$DeferredCloseInputStream.read
(UNIXProcess.java:243)
	at org.apache.tools.ant.taskdefs.StreamPumper.run(StreamPumper.java:90)
	at java.lang.Thread.run(Thread.java:534)

"Signal Dispatcher" daemon prio=10 tid=00050798 nid=7 lwp_id=212247 waiting on 
condition [0x00000000..0xffffffff]

"Finalizer" daemon prio=10 tid=00050630 nid=5 lwp_id=212245 in Object.wait() 
[0x6defe000..0x6defe4f0]
	at java.lang.Object.wait(Native Method)
	- waiting on <6e5801d0> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
	- locked <6e5801d0> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:188)

"Reference Handler" daemon prio=10 tid=000504c8 nid=4 lwp_id=212244 in 
Object.wait() [0x6df7f000..0x6df7f4f0]
	at java.lang.Object.wait(Native Method)
	- waiting on <6e580238> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:429)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:120)
	- locked <6e580238> (a java.lang.ref.Reference$Lock)

"main" prio=10 tid=00050360 nid=1 lwp_id=212237 in Object.wait() 
[0x7f7f1000..0x7f7f1770]
	at java.lang.Object.wait(Native Method)
	- waiting on <6e280580> (a java.lang.Thread)
	at java.lang.Thread.join(Thread.java:1001)
	- locked <6e280580> (a java.lang.Thread)
	at java.lang.Thread.join(Thread.java:1054)
	at org.apache.tools.ant.taskdefs.PumpStreamHandler.stop
(PumpStreamHandler.java:137)
	at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:476)
	at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:576)
	at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:617)
	at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:452)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:341)
	at org.apache.tools.ant.Target.performTasks(Target.java:369)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExecutor.java:40)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
	at org.apache.tools.ant.Main.runBuild(Main.java:668)
	at org.apache.tools.ant.Main.startAnt(Main.java:187)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

"VM Thread" prio=10 tid=0001f6e8 nid=3 lwp_id=212243 runnable 

"VM Periodic Task Thread" prio=8 tid=00017f60 nid=11 lwp_id=212251 waiting on 
condition 
"Suspend Checker Thread" prio=10 tid=0001f770 nid=6 lwp_id=212246 runnable
Comment 1 Stefan Bodewig 2008-08-20 08:04:39 UTC
the "duplicate" resolution is my best guess.  Try inputstring="".



*** This bug has been marked as a duplicate of bug 34461 ***