New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test suite for XML::Writer coredumps perl #2053
Comments
From scrytch@uswest.netCreated by scrytch@uswest.net[0139][root@abulafia:~/.cpan/build/XML-Writer-0.4]# PERL_DL_NONLAZY=1 /usr/bin/p The test doesn't look like much: Perl Info
|
From [Unknown Contact. See original ticket]
|
From [Unknown Contact. See original ticket]
This is the same problem that is addressed by ID 20000603.001, where |
From @gsarOn Wed, 07 Jun 2000 17:12:50 +0200, Wolfgang Laun wrote:
I haven't investigated this much, but I seem to recall the XML::Writer Thanks for your minimal test case. Here's an even more minimal one, ### (1) OK if reference is not stored ### (2) OK if @_ is passed explicitly sub try { eval { B('foo', 'bar') }; print try(); It appears that the problem is due to an old issue: Perl_dounwind() Sarathy |
From [Unknown Contact. See original ticket]In message <200006071631.JAA26989@molotok.activestate.com>
Changing PUSHSUB and POPSUB like that does indeed appear to fix Specifically miniperl winds up dying during the build process Tom |
From @gsarOn Sun, 25 Jun 2000 11:07:00 BST, Tom Hughes wrote:
Here's my implementation, which appears to work fine. Thanks for trying! Sarathy Inline Patch-----------------------------------8<-----------------------------------
Change 6291 by gsar@auger on 2000/06/30 04:37:33
dounwind() may cause POPSUB() to diddle the wrong PL_curpad
when @_ is modified, causing coredumps
Affected files ...
... //depot/perl/cop.h#51 edit
... //depot/perl/pp_ctl.c#206 edit
... //depot/perl/pp_hot.c#171 edit
... //depot/perl/t/op/args.t#2 edit
Differences ...
==== //depot/perl/cop.h#51 (text) ====
Index: perl/cop.h
--- perl/cop.h.~1~ Thu Jun 29 21:37:37 2000
+++ perl/cop.h Thu Jun 29 21:37:37 2000
@@ -80,6 +80,7 @@
U16 olddepth;
U8 hasargs;
U8 lval; /* XXX merge lval and hasargs? */
+ SV ** oldcurpad;
};
#define PUSHSUB(cx) \
@@ -126,7 +127,7 @@
cx->blk_sub.argarray = newAV(); \
av_extend(cx->blk_sub.argarray, fill); \
AvFLAGS(cx->blk_sub.argarray) = AVf_REIFY; \
- PL_curpad[0] = (SV*)cx->blk_sub.argarray; \
+ cx->blk_sub.oldcurpad[0] = (SV*)cx->blk_sub.argarray; \
} \
else { \
CLEAR_ARGARRAY(cx->blk_sub.argarray); \
==== //depot/perl/pp_ctl.c#206 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c.~1~ Thu Jun 29 21:37:37 2000
+++ perl/pp_ctl.c Thu Jun 29 21:37:37 2000
@@ -913,6 +913,7 @@
cx->blk_sub.savearray = GvAV(PL_defgv);
GvAV(PL_defgv) = (AV*)SvREFCNT_inc(av);
#endif /* USE_THREADS */
+ cx->blk_sub.oldcurpad = PL_curpad;
cx->blk_sub.argarray = av;
}
qsortsv((myorigmark+1), max,
@@ -2308,6 +2309,7 @@
cx->blk_sub.savearray = GvAV(PL_defgv);
GvAV(PL_defgv) = (AV*)SvREFCNT_inc(av);
#endif /* USE_THREADS */
+ cx->blk_sub.oldcurpad = PL_curpad;
cx->blk_sub.argarray = av;
++mark;
==== //depot/perl/pp_hot.c#171 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c.~1~ Thu Jun 29 21:37:37 2000
+++ perl/pp_hot.c Thu Jun 29 21:37:37 2000
@@ -2659,6 +2659,7 @@
cx->blk_sub.savearray = GvAV(PL_defgv);
GvAV(PL_defgv) = (AV*)SvREFCNT_inc(av);
#endif /* USE_THREADS */
+ cx->blk_sub.oldcurpad = PL_curpad;
cx->blk_sub.argarray = av;
++MARK;
==== //depot/perl/t/op/args.t#2 (xtext) ====
Index: perl/t/op/args.t
--- perl/t/op/args.t.~1~ Thu Jun 29 21:37:37 2000
+++ perl/t/op/args.t Thu Jun 29 21:37:37 2000
@@ -1,6 +1,6 @@
#!./perl
-print "1..8\n";
+print "1..9\n";
# test various operations on @_
@@ -52,3 +52,24 @@
print "# got [@$y], expected [a b c y]\nnot " unless "@$y" eq "a b c y";
print "ok $ord\n";
}
+
+# see if POPSUB gets to see the right pad across a dounwind() with
+# a reified @_
+
+sub methimpl {
+ my $refarg = \@_;
+ die( "got: @_\n" );
+}
+
+sub method {
+ &methimpl;
+}
+
+sub try {
+ eval { method('foo', 'bar'); };
+ print "# $@" if $@;
+}
+
+for (1..5) { try() }
+++$ord;
+print "ok $ord\n";
End of Patch. |
From [Unknown Contact. See original ticket]In message <200006300442.VAA24500@molotok.activestate.com>
I actually tried to make POPSUB do the restoring whil you It seems to work anyway, and does fix the XML::Writer test Tom |
From @gsarOn Sun, 02 Jul 2000 17:28:11 BST, Tom Hughes wrote:
Yes, that would make a big difference. PL_curpad needs to Sarathy |
Migrated from rt.perl.org#3332 (status was 'resolved')
Searchable as RT3332$
The text was updated successfully, but these errors were encountered: