[Orca-checkins] r268 - in trunk/orca: . packages/Storable-2.07 packages/Storable-2.09 packages/Storable-2.09/hints packages/Storable-2.09/t

Blair Zajac blair at orcaware.com
Thu Jan 15 13:37:16 PST 2004


Author: blair
Date: Thu Jan 15 13:36:57 2004
New Revision: 268

Added:
   trunk/orca/packages/Storable-2.09/
      - copied from r267, trunk/orca/packages/Storable-2.07/
   trunk/orca/packages/Storable-2.09/hints/
   trunk/orca/packages/Storable-2.09/hints/linux.pl
Removed:
   trunk/orca/packages/Storable-2.07/
Modified:
   trunk/orca/INSTALL
   trunk/orca/configure.in
   trunk/orca/packages/Storable-2.09/ChangeLog
   trunk/orca/packages/Storable-2.09/MANIFEST
   trunk/orca/packages/Storable-2.09/Makefile.PL
   trunk/orca/packages/Storable-2.09/README
   trunk/orca/packages/Storable-2.09/Storable.pm
   trunk/orca/packages/Storable-2.09/Storable.xs
   trunk/orca/packages/Storable-2.09/t/code.t
   trunk/orca/packages/Storable-2.09/t/freeze.t
   trunk/orca/packages/Storable-2.09/t/malice.t
   trunk/orca/packages/Storable-2.09/t/utf8hash.t
Log:
Upgrade Storable from 2.07 to 2.09 and require the new version for
Orca.

* configure.in:
  Bump Storable's version number to 2.09.

* INSTALL (Determine which Perl modules need compiling and installing):
  Update all references to Storable's version number from 2.07 to
  2.09.

* packages/Storable-2.09:
  Renamed from packages/Storable-2.07.  Directory contents updated
  from Storable-2.09.tar.gz.


Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL	(original)
+++ trunk/orca/INSTALL	Thu Jan 15 13:36:57 2004
@@ -176,7 +176,7 @@
     Digest::MD5             >= 2.33        >= 2.33      2.33
     Math::IntervalSearch    >= 1.05        >= 1.05      1.05
     RRDs                    >= 1.000451    >= 1.0.45    1.0.45
-    Storable                >= 2.07        >= 2.07      2.07
+    Storable                >= 2.09        >= 2.09      2.09
     Time::HiRes             Not required by Orca        1.52
 
     All seven of these modules are included with the Orca distribution
@@ -267,10 +267,10 @@
 
     Storable
 
-      http://www.perl.com/CPAN/authors/id/A/AM/AMS/Storable-2.07.tar.gz
+      http://www.perl.com/CPAN/authors/id/A/AM/AMS/Storable-2.09.tar.gz
 
-      % gunzip -c Storable-2.07.tar.gz | tar xvf -
-      % cd Storable-2.07
+      % gunzip -c Storable-2.09.tar.gz | tar xvf -
+      % cd Storable-2.09
       % perl Makefile.PL
       % make
       % make test

Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in	(original)
+++ trunk/orca/configure.in	Thu Jan 15 13:36:57 2004
@@ -39,8 +39,8 @@
 MATH_INTERVALSEARCH_VER=1.05
 RRDTOOL_DIR=rrdtool-1.0.45
 RRDTOOL_VER=1.000451
-STORABLE_DIR=Storable-2.07
-STORABLE_VER=2.07
+STORABLE_DIR=Storable-2.09
+STORABLE_VER=2.09
 TIME_HIRES_DIR=Time-HiRes-1.52
 TIME_HIRES_VER=1.52
 

Modified: trunk/orca/packages/Storable-2.09/ChangeLog
==============================================================================
--- trunk/orca/packages/Storable-2.07/ChangeLog	(original)
+++ trunk/orca/packages/Storable-2.09/ChangeLog	Thu Jan 15 13:36:57 2004
@@ -1,3 +1,25 @@
+Sat Jan  3 18:49:18 GMT 2004   Nicholas Clark <nick at ccl4.org>
+
+    Version 2.09
+
+	Fix minor problems with the CPAN release
+	1: Make Storable.xs work on 5.8.2 and later (already in the core)
+	2: Ship the linux hints file
+	3: Ship Test::More for the benefit of Perls pre 5.6.2
+	4: Correct Makefile.PL to only install in core for 5.8.0 and later
+
+Sat Sep  6 01:08:20 IST 2003   Abhijit Menon-Sen <ams at wiw.org>
+
+    Version 2.08
+
+        This release works around a 5.8.0 bug which caused hashes to not
+        be marked as having key flags even though an HEK had HEK_WASUTF8
+        set. (Note that the only reasonable solution is to silently drop
+        the flag from the affected key.)
+
+        Users of RT 3 who were seeing assertion failures should upgrade.
+        (Perl 5.8.1 will have the bug fixed.)
+
 Mon May  5 10:24:16 IST 2003   Abhijit Menon-Sen <ams at wiw.org>
 
     Version 2.07

Modified: trunk/orca/packages/Storable-2.09/MANIFEST
==============================================================================
--- trunk/orca/packages/Storable-2.07/MANIFEST	(original)
+++ trunk/orca/packages/Storable-2.09/MANIFEST	Thu Jan 15 13:36:57 2004
@@ -4,6 +4,7 @@
 Storable.pm		    The perl side of Storable
 Storable.xs		    The C side of Storable
 ChangeLog		    Changes since baseline
+hints/linux.pl		    Hint file to drop gcc to -O2
 t/blessed.t		    See if Storable works
 t/canonical.t		    See if Storable works
 t/code.t		    Test (de)serialization of code references
@@ -30,3 +31,6 @@
 t/tied_items.t		    See if Storable works
 t/utf8.t		    See if Storable works
 t/utf8hash.t		    See if Storable works
+t/Test/Builder.pm	    For testing the CPAN release on pre 5.6.2
+t/Test/More.pm		    For testing the CPAN release on pre 5.6.2
+t/Test/Simple.pm	    For testing the CPAN release on pre 5.6.2

Modified: trunk/orca/packages/Storable-2.09/Makefile.PL
==============================================================================
--- trunk/orca/packages/Storable-2.07/Makefile.PL	(original)
+++ trunk/orca/packages/Storable-2.09/Makefile.PL	Thu Jan 15 13:36:57 2004
@@ -14,7 +14,7 @@
     MAN3PODS            => {},
 # We now ship this in t/
 #    PREREQ_PM           => { 'Test::More' => '0.41' },
-    INSTALLDIRS         => 'perl',
+    INSTALLDIRS		=> $] >= 5.007 ? 'perl' : 'site',
     VERSION_FROM        => 'Storable.pm',
     dist                => { SUFFIX => 'gz', COMPRESS => 'gzip -f' },
 );

Modified: trunk/orca/packages/Storable-2.09/README
==============================================================================
--- trunk/orca/packages/Storable-2.07/README	(original)
+++ trunk/orca/packages/Storable-2.09/README	Thu Jan 15 13:36:57 2004
@@ -1,6 +1,6 @@
-                         Storable 2.07
+                         Storable 2.09
                Copyright (c) 1995-2000, Raphael Manfredi
-               Copyright (c) 2001,2002, Larry Wall
+               Copyright (c) 2001-2004, Larry Wall
 
 ------------------------------------------------------------------------
     This program is free software; you can redistribute it and/or modify

Modified: trunk/orca/packages/Storable-2.09/Storable.pm
==============================================================================
--- trunk/orca/packages/Storable-2.07/Storable.pm	(original)
+++ trunk/orca/packages/Storable-2.09/Storable.pm	Thu Jan 15 13:36:57 2004
@@ -21,7 +21,7 @@
 use AutoLoader;
 use vars qw($canonical $forgive_me $VERSION);
 
-$VERSION = '2.07';
+$VERSION = '2.09';
 *AUTOLOAD = \&AutoLoader::AUTOLOAD;		# Grrr...
 
 #

Modified: trunk/orca/packages/Storable-2.09/Storable.xs
==============================================================================
--- trunk/orca/packages/Storable-2.07/Storable.xs	(original)
+++ trunk/orca/packages/Storable-2.09/Storable.xs	Thu Jan 15 13:36:57 2004
@@ -470,7 +470,7 @@
 	if (!mbase) {						\
 		TRACEME(("** allocating mbase of %d bytes", MGROW)); \
 		New(10003, mbase, MGROW, char);	\
-		msiz = MGROW;					\
+		msiz = (STRLEN)MGROW;					\
 	}									\
 	mptr = mbase;						\
 	if (x)								\
@@ -783,6 +783,10 @@
 #define STORABLE_BIN_WRITE_MINOR	6
 #endif /* (PATCHLEVEL <= 6) */
 
+#if (PATCHLEVEL < 8 || (PATCHLEVEL == 8 && SUBVERSION < 1))
+#define PL_sv_placeholder PL_sv_undef
+#endif
+
 /*
  * Useful store shortcuts...
  */
@@ -850,12 +854,12 @@
 #define STORE_SCALAR(pv, len)	STORE_PV_LEN(pv, len, SX_SCALAR, SX_LSCALAR)
 
 /*
- * Store undef in arrays and hashes without recursing through store().
+ * Store &PL_sv_undef in arrays without recursing through store().
  */
-#define STORE_UNDEF() 					\
+#define STORE_SV_UNDEF() 					\
   STMT_START {							\
 	cxt->tagnum++;						\
-	PUTMARK(SX_UNDEF);					\
+	PUTMARK(SX_SV_UNDEF);					\
   } STMT_END
 
 /*
@@ -1322,7 +1326,8 @@
 	 * new retrieve routines.
 	 */
 
-	cxt->hseen = ((cxt->retrieve_vtbl == sv_old_retrieve) ? newHV() : 0);
+	cxt->hseen = (((void*)cxt->retrieve_vtbl == (void*)sv_old_retrieve)
+		      ? newHV() : 0);
 
 	cxt->aseen = newAV();			/* Where retrieved objects are kept */
 	cxt->aclass = newAV();			/* Where seen classnames are kept */
@@ -2036,7 +2041,7 @@
 		sav = av_fetch(av, i, 0);
 		if (!sav) {
 			TRACEME(("(#%d) undef item", i));
-			STORE_UNDEF();
+			STORE_SV_UNDEF();
 			continue;
 		}
 		TRACEME(("(#%d) item", i));
@@ -2207,7 +2212,7 @@
                             = (((hash_flags & SHV_RESTRICTED)
                                 && SvREADONLY(val))
                                ? SHV_K_LOCKED : 0);
-                        if (val == &PL_sv_undef)
+                        if (val == &PL_sv_placeholder)
                             flags |= SHV_K_PLACEHOLDER;
 
 			keyval = SvPV(key, keylen_tmp);
@@ -2248,7 +2253,13 @@
                             PUTMARK(flags);
                             TRACEME(("(#%d) key '%s' flags %x %u", i, keyval, flags, *keyval));
                         } else {
-                            assert (flags == 0);
+                            /* This is a workaround for a bug in 5.8.0
+                               that causes the HEK_WASUTF8 flag to be
+                               set on an HEK without the hash being
+                               marked as having key flags. We just
+                               cross our fingers and drop the flag.
+                               AMS 20030901 */
+                            assert (flags == 0 || flags == SHV_K_WASUTF8);
                             TRACEME(("(#%d) key '%s'", i, keyval));
                         }
 			WLEN(keylen);
@@ -2303,7 +2314,7 @@
                             = (((hash_flags & SHV_RESTRICTED)
                                 && SvREADONLY(val))
                                              ? SHV_K_LOCKED : 0);
-                        if (val == &PL_sv_undef)
+                        if (val == &PL_sv_placeholder)
                             flags |= SHV_K_PLACEHOLDER;
 
                         hek = HeKEY_hek(he);
@@ -2339,7 +2350,13 @@
                             PUTMARK(flags);
                             TRACEME(("(#%d) key '%s' flags %x", i, key, flags));
                         } else {
-                            assert (flags == 0);
+                            /* This is a workaround for a bug in 5.8.0
+                               that causes the HEK_WASUTF8 flag to be
+                               set on an HEK without the hash being
+                               marked as having key flags. We just
+                               cross our fingers and drop the flag.
+                               AMS 20030901 */
+                            assert (flags == 0 || flags == SHV_K_WASUTF8);
                             TRACEME(("(#%d) key '%s'", i, key));
                         }
                         if (flags & SHV_K_ISSV) {
@@ -2379,7 +2396,7 @@
 #else
 	dSP;
 	I32 len;
-	int ret, count, reallen;
+	int count, reallen;
 	SV *text, *bdeparse;
 
 	TRACEME(("store_code (0x%"UVxf")", PTR2UV(cv)));
@@ -4895,7 +4912,7 @@
 
             if (flags & SHV_K_PLACEHOLDER) {
                 SvREFCNT_dec (sv);
-                sv = &PL_sv_undef;
+                sv = &PL_sv_placeholder;
 		store_flags |= HVhek_PLACEHOLD;
 	    }
             if (flags & SHV_K_UTF8) {
@@ -4928,7 +4945,7 @@
              */
 
 #ifdef HAS_RESTRICTED_HASHES
-            if (hv_store_flags(hv, kbuf, size, sv, 0, flags) == 0)
+            if (hv_store_flags(hv, kbuf, size, sv, 0, store_flags) == 0)
                 return (SV *) 0;
 #else
             if (!(store_flags & HVhek_PLACEHOLD))
@@ -4960,7 +4977,7 @@
 	dSP;
 	int type, count;
 	SV *cv;
-	SV *sv, *text, *sub, *errsv;
+	SV *sv, *text, *sub;
 
 	TRACEME(("retrieve_code (#%d)", cxt->tagnum));
 

Added: trunk/orca/packages/Storable-2.09/hints/linux.pl
==============================================================================
--- (empty file)
+++ trunk/orca/packages/Storable-2.09/hints/linux.pl	Thu Jan 15 13:36:57 2004
@@ -0,0 +1,10 @@
+# gcc -O3 (and higher) can cause code produced from Storable.xs that
+# dumps core immediately in recurse.t and retrieve.t, in is_storing()
+# and last_op_in_netorder(), respectively.  In both cases the cxt is
+# full of junk (and according to valgrind the cxt was never stack'd,
+# malloc'd or free'd).  Observed in Debian 3.0 x86, with gccs 2.95.4
+# 20011002 and 3.3, and in Redhat 7.1 with gcc 3.3.1. The failures
+# happen only for unthreaded builds, threaded builds work okay.
+use Config;
+$self->{OPTIMIZE} = '-O2';
+

Modified: trunk/orca/packages/Storable-2.09/t/code.t
==============================================================================
--- trunk/orca/packages/Storable-2.07/t/code.t	(original)
+++ trunk/orca/packages/Storable-2.09/t/code.t	Thu Jan 15 13:36:57 2004
@@ -25,7 +25,7 @@
     if (!eval q{
 	use Test;
 	use B::Deparse 0.61;
-	use 5.6.0;
+	use 5.006;
 	1;
     }) {
 	print "1..0 # skip: tests only work with B::Deparse 0.61 and at least perl 5.6.0\n";
@@ -55,6 +55,8 @@
     sub code { "JAPH" }
 }
 
+local *FOO;
+
 @obj =
     ([\&code,                   # code reference
       sub { 6*7 },

Modified: trunk/orca/packages/Storable-2.09/t/freeze.t
==============================================================================
--- trunk/orca/packages/Storable-2.07/t/freeze.t	(original)
+++ trunk/orca/packages/Storable-2.09/t/freeze.t	Thu Jan 15 13:36:57 2004
@@ -24,7 +24,7 @@
 
 use Storable qw(freeze nfreeze thaw);
 
-print "1..19\n";
+print "1..20\n";
 
 $a = 'toto';
 $b = \$a;
@@ -136,3 +136,16 @@
 
 thaw $frozen;			# used to segfault here
 ok 19, 1;
+
+if ($] >= 5.006) {
+    eval '
+        $a = []; $#$a = 2; $a->[1] = undef;
+        $b = thaw freeze $a;
+        @a = map { ~~ exists $a->[$_] } 0 .. $#$a;
+        @b = map { ~~ exists $b->[$_] } 0 .. $#$b;
+        ok 20, "@a" eq "@b";
+    ';
+}
+else {
+    print "ok 20 # skipped (no av_exists)\n";
+}

Modified: trunk/orca/packages/Storable-2.09/t/malice.t
==============================================================================
--- trunk/orca/packages/Storable-2.07/t/malice.t	(original)
+++ trunk/orca/packages/Storable-2.09/t/malice.t	Thu Jan 15 13:36:57 2004
@@ -51,7 +51,7 @@
 # present in files, but not in things store()ed to memory
 $fancy = ($] > 5.007 ? 2 : 0);
 
-plan tests => 368 + length ($byteorder) * 4 + $fancy * 8;
+plan tests => 368 + length ($byteorder) * 4 + $fancy * 8 + 1;
 
 use Storable qw (store retrieve freeze thaw nstore nfreeze);
 
@@ -324,3 +324,15 @@
 # And now try almost everything again with a Storable string
 $stored = nfreeze \%hash;
 test_things($stored, \&freeze_and_thaw, 'string', 1);
+
+# Test that the bug fixed by #20587 doesn't affect us under some older
+# Perl. AMS 20030901
+{
+    chop(my $a = chr(0xDF).chr(256));
+    my %a = (chr(0xDF) => 1);
+    $a{$a}++;
+    freeze \%a;
+    # If we were built with -DDEBUGGING, the assert() should have killed
+    # us, which will probably alert the user that something went wrong.
+    ok(1);
+}

Modified: trunk/orca/packages/Storable-2.09/t/utf8hash.t
==============================================================================
--- trunk/orca/packages/Storable-2.07/t/utf8hash.t	(original)
+++ trunk/orca/packages/Storable-2.09/t/utf8hash.t	Thu Jan 15 13:36:57 2004
@@ -8,7 +8,11 @@
     if ($ENV{PERL_CORE}){
 	chdir('t') if -d 't';
 	@INC = ('.', '../lib');
-	push @INC, "::lib:$MacPerl::Architecture:" if $^O eq 'MacOS';
+        if ($^O eq 'MacOS') {
+            # Look, I'm using this fully-qualified variable more than once!
+            my $arch = $MacPerl::Architecture;
+            push @INC, "::lib:${MacPerl::Architecture}:";
+        }
     } else {
 	unshift @INC, 't';
     }
@@ -32,7 +36,6 @@
 # point Test::More tidily prints up 1..79 as if I meant to finish there.
 use Test::More tests=>148;
 use bytes ();
-use Encode qw(is_utf8);
 my %utf8hash;
 
 $Storable::canonical = $Storable::canonical; # Shut up a used only once warning.



More information about the Orca-checkins mailing list