Thanks. I will also try with ant-contrib's shellscript task.

Peter Reilly-2 wrote:
> 
> On 9/13/07, Bruce Atherton <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/org.apache.tools.ant.taskdefs.Execute-and-segafult-tf4431366.html#a12663410
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to