[Israel.pm] catching segmentation faults and other crashes
migo at homemail.com
Mon Nov 12 03:27:05 PST 2007
On 12 Nov 2007 13:15:11 +0200, Yona Shlomo wrote:
> On Mon, 12 Nov 2007, Mikhael Goikhman wrote:
> > Accouding to "perldoc -f system", positive $? after system() or qx()
> > includes the system signal which the invoked command died with (something
> > you probably are not interested in) plus 128 on segmentation fault
> > (something you are interested in).
> $? didn't do the trick for me for some reason.
> I'll probe further and try to figure out why.
Are you sure the program actually dumps core? With "limit coredumpsize 0"
in a shell (versus "limit coredumpsize unlimited"), there is no core dump
and the 7-th bit of $? is always zero (the "&& 128" check), as expected.
But even then, $? is not 0, also as expected. On all unix systems I have.
perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'
More information about the Perl