K
Keith Thompson
Eric Sosman said:That's not very specific, is it?
I posed the question because a core dump is usually
the best and most desirable outcome in a case like this.
Consider: There's not much corrective action you can
safely take, because there's no reason to believe the
bad pointer you've detected is the first bad pointer
the program has used. It may well have scribbled all
over memory before you had a chance to notice, and it
would be perilous to proceed on the basis of information
already known to be suspect. All you know is that the
program has gone off the rails, and badly -- a hard stop
will at least prevent the amok program from doing further
damage to disk files and the like, and a hard stop with
a core dump to facilitate post-mortem analysis is usually
welcome.
Agreed. In fact, the best corrective action you can take is to fix
the bug that caused the bad pointer in the first place. A core dump
is specifically intended to help you do that.