Bisect points at:
commit b7b8b099a2106c45a577e9cd7b9f1653736cf89a
Author: David Mitchell <davem@iabyn.com>
Date: Fri Dec 13 13:48:25 2019 +0000
avoid identical stack traces
GH #15109
The output of caller() (e.g. as produced by carp::Confess) produces
multiple identical outputs when within a nested use/require. This is
because at the time of calling the 'BEGIN { require ... }', PL_curcop is
set to &PL_compiling, which is a fixed buffer within the interpreter,
whose individual file and line fields are saved and restored when doing
a new require/eval. This means that within the innermost require,
PL_compiling has file:lineno of the innermost source file, and multiple
saved PL_curcop values in the context stack frames all point to the same
&PL_copmpiling. So all levels of the stack trace appear to come from the
innermost file.
This commit fixes this (after a fashion) by, at the start of calling a
BEGIN, making PL_curcop point to a temporary copy of PL_compiling
instead.
This is all a bit of a hack.
(cherry picked from commit f2f32cd638746f538da6db804dab6dd54e654f30)