ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Atherton <>
Subject Re: and segafult
Date Thu, 13 Sep 2007 19:44:35 GMT
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 
  3) you might be able to write a signal handler for SIGSEGV to do the 
flush(), I'm not sure.

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 combined with
> 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:
For additional commands, e-mail:

View raw message