ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: org.apache.tools.ant.taskdefs.Execute and segafult
Date Thu, 13 Sep 2007 20:12:34 GMT
On 9/13/07, Bruce Atherton <bruce@callenish.com> wrote:
> It is entirely possible that the output never reaches Ant. The standard
> C library is typically set up to buffer data on the standard file
> handles, for efficiency purposes.
>
> To get around this, you could:
>
>   1) do a flush() on the stdout and stderr streams before the
> segmentation fault (assuming you know where it is).
>   2) replace the standard file handles with ones that do not buffer
> anything.
>   3) you might be able to write a signal handler for SIGSEGV to do the
> flush(), I'm not sure.
Or run it within a shell.
- easy on unix using ant-contrib's shellscript
<ac:shellscript shell="bash">
   c_program
</ac:shellscript>


>
> If this is a C program that you can't alter the code for, then the only
> place you might be able to find what was output is somewhere inside the
> core dump, which isn't terribly practical.
>
> As for detecting the segmentation fault, you could always look for the
> core dump file, assuming the system generates one.
>
> venki wrote:
> > Hi,
> > I am using org.apache.tools.ant.taskdefs.Execute combined with
> > org.apache.tools.ant.taskdefs.PumpStreamHandler to execute an external C
> > program. When the external C program segfaults, I am not able to to see any
> > output that came from the external C program before it segfaults. Also, I am
> > not able to see the 'segmentation fault' message in the stream output. Any
> > help to solve this would be useful.
> >
> > Thanks.
> >
> > Venki
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message