This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Provide as much diagnostic information as possible in "panic: ..." messages.
authorNicholas Clark <nick@ccl4.org>
Mon, 16 Jan 2012 16:08:38 +0000 (17:08 +0100)
committerNicholas Clark <nick@ccl4.org>
Mon, 16 Jan 2012 22:04:12 +0000 (23:04 +0100)
commit5637ef5b34a3e8caf72080387a15ea8d81b61baf
treef96feca3a69260136149ab5dcd6aef6d87ad3be2
parent91a6d79299c498b1b5148f435b9ca88053476607
Provide as much diagnostic information as possible in "panic: ..." messages.

The convention is that when the interpreter dies with an internal error, the
message starts "panic: ". Historically, many panic messages had been terse
fixed strings, which means that the out-of-range values that triggered the
panic are lost. Now we try to report these values, as such panics may not be
repeatable, and the original error message may be the only diagnostic we get
when we try to find the cause.

We can't report diagnostics when the panic message is generated by something
other than croak(), as we don't have *printf-style format strings. Don't
attempt to report values in panics related to *printf buffer overflows, as
attempting to format the values to strings may repeat or compound the
original error.
18 files changed:
cop.h
doio.c
op.c
pad.c
perl.c
pod/perldiag.pod
pp.c
pp_ctl.c
pp_hot.c
pp_pack.c
pp_sys.c
regcomp.c
regexec.c
scope.c
sv.c
toke.c
utf8.c
util.c