[Israel.pm] catching segmentation faults and other crashes
Yona Shlomo
yona at cs.technion.ac.il
Mon Nov 12 12:54:56 EET 2007
On Mon, 12 Nov 2007, Mikhael Goikhman wrote:
> On 12 Nov 2007 09:51:04 +0200, Yona Shlomo wrote:
>>
>> Can you recommend a way to catch the crash of the tool,
>> despite the fact that it still emits some (possibly good)
>> output?
>
> Run these commands, one with and one without internal segfault:
>
> perl -e 'print qx(perl -e "\$| = 1; print qq(output\n); 1 && dump()"); print "Core dumped\n" if $? & 128'
>
> perl -e 'print qx(perl -e "\$| = 1; print qq(output\n); 0 && dump()"); print "Core dumped\n" if $? & 128'
>
> You should remember to remove core files if any (named like core or
> perl.core or core.12345, depending on the OS).
>
> Regards,
> Mikhael.
>
>
I must admit that I don't understand what you're trying to
do.
--
Shlomo Yona
yona at cs.technion.ac.il
http://yeda.cs.technion.ac.il/~yona/
More information about the Perl
mailing list