You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by David Mitchell <da...@fdgroup.co.uk> on 2000/06/09 13:35:45 UTC
Patch for 5.6.0 coredump / Bizarre copy
A patch has just been released for Perl 5.6.0, which fixes
some, (or hopefully all!) of the bugs which cause coredumps
or 'Bizarre copy of HASH/ARRAY' runtime errors in the general
vicinity of Carp::confess(), caller(), @DB::args etc.
This certainly fixes the failure in Mason's t/05-request test file,
and may well fix a bunch of general mod_perl related problems.
see
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-06/msg00200.html
for more info, but here's the patch itself.
==== //depot/perl/cop.h#49 (text) ====
Index: perl/cop.h
--- perl/cop.h.~1~ Thu Jun 8 06:58:03 2000
+++ perl/cop.h Thu Jun 8 06:58:03 2000
@@ -106,13 +106,9 @@
} STMT_END
#endif /* USE_THREADS */
-#ifdef USE_ITHREADS
- /* junk in @_ spells trouble when cloning CVs, so don't leave any */
-# define CLEAR_ARGARRAY() av_clear(cx->blk_sub.argarray)
-#else
-# define CLEAR_ARGARRAY() NOOP
-#endif /* USE_ITHREADS */
-
+/* junk in @_ spells trouble when cloning CVs and in pp_caller(), so don't
+ * leave any */
+#define CLEAR_ARGARRAY() av_clear(cx->blk_sub.argarray)
#define POPSUB(cx,sv) \
STMT_START { \
==== //depot/perl/t/op/runlevel.t#16 (xtext) ====
Index: perl/t/op/runlevel.t
--- perl/t/op/runlevel.t.~1~ Thu Jun 8 06:58:03 2000
+++ perl/t/op/runlevel.t Thu Jun 8 06:58:03 2000
@@ -349,3 +349,18 @@
bar
B 2
bar
+########
+sub n { 0 }
+sub f { my $x = shift; d(); }
+f(n());
+f();
+
+sub d {
+ my $i = 0; my @a;
+ while (do { { package DB; @a = caller($i++) } } ) {
+ @a = @DB::args;
+ for (@a) { print "$_\n"; $_ = '' }
+ }
+}
+EXPECT
+0
End of Patch.
* Dave Mitchell, Operations Manager,
* Fretwell-Downing Facilities Ltd, UK. Dave.Mitchell@fdgroup.com
* Tel: +44 114 281 6113. The usual disclaimers....
*
* Standards (n). Battle insignia or tribal totems