Well, the newer debugger still coredumps on 5.001n, but at least now
it goes "almost there". If you remember, yesterday I got hit by pad_sv
panic (it may be related to NETaa14683, but happens in a short file).
Today I ran it in gdb, and after a lot of experiments found an error
in my script: It happens that not only ENDs, but also BEGINs may also
mask the error report.
For curious, try to run
eval 'sub x {$a();&b[]} BEGIN {OK}'; die $@
from a command line, or from a required file. Below is the tentative
patch for the problem. It fixes the situation when called from the
command line, but prints the message twice when run from a required
file. It happens like this: do_eval calls DIE with $@ as argument, die
calls die_where which appends $@ to the argument of DIE.
I'm not very fluent in Perl error processing, so did not try to fix
duplicate message. From my point of view one should never do $@="" if
in_eval is true, but I did not try to fix this too.
Note that this patch does not fix
panic pad_sv po
it just makes it possible to see the previous error.
Best,
Ilya
*** perl.c~ Tue Nov 07 03:28:58 1995
--- perl.c Wed Nov 08 22:39:02 1995
***************
*** 1743,1752 ****
switch (setjmp(top_env)) {
case 0: {
SV* atsv = GvSV(errgv);
PUSHMARK(stack_sp);
! perl_call_sv((SV*)cv, G_EVAL|G_DISCARD);
(void)SvPV(atsv, len);
! if (len) {
Copy(oldtop, top_env, 1, jmp_buf);
curcop = &compiling;
curcop->cop_line = oldline;
--- 1743,1754 ----
switch (setjmp(top_env)) {
case 0: {
SV* atsv = GvSV(errgv);
+ STRLEN oldlen = 0;
PUSHMARK(stack_sp);
! if (in_eval) (void)SvPV(atsv, oldlen);
! perl_call_sv((SV*)cv, G_EVAL|G_DISCARD|(in_eval ? G_KEEPERR : 0));
(void)SvPV(atsv, len);
! if (len > oldlen) {
Copy(oldtop, top_env, 1, jmp_buf);
curcop = &compiling;
curcop->cop_line = oldline;
it goes "almost there". If you remember, yesterday I got hit by pad_sv
panic (it may be related to NETaa14683, but happens in a short file).
Today I ran it in gdb, and after a lot of experiments found an error
in my script: It happens that not only ENDs, but also BEGINs may also
mask the error report.
For curious, try to run
eval 'sub x {$a();&b[]} BEGIN {OK}'; die $@
from a command line, or from a required file. Below is the tentative
patch for the problem. It fixes the situation when called from the
command line, but prints the message twice when run from a required
file. It happens like this: do_eval calls DIE with $@ as argument, die
calls die_where which appends $@ to the argument of DIE.
I'm not very fluent in Perl error processing, so did not try to fix
duplicate message. From my point of view one should never do $@="" if
in_eval is true, but I did not try to fix this too.
Note that this patch does not fix
panic pad_sv po
it just makes it possible to see the previous error.
Best,
Ilya
*** perl.c~ Tue Nov 07 03:28:58 1995
--- perl.c Wed Nov 08 22:39:02 1995
***************
*** 1743,1752 ****
switch (setjmp(top_env)) {
case 0: {
SV* atsv = GvSV(errgv);
PUSHMARK(stack_sp);
! perl_call_sv((SV*)cv, G_EVAL|G_DISCARD);
(void)SvPV(atsv, len);
! if (len) {
Copy(oldtop, top_env, 1, jmp_buf);
curcop = &compiling;
curcop->cop_line = oldline;
--- 1743,1754 ----
switch (setjmp(top_env)) {
case 0: {
SV* atsv = GvSV(errgv);
+ STRLEN oldlen = 0;
PUSHMARK(stack_sp);
! if (in_eval) (void)SvPV(atsv, oldlen);
! perl_call_sv((SV*)cv, G_EVAL|G_DISCARD|(in_eval ? G_KEEPERR : 0));
(void)SvPV(atsv, len);
! if (len > oldlen) {
Copy(oldtop, top_env, 1, jmp_buf);
curcop = &compiling;
curcop->cop_line = oldline;