groovy

Antbuilder/Groovy ant task that uses forking java task causes StackOverflow in ANT script

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.5.5, 1.6-beta-1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    1

Description

While developing an ANT build.xml script to test some aspects of grails, we need a <groovy> task that invokes an ANT macro which uses a forked <java> task.

This consistently causes a stack overflow in ANT, apparently in the thread that ANT uses to monitor the output of the forked task.

Trace:
[java] Exception in thread "Thread-26" java.lang.StackOverflowError
[java] at org.apache.tools.ant.Project.getThreadTask(Project.java:2300)
[java] at org.apache.tools.ant.Project.demuxInput(Project.java:1244)
[java] at org.apache.tools.ant.DemuxInputStream.read(DemuxInputStream.java:70)
[java] at java.io.FilterInputStream.read(FilterInputStream.java:111)
[java] at org.apache.tools.ant.taskdefs.Redirector.handleInput(Redirector.java:666)
[java] at org.apache.tools.ant.taskdefs.Java.handleInput(Java.java:667)
[java] at org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:229)
[java] at org.apache.tools.ant.Project.demuxInput(Project.java:1248)
[java] at org.apache.tools.ant.DemuxInputStream.read(DemuxInputStream.java:70)
[java] at java.io.FilterInputStream.read(FilterInputStream.java:111)
[java] at org.apache.tools.ant.taskdefs.Redirector.handleInput(Redirector.java:666)
[java] at org.apache.tools.ant.taskdefs.Java.handleInput(Java.java:667)
[java] at org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:229)
[java] at org.apache.tools.ant.Project.demuxInput(Project.java:1248)
[java] at org.apache.tools.ant.DemuxInputStream.read(DemuxInputStream.java:70)
[java] at java.io.FilterInputStream.read(FilterInputStream.java:111)
[java] at org.apache.tools.ant.taskdefs.Redirector.handleInput(Redirector.java:666)
[java] at org.apache.tools.ant.taskdefs.Java.handleInput(Java.java:667)
[java] at org.apache.tools.ant.UnknownElement.handleInput(UnknownElement.java:229)

Script that suffers the problem is attached - its the functional-test target's use of <groovy> to call the "grails" macrodef that is the problem when the macrodef uses fork="true" on the <java> task. If fork=false there is no stack overflow.

Issue Links

Activity

Hide
Paul King added a comment -

My suspicion is that the changes corresponding to GROOVY-2424 didn't get merged - awaiting for feedback from Jochen.

Show
Paul King added a comment - My suspicion is that the changes corresponding to GROOVY-2424 didn't get merged - awaiting for feedback from Jochen.
Hide
Paul King added a comment -

OK, adding this patch into the code from the branch (locally) seems to help. I also moved the jars from --classpath to the ant classpath and the script seems to be almost running. It is now complaining that the webtest plugin is corrupt but I guess that is some other issue.

Show
Paul King added a comment - OK, adding this patch into the code from the branch (locally) seems to help. I also moved the jars from --classpath to the ant classpath and the script seems to be almost running. It is now complaining that the webtest plugin is corrupt but I guess that is some other issue.
Hide
Paul King added a comment -

When you get a chance, please merge changeset 10326 onto the 1.5.x branch or assign to me if you would like me to do this (I am not sure when you next plan to do some merging - there are several changes to HEAD which are candidates).

Show
Paul King added a comment - When you get a chance, please merge changeset 10326 onto the 1.5.x branch or assign to me if you would like me to do this (I am not sure when you next plan to do some merging - there are several changes to HEAD which are candidates).
Hide
Paul King added a comment -

Merged to 1_5_x branch

Show
Paul King added a comment - Merged to 1_5_x branch

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: