develooper Front page | perl.perl5.changes | Postings from February 2018

[perl.git] branch blead updated. v5.27.8-236-gf2d3b50945

Thread Next
From:
Tony Cook
Date:
February 8, 2018 03:33
Subject:
[perl.git] branch blead updated. v5.27.8-236-gf2d3b50945
Message ID:
E1ejcxx-0002hT-Ma@git.dc.perl.space
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/f2d3b509451688a0dcdb7248cc350ea3f9175e62?hp=12453e29a22d63862ba5924c61c08baabd9c6782>

- Log -----------------------------------------------------------------
commit f2d3b509451688a0dcdb7248cc350ea3f9175e62
Merge: 12453e29a2 66b628b327
Author: Tony Cook <tony@develop-help.com>
Date:   Thu Feb 8 14:23:43 2018 +1100

    (perl #127743) merge Storable work to date
    
    This merges a large number of changes from cperl Storable, largely for
    64-bit object support, and then further extends 64-bit object support
    and fixes a number of other issues.

commit 66b628b3277702a2f289cf559db46f98a6989330
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Jan 16 15:50:24 2018 +1100

    bump $Storable::VERSION to 3.06

commit 5b1bc10167d01c4a9a1fa41a7ac852a825233b82
Author: Tony Cook <tony@develop-help.com>
Date:   Wed Feb 7 15:56:24 2018 +1100

    (perl #127743) update Changes

commit c0e3b4b51cabf15ed8fc5f564dfeea31c25f5239
Author: Tony Cook <tony@develop-help.com>
Date:   Wed Jan 10 11:32:43 2018 +1100

    (perl #127743) re-work recursion limit handling
    
    Previously this worked by calculating the limits and then rebuilding
    Storable.so, this meant Storable.so was built twice meaning a new make
    would then rebuild its dependencies.
    
    This was also a hard limit, so if Storable's user knew the available
    stack space changed they would need to rebuild Storable to adapt.
    
    This also allows for successful static Storable builds.
    
    I also updated the stacksize tool to prevent popping up segfault error
    messages at the user on Win32.
    
    Since I was still seeing test failures in recurse.t on a variety of
    platforms, I made the default limit calculations even more
    conservative.

commit d6ecacbcfb0cb2280a237e991e0a57ff707e4e42
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Dec 19 01:06:31 2017 +0100

    (perl #50608) add experimental regular expression support
    
    This doesn't work on 5.6, but I'm not sure why.
    
    For a bad regular expression _make_re() throws an exception, and it's
    propagated back to the original caller, and execution continues.
    
    But after the program is complete retrieve_regexp() continues
    execution from the call_pv(), typically with count == -1 and dies
    horribly.

commit 369143e7a7d219744f777f0c30bf410f0dac22a0
Author: Tony Cook <tony@develop-help.com>
Date:   Mon Dec 18 06:06:10 2017 +0100

    (perl #127743) fix dependencies for Storable.pm
    
    Since ad2ec6b5 Storable.pm has been generated by Storable.pm.PL from
    __Storable__pm.
    
    Unfortunately the PL_FILES EU::MM key doesn't let you specify any
    dependencies beyond the .PL file, so modifications to __Storable__.pm
    weren't causing Storable.pm to rebuilt.
    
    So I've replaced PL_FILES with an empty hash (to prevent EU::MM
    generating once) and added my own rule.

commit 06f586da4a0cc6d3663570f7be7e50654aa0e735
Author: Tony Cook <tony@develop-help.com>
Date:   Mon Dec 11 23:02:47 2017 +0100

    (perl #25933) always rethrow exceptions thrown through or by the XS implementation
    
    Also, preserve any references thrown.
    
    Such references could be thrown by STORABLE_freeze, STORABLE_thaw or
    STORABLE_attach implementations.
    
    Several of the wrappers in Storable.pm had code similar to:
    
      eval { ... };
      logcroak $@ if $@ =~ s/\.?\n$/,/;
    
    with $@ discarded if the condition failed.
    
    This lead to two problems:
    
    - exceptions not ending in "\n" (which is just references without
      string overloading, or with overloading but that didn't return a
      string ending in "\n") would not be rethrown.
    
    - thrown references that did happen to have overloading that returned
      "\n" would be converted into strings.
    
    This behaviour appears to have been present since the initial release
    of Storable.

commit fa575cfeda2da1b98c1c775b6262a4fe2ce8ca9e
Author: Tony Cook <tony@develop-help.com>
Date:   Mon Dec 11 00:53:35 2017 +0100

    (perl #127743) improve performance in -DDEBUGGING builds
    
    The changes imported from cperl included a change to enable Storable's debugging
    output mechanism for -DDEBUGGING builds.
    
    When built with debugging output, Storable's TRACEME() macro fetched
    the $Storable::DEBUGME global and checked its truth, this
    significantly slowed down Storable, especially noticable for dumps
    with large numbers of objects.
    
    I added a cached traceme value to the Storable context object and
    modified TRACEME() to used that instead.  A few TRACEME()'s that are
    called before the context object is available have been replaced with
    calls to TRACEMD(), a new macro that does what TRACEME() did before.

commit 23b8ec6c0d13f91d9e81a212f95d0e068a4586cb
Author: Tony Cook <tony@develop-help.com>
Date:   Thu Dec 7 01:47:47 2017 +0100

    (perl #131136) clear padding before writing long doubles
    
    This means:
    
    - valgrind won't complain about uninitialized bytes when writing long doubles
    
    - we get consistent output when writing equivalent data structures

commit 48968138d19790da77fff757c57f19594b144e11
Author: Tony Cook <tony@develop-help.com>
Date:   Wed Dec 6 01:52:20 2017 +0100

    (perl #118551) an empty string from _freeze() now supplies the same to _thaw()/_attach()
    
    The retrieve_hook() code would simply pass the string length to
    NEWSV(), so if the length was zero, no PV would be allocated, and the
    SV would not be upgraded.
    
    The following code would then set POK on an SV that wasn't SVt_PV (or
    better), resulting in fun later down the line.
    
    Change to always supply at least 1 as the buffer size for NEWSV(), and
    always set CUR and NUL terminate the buffer.

commit a63d7bdb6c975ff2bb549b1f6724b604fc6ee175
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Dec 5 06:53:16 2017 +0100

    (perl #127743) ensure gzip/gzip are available before we use them

commit 3d0888b3fde529a40f9319a657e0e2b5e881ee0d
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Dec 5 05:24:20 2017 +0100

    (perl #127743) support for >= 4GB data from hooks
    
    Though we use this mechanism for >= 2GB.
    
    This emits an SX_LOBJECT op and writes the string length as a 64-bit
    value if STORABLE_attach() returns more than 2GB of data.
    
    The boundary is set at 2GB since older versions of Storable handle
    sizes between 2GB and 4GB badly, resulting in a memory overwrite.  By
    using the alternate op codes an older Storable will reject the data
    instead.
    
    We still accept such data that might have been written by an older
    Storable.

commit 0079d24564f1f4a127cd1d78827adcab12ee3a33
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Dec 5 00:42:48 2017 +0100

    (perl #131999) treat a 32-bit hook data size as unsigned
    
    Previously retrieve_hook() treated the 32-bit hook data size as a signed value, but
    the parameter to NEWSV() is treated as unsigned.  Due to promotion rules this negative
    signed value is converted to a very large unsigned value running us out of memory.
    
    Fixing this bug will let us accept previously frozen hook data in the
    2GB to 4GB rannge.  The next commit will hopefully allow us to write
    and read 4GB+ data correctly.

commit 0a406809258c9d03a34e12c0b7e6028f7fe59ec9
Author: Tony Cook <tony@develop-help.com>
Date:   Mon Dec 4 15:49:27 2017 +1100

    (perl #131990) treat the length for LSCALAR, LUTF8STR as unsigned
    
    Older Storable without 64-bit object might write such objects.
    
    A malicious file might also be provided with such a large length
    to cause a resource consumption attack (allocating large amounts of
    memory), but Storable explicitly doesn't protect against attacks.

commit 52ef4d491a3291a21a896ffe1385f431549e3d39
Author: Tony Cook <tony@develop-help.com>
Date:   Mon Dec 4 14:41:45 2017 +1100

    we only need 64-bit object support with 64-bit pointer builds
    
    Previously this enabled 64-bit object support with 64-bit int builds,
    such as a 32-bit build with -Duse64bitint supplied to Configure,
    but a 32-bit system can't realistically have more than 2**31 array
    elements or hash elements.
    
    With an operating system built or configured especially to allow it
    you might be able to find a 32-bit system that supported a PV with more
    than 2**31 bytes, but that seems unlikely and not a case to optimize for.

commit 3e1dde5c01ce7b6537999350949026df9d707278
Author: Tony Cook <tony@develop-help.com>
Date:   Mon Dec 4 14:41:19 2017 +1100

    fix various 32-bit issues:
    
    - the comparison against where_is_undef caused signed vs unsigned
      comparison warnings
    
    - don't define get_larray() on 32-bit builds

commit a380301116155162d190747016b69f022df0ffa5
Author: Tony Cook <tony@develop-help.com>
Date:   Wed Nov 22 05:24:29 2017 +0100

    (perl #127743) read the hash's flags for large SX_FLAG_HASH ops
    
    Unfortunately testing this requires more memory than any machine I
    have available has.

commit 82c7fd2b386f2a3652107d02e09ac22a0040afe9
Author: Tony Cook <tony@develop-help.com>
Date:   Wed Nov 22 00:17:33 2017 +0100

    (perl #127743) we should only handle SX_LOBJECT ops on 64-bit platforms
    
    retrieve_lobject() handled such large objects I'm assuming to handle
    smaller sizes stored in a 64-bit length/count, but that can only
    happen if someone isn't using Storable to generate the data.

commit 11063fa3ee687cc33396142a3fb5a48f608741af
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Nov 21 05:55:32 2017 +0100

    (perl #127743) fix network order read/write of large values
    
    This had a couple of bugs:
    
    - W64LEN() used a union where it should have used an array or struct,
      so a network order 64-bit length was written as 4 bytes.  Oops.
    
      Changed to use an array.
    
    - retrieve_lobject() always read the length in host order, so it sort
      of tried to read the length in network order on 32-bit platforms,
      but then didn't fix the order of the length it read.
    
      Now uses READ_U64() (which I originally messed up myself, oops.)

commit ef72e1ceed1a0b777e34991187c06b61e8123a82
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Nov 21 05:51:07 2017 +0100

    (perl #127743) fixes for READ_U64()
    
    - ntohl() the low word too, doh
    
    - if ntohl() isn't provided, then provide it, with appropriate
      wrapping.  Should be exteneded to other uses.
    
    - only available for 64-bit builds

commit b8c1b6ce4e4423aa9804802fa8aa1d586948c1ab
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Nov 21 05:12:16 2017 +0100

    (perl #127743) fix some -DDEBUGGING build issues

commit 6acd7228eb138bbb7c423e1033489eafaa85bb2f
Author: Tony Cook <tony@develop-help.com>
Date:   Tue Nov 21 00:05:28 2017 +0100

    (perl #127743) limit the number of extra refs returned by STORABLE_freeze
    
    Ensure some over enthusiastic STORABLE_freeze() doesn't cause us to
    emit a negative reference count for SX_HOOK.
    
    This fails to be parsed by older versions and flags 64-bit ids for new
    versions of Storable.

commit 6a5052ec8da656e5e5ac939ec1bed1dbfff02d00
Author: Tony Cook <tony@develop-help.com>
Date:   Thu Nov 2 06:55:45 2017 +0100

    (perl #127743) fix large object ids in hook sequences
    
    As with SX_OBJECT, if there are a large number of SVs being frozen the
    object ids can exceed the 32-bit limit.
    
    The problem here is how to indicate that we have 64-bit ids without
    breaking older versions parsing our results for smaller object trees?
    
    We don't have any room in the flags byte, currently used as:
    
     bits  use
     ----  ---
     0,1   type
     2     class length is > 255 bytes
     3     frozen string > 255 bytes
     4     more than 255 extra references
     5     class name has been seen before and is represented as an index
     6     an extra reference is stored next
     7     has a list of extra references
    
    and the extra byte is only used for tied SVs.  We can't repurpose the
    bits 6, 7 since it would break older readers.
    
    I considered adding SX_LARGE_HOOK, or something similar, but we find
    out that large ids are needed well after the op code has been emitted.
    
    So how is the handling of the length + ids handled in retrieve_hook()?
    
        I32 len3 = 0;
        ...
            if (flags & SHF_LARGE_LISTLEN)
                RLEN(len3);
    	else
                GETMARK(len3);
            if (len3) {
                av = newAV();
                av_extend(av, len3 + 1);	/* Leave room for [0] */
                AvFILLp(av) = len3;		/* About to be filled anyway */
            }
    
    For SHF_LARGE_LISTLEN this treats the len3 as signed - so if the
    writer had more than 2**31-2 objects after the "frozen" string,
    decoding is going to break anyway, as av_extend_guts() panics on "key"
    values less than -1.
    
    The code that actually reads the ids will fail to read any ids when
    len3 is negative, since the for loop does a i <= len3 check.
    
    So rather than trying to fix this, I used a negative len3 to indicate
    that the object ids are 64-bit.
    
    This means we get backward compatibility in the cases where 32-bit ids
    work, and older versions of Storable will reject it.
    
    If an older version of Storable wrote a negative len3 (due to
    overflow) we'll be attempting to read 32-bit ids as typically very
    large 64-bit ids (much larger than 2**32 in most cases) which won't be
    found in the seen array, failing the thaw.

commit be827e1bf8824a339ec2b5f6f58542e456157bce
Author: Tony Cook <tony@develop-help.com>
Date:   Wed Nov 1 23:58:49 2017 +0100

    (perl #127743) update PERL_TEST_MEMORY requirements for the older tests
    
    PERL_TEST_MEMORY includes any swap, it's not the minimum resident set
    for the test.

commit a12eb729ab5229a4abf0bec23ea5dd5186281b48
Author: Tony Cook <tony@develop-help.com>
Date:   Wed Nov 1 23:31:39 2017 +0100

    (perl #127743) fix two problems with large object ids
    
    Storable assigns an object id to every scalar it freezes, including to
    unused elements in arrays.
    
    There were two problems here:
    
    a) in retrieve(), object ids over 2**31-1 but less than 2**32 were
       treated as signed, so the wrong object was produced in the resulting
       data structure.  Two changes we made to fix this:
    
      i)  retrieve() now treats object ids in the problem range as
          unsigned, so data written by older Storables is now treated
          correctly.
    
      ii) store() now writes object ids in the problem range as 64-bit
          ids, so that older Storables will fail rather than producing an
          incorrect result data structure.
    
    b) once over 2**32 scalars had been output, the code still produced
       32-bit object ids when referring to previous scalars.  Fixed by
       adding support for 64-bit object ids.
    
    There's still an issue with object ids in hook produced data.
    
    Testing these changes requires ridiculous amounts of memory - ~32GB
    for a) and ~66GB for b), and the tests take a long time to run, hence
    for those tests to run you need the following in the environment;
    
      PERL_TEST_MEMORY >= 70
      PERL_RUN_SLOW_TESTS != 0

commit 6767be4f6a369834d13aee6cfc3b5fa7f4d6c883
Author: Tony Cook <tony@develop-help.com>
Date:   Wed Oct 25 13:55:52 2017 +1100

    (perl #127743) correct some types for Win32
    
    In a couple of places the code uses unsigned long to represent values
    possibly larger than 2**32, but long is 32-bits on x64 Win32, so
    use STRLEN or Ssize_t instead.

commit 2a4dadc5ae0cd9982453013555a8e41a90a70e22
Author: Reini Urban <rurban@cpan.org>
Date:   Mon Jul 24 13:58:37 2017 +0200

    Storable 3.05_13: safe defaults
    
    mingw fix: use safe defaults, not segfaulting defaults.
    mingw fails on the stacksize binary search, leaving it empty.
    
    (cherry picked from commit 27c613e5f8dfab7b8b43a57e93a478aa962dd9ca)
    
    Conflicts:
    	dist/Module-CoreList/lib/Module/CoreList.pm
    	dist/Storable/Storable.pm
    	pod/perlcdelta.pod
    	t/porting/customized.dat

commit 12d9690f103f79d823180b7a5afdbc360f75d038
Author: Reini Urban <rurban@cpan.org>
Date:   Fri Jul 14 16:15:40 2017 +0200

    Storable: Analyze #304
    
    Add a better error message on one of the possible failure causes
    when the system cannot catch the stackoverflow.
    
    (cherry picked from commit 3f655dc6444cd56d09d4a99a4be5a92c1119506b)

commit 98f6ded173955f4b86607fd61c24878a6ab269ac
Author: Reini Urban <rurban@cpan.org>
Date:   Wed May 17 22:40:59 2017 +0200

    Storable: cygwin64 MAX_DEPTH /2
    
    (cherry picked from commit 5c3259bf9a54c29b526cb36cdf155005d8f93236)

commit 604d98462e7b4502ab8d66ef8042e79962c3aa52
Author: Reini Urban <rurban@cpan.org>
Date:   Sun May 14 22:28:21 2017 +0200

    Storable: Need more stack reserve on cygwin also
    
    Same stack quirks as on MSWin32.
    cygwin64 cannot even do 32, try 40.
    
    (cherry picked from commit c663e2126c5060f80eb973828a341606f210f671)

commit 91ea6c3e971a68d79bd17fb77521594839e5f3af
Author: Reini Urban <rurban@cpan.org>
Date:   Fri May 12 09:49:38 2017 +0200

    Storable: fix cygwin stack probing
    
    don't set the PATH needed for other DLLs also.
    
    (cherry picked from commit d0f8b62c3f9ffee9fa8397d4acdadbd695cc4839)

commit dab4d2bfb4f181e84549de7a931329df3cf5e4f3
Author: Reini Urban <rurban@cpan.org>
Date:   Wed Apr 19 09:18:49 2017 +0200

    Storable: Update to 3.05_12
    
    enhance stack reserve from 8 to 16
    
    (cherry picked from commit e344ff0826555342fe207a4a52bcdda4b00e2c44)
    
    Conflicts:
    	Porting/Maintainers.pl
    	dist/Module-CoreList/lib/Module/CoreList.pm
    	dist/Storable/Storable.pm
    	pod/perlcdelta.pod
    	t/porting/customized.dat

commit a65c1822547461e469cce8199a11637c64676c6d
Author: Reini Urban <rurban@cpan.org>
Date:   Tue Apr 18 10:39:29 2017 +0200

    Storable: fix stacksize with shared libcperl
    
    LD_LIBRARY_PATH=dist/Storable/../..
    Interestingly only detected on Solaris, not elsewhere.
    
    (cherry picked from commit 4fc1e35393d951b249e36e02f89ec8d0f9cd7537)

commit af0934941e2ea2cef50001b948bf1aaf24a60568
Author: Reini Urban <rurban@cpan.org>
Date:   Thu Mar 30 11:22:31 2017 +0200

    Storable: fix wrong fake_tag check
    
    coverity CID 165506. if (!sv) is always true. check fake_tag instead.
    
    (cherry picked from commit 3cb71a68201936293a78ed93ca8049ee4cba5497)

commit f00dcd3ab00a895a728da2a846ce1861b0e49f74
Author: Reini Urban <rurban@cpan.org>
Date:   Thu Mar 30 09:04:07 2017 +0200

    Storable: memory leak
    
    detected by coverity
    
    (cherry picked from commit b60e26ff913f3ada34f57e79347e11d3872876c9)

commit 34b5f628df5cc71b3eb30e191bc51dc3936c615e
Author: Reini Urban <rurban@cpan.org>
Date:   Wed Mar 29 21:04:28 2017 +0200

    Storable 3.05_11: croak on sizes read > I32_MAX
    
    detected by coverity:
    CID 165606 (#2 of 2): Untrusted value as argument (TAINTED_SCALAR)
    146. tainted_data: Passing tainted variable size to a tainted sink.
    
    (cherry picked from commit 735d9229a540d05f2d34f46ffea1e68aea9fbbc1)
    
    Conflicts:
    	dist/Storable/Storable.pm

commit ead977b8ae7e7d67f52ea9150e2ac9e69462062f
Author: Reini Urban <rurban@cpan.org>
Date:   Wed Mar 29 21:52:30 2017 +0200

    Storable: simplify last_op_in_netorder
    
    remove dead code, detected by coverity
    
    (cherry picked from commit f1e1f909cfd3e474a0b11f0200a3889b8ff2cc6f)

commit 8dea8e778d247123b49951574e55e8ed83160887
Author: Reini Urban <rurban@cpan.org>
Date:   Wed Mar 29 21:32:57 2017 +0200

    Storable: protect from empty retrieve_vstring
    
    empty sv detected by coverity
    
    (cherry picked from commit 96c0b32bf6ab37f5e82494b79149680012dde49f)

commit 6dc74c4fb2f8221242efef74e76d1a3db9e71d4a
Author: Reini Urban <rurban@cpan.org>
Date:   Wed Mar 29 21:29:46 2017 +0200

    Storable: protect store_other error buf
    
    coverity warns about static buffer overflow.
    
    (cherry picked from commit 74804347b8da42bc5b471646032c2e8d9903106f)

commit 578e86dcd7ac79067cf874ffe6add296c3e23119
Author: Reini Urban <rurban@cpan.org>
Date:   Tue Mar 14 10:05:24 2017 +0100

    Storable: Bump to 3.05_10
    
    No changes, synced cpan with CORE
    
    (cherry picked from commit 0edca17dff085908bd7c3286ffabb3c0e9371706)
    
    Conflicts:
    	Porting/Maintainers.pl
    	dist/Module-CoreList/lib/Module/CoreList.pm
    	dist/Storable/Storable.pm
    	pod/perlcdelta.pod
    	t/porting/customized.dat

commit e58927f47bb258d883cd9745f3aae46034efb2cd
Author: Reini Urban <rurban@cpan.org>
Date:   Sun Mar 12 12:28:31 2017 +0100

    Storable: various core fixups: $PERL,libpth,getcwd
    
    stacksize needs to run perl, not miniperl,
    but the chdir broke $^X (a relative path).
    Quote $^X only with whitespace.
    Set LD_LIBRARY_PATH with a shared libperl.
    Support a --core argument to stacksize.
    Probe it twice.
    
    (cherry picked from commit 0df5d8e463b9b5cfe14f9c235191fd3e5e4013a4)

commit fda9c55cee596a44d14bebb0d70550a7c73d39c7
Author: Reini Urban <rurban@cpan.org>
Date:   Fri Mar 10 10:59:53 2017 +0100

    Storable: core Makefile.SH support
    
    redo building Storable after perl was built,
    with the probed stacksize.h values.
    We can only produce stacksize.h with a PERL_EXE
    so we have to do it twice.
    
    TonyC:
    
     - this fixes the stack overflow iff the rebuild_storable target runs
       after storable is built, but there's nothing preventing
       lib/auto/Storable/Storable.so being built *after* rebuild_storable
       in a parallel build at this point.
    
     - It's also possible for both the lib/...Storable.so target and the
       rebuild_storable target to run at the same time, possibly
       corrupting the generated binary (check 4d106cc5 for ext/SDBM_File
       for example)
    
    Conflicts:
    	.git-rr-cache
    	pod/perlcdelta.pod
    	win32/Makefile.ce

commit dd7f75e0fb1d13de11fce9eb3ae22723df606286
Author: Reini Urban <rurban@cpan.org>
Date:   Thu Mar 9 09:49:31 2017 +0100

    Storable 3.05_09: compute stacksize
    
    (cherry picked from commit a10c78df8c03018ce50f0885bb6b6a5509d9e58f)
    
    TonyC:
     - dist/Storable/t/recurse.t is still crashing on a stack overflow
    
    Conflicts:
    	Porting/Maintainers.pl
    	dist/.gitignore
    	dist/Module-CoreList/lib/Module/CoreList.pm
    	dist/Storable/Storable.pm
    	pod/perlcdelta.pod
    	t/porting/customized.dat

commit 04ef8d9d5ec072d9d077e195f0db0ce6718be7dc
Author: Reini Urban <rurban@cpan.org>
Date:   Wed Mar 8 16:18:32 2017 +0100

    Storable 3.05_08: adjust MAX_DEPTH
    
    2000 is too large for DEBUGGING with clang++. It runs into stack overflow.
    Seperate between c++ and c, debugging and non, 32bit and 64bit.
    
    Tune the stack sizes for various variants.
    New stack recursion limits:
    64: c++ dbg: 1200   DEBUGGING + DEBUG_LEAKING_SCALAR non-threaded
        c   dbg: 3000
        c -O3:   34000 (tested: 34500)
    32: c -O3:   30000 (tested: 32600)
        c   dbg: 750   (tested: 1500)
    asan: 254
    
    Note that the result has to be int, as the value is then right shifted by the
    pre-processor, >> 1, for hashes (i.e. divide by 2).
    
    TonyC:
     - Storable.o fails to build, but the offending code is removed in the
       next commit
    
    (cherry picked from commit a7aff4921e16004c42e40914914e5f3320238e12)
    
    Conflicts:
    	dist/Module-CoreList/lib/Module/CoreList.pm
    	dist/Storable/Storable.pm
    	dist/Storable/t/blessed.t
    	pod/perlcdelta.pod
    	t/porting/customized.dat

commit 6f28206491dc763b7551071c406c3b90240f228e
Author: Reini Urban <rurban@cpan.org>
Date:   Sun Mar 5 11:29:54 2017 +0100

    Storable 3.05_07: update documentation from CPAN
    
    from the CPAN version.
    
    (cherry picked from commit 81259118dd8e16b10dfbdcfe1e2355bae507ac51)
    
    Conflicts:
    	.git-rr-cache
    	dist/Storable/Storable.pm
    	pod/perlcdelta.pod

commit 036928804490e41b2708c21f97cb4ccf2614e9d7
Author: Reini Urban <rurban@cpan.org>
Date:   Sun Mar 5 11:09:01 2017 +0100

    Storable: improve recursion depth check
    
    Store each recursive SV and only ++depth when recursing
    into this same SV, not nested into 2 levels, for performance reasons.
    (We'd really need to store a hash, but this would be slow.)
    So it only protects from the simpliest stack exhaustion attacks,
    others still will segfault.
    Decrease the max depth numbers: 2000 for RV and AV, 1000 for HV,
    experimentally tested for normal stack sizes.
    
    At least it doesnt falsely error with an arrayref nested into another
    big array, as with the CPAN write_metadata_cache.
    Check now also refs recursion into each other.
    
    Closes #257.
    
    (cherry picked from commit cd2b11a42ef9c6829960039382a06622d7248755)
    
    Conflicts:
    	dist/Storable/Storable.pm
    	pod/perlcdelta.pod

commit 4f79e9d77318ce18c6c9242a9a9a96e6bfc572d6
Author: Reini Urban <rurban@cpan.org>
Date:   Sat Mar 4 12:42:36 2017 +0100

    Storable: add testcase for #257
    
    detected by CPAN,
    wrong recursion warning with CPAN write_metadata_cache.
    There's no recursion involved, just nesting a hash into a big
    array will fail.
    
    (cherry picked from commit 2804828cb8c402649cc89f1c40fda63932ccae44)

commit 1142b5f3777baabef206bff35f98c6f63875adee
Author: Reini Urban <rurban@cpan.org>
Date:   Tue Feb 28 23:34:45 2017 +0100

    Fix rurban email address
    
    use the generic cpan.org
    
    (cherry picked from commit 90875988463bbf4b10af59633e23a6a2b2a2cfbe)
    
    TonyC:
     - at this point dist/Storable/t/recurse.t crashes with a stack
       overflow, presumably fixed by the later "tuning" commits
    
    Conflicts:
    	.travis.yml
    	AUTHORS
    	Porting/do-conf-cperl-release
    	Porting/do-make-cperl-release
    	Porting/release_cperl.pod
    	appveyor.yml
    	cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements.pm
    	cpan/CPAN-Meta/lib/CPAN/Meta.pm
    	cpan/Config-Perl-V/t/28_plv522c.t
    	cpan/Cpanel-JSON-XS/XS.pm
    	cpan/Scalar-List-Utils/lib/Sub/Util.pm
    	cpan/YAML-LibYAML/lib/YAML/XS.pod
    	dist/CPAN-Meta/lib/Parse/CPAN/Meta.pm
    	ext/Config/Makefile.PL
    	pod/cperl.pod
    	pod/perl.pod
    	t/porting/customized.dat

commit 81c9046e6ed2139facd20a23494040013edaba34
Author: Reini Urban <rurban@cpanel.net>
Date:   Mon Jan 30 22:16:44 2017 +0100

    Storable: Update to 3.05_03
    
    Appveyor win64 fails to create nested hash.
    Need to repro it on a failing machine. Maybe Win64
    uses a much bigger stack for its threads. But 5000 should
    still be doable, as other machines can do 22_000.
    
    (cherry picked from commit 81786bf3f6be1f6326b588eca9ae3ccc4824b5a8)
    
    Conflicts:
    	.git-rr-cache
    	Porting/Maintainers.pl
    	dist/Storable/Storable.pm
    	pod/perlcdelta.pod

commit 17ab2b3cfa40df43112778900bb1473bbc1bd4a1
Author: Reini Urban <rurban@cpanel.net>
Date:   Mon Jan 30 17:52:24 2017 +0100

    Storable: Update to 3.05_02
    
    Protect against stack overflows with nested arrays and hashes
    [cpan #97526]. This imposes a new limit to your nested structures,
    but JSON::XS has a limit of 512. We use a max_depth of 3000 for the
    typical stack limit of 8k.
    You can still overflow the call stack with nested scalar refs.
    
    (cherry picked from commit 63a5b7f922c2900e328ce97b57d0a54fbc763a98)
    
    Conflicts:
    	.git-rr-cache
    	Porting/Maintainers.pl
    	dist/Storable/Storable.pm
    	pod/perlcdelta.pod

commit fb50259707ace4fb738c9d539bc2b65541a7863b
Author: Reini Urban <rurban@cpanel.net>
Date:   Sun Jan 29 12:43:18 2017 +0100

    Storable: Upgrade to 3.05 from CPAN
    
    See https://github.com/rurban/Storable/
    
    (cherry picked from commit 17a1797c711ed6de48985b0746ae59282f634b12)
    
    Conflicts:
    	Porting/Maintainers.pl
    	dist/Storable/Storable.pm
    	dist/Storable/Storable.xs
    	pod/perlcdelta.pod
    	t/porting/customized.dat

commit 61762c0d416925f5d6bfaf90420bafac5d12d6fb
Author: Reini Urban <rurban@cpanel.net>
Date:   Fri Jan 27 17:10:17 2017 -0600

    Storable: re-indent from 8 hard tabs to soft 4
    
    (cherry picked from commit a5b8bb11df1a50b585a1b07965c860c234877ce3)
    
    Conflicts:
    	dist/Storable/Storable.xs
    	t/porting/customized.dat

commit 56586af9b4d93c10aca86bee3699ad8acabcbd8c
Author: Reini Urban <rurban@cpanel.net>
Date:   Fri Jan 27 10:45:53 2017 -0600

    Storable: skip LOBJECT on 32bit
    
    croak there.  There is no way to store 64bit objects, and when reading them
    we need to croak.  We check the len though (at least on little-endian, on
    big-endian this is broken.)
    
    (cherry picked from commit d6e38371a2997e9546cbf340148a41439091b3c2)
    
    Conflicts:
    	.git-rr-cache
    	pod/perlcdelta.pod
    	t/porting/customized.dat

commit 91524bf0d495bf544667f5fc6649ad0bab8f816d
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu Jan 26 17:31:35 2017 -0600

    Storable: fixup huge
    
    followup to 67a5186ac1aee4b63 with 3.00c.
    MBUF_XTEND and more internal sizes, esp. the dclone size,
    needs to use long, not int.
    Improve TRACEME to cut off printing overlong strings.
    
    (cherry picked from commit d987f810b5f285b075103f58ce43e54d181643bc)
    
    Conflicts:
    	pod/perlcdelta.pod
    	pod/perlcperl.pod
    	t/porting/customized.dat

commit a258c17c6937f79529c8319a829310e09cdbd216
Author: Reini Urban <rurban@cpanel.net>
Date:   Wed Jan 25 11:27:07 2017 -0600

    Storable: protect against classname len overflow
    
    name lenghts can be max. I32 (hek_len), but are read from
    system size integers. e.g. -1 you can cause a malloc fail => exit.
    
    Even worse len > LG_BLESS didn't detect that so you could overwrite
    the stack by malcrafted Storable files.
    Found out by JD. RT #130635. No CVE since p5p believes local Storable
    files are not exploitable.
    
    (cherry picked from commit c82e80f6d88891738e2b5329723606b48347fa31)
    
    Conflicts:
    	.git-rr-cache
    	Porting/Maintainers.pl
    	dist/Storable/Storable.xs
    	pod/perlcdelta.pod
    	t/porting/customized.dat

commit 6e21e8cc612ea666911da7328aaca63117bddec0
Author: Reini Urban <rurban@cpanel.net>
Date:   Sat Jan 7 09:01:29 2017 +0100

    Storable 3.04c: fix printf types
    
    esp. for 32bit use64bitint:
    Storable.xs:2348:4: warning: shift count >= width of type [-Wshift-count-overflow]
                            STORE_PV_LEN((const char *)mg->mg_ptr, len
    
    cast printf args to the right type.
    
    (cherry picked from commit c08d0a10791ec59b04354a1fbd2ed07b3681c703)
    
    Conflicts:
    	.git-rr-cache
    	dist/Storable/Storable.pm
    	t/porting/customized.dat

commit 668fd03b19bb452efef469d93bfe16d703644085
Author: Reini Urban <rurban@cpanel.net>
Date:   Sun Nov 20 18:06:45 2016 +0100

    Storable:  Update to 3.02c
    
    Fix -Wc++11-compat warnings
    
    (cherry picked from commit 852424577630848b6ed6faef3f3a0396f2e91bb8)
    
    Conflicts:
    	dist/Storable/Storable.pm
    	dist/Storable/Storable.xs
    	pod/perlcdelta.pod
    	t/porting/customized.dat

commit 12092f85a990ea61066c40b871882c36750a169e
Author: Reini Urban <rurban@cpanel.net>
Date:   Mon Oct 10 12:14:49 2016 +0200

    Storable: fix -Wchar-subscripts
    
    array subscript is of type char. in DEBUGGING code only.
    
    (cherry picked from commit 07af5b27a799f0b88a5368d81fd57c7643e2edff)
    
    Conflicts:
    	t/porting/customized.dat

commit fc10c8b787d620de44953584facc0f20bfeabe1e
Author: Reini Urban <rurban@cpanel.net>
Date:   Fri Sep 16 01:20:42 2016 +0200

    Storable 3.01 security: detect CVE-2015-1592
    
    warn and test against this published metasploit attack vector.
    See GH #199
    
    Conflicts:
    	dist/Storable/Storable.pm
    
    TonyC:
     - backported parts of 17a1797 to make it compatible with blead
     - updated MANIFEST

commit 011c7626d312040c7f19b4ad5021671df997a598
Author: Reini Urban <rurban@cpanel.net>
Date:   Fri Sep 16 12:01:48 2016 +0200

    Storable: silence cast warnings

commit b0823abe4bcac84946d7bef6dca1495cac7be13f
Author: Reini Urban <rurban@cpanel.net>
Date:   Mon Jun 20 08:29:27 2016 +0200

    Storable: comments

commit 789a5710429dfe5768d496ece438c5751a33e412
Author: Reini Urban <rurban@cpanel.net>
Date:   Wed Oct 4 15:26:37 2017 +1100

    Storable: throw exception on huge values
    
    The Storable data format is incapable of representing lengths of 2**31 or
    greater; and if you try, you can get segfaults or corrupt data or other fun
    and games.
    
    Though it would be undeniably good to fix this properly, this is just a
    simple starting point: the limitation is documented, and an exception is
    thrown when such data is encountered.
    
    Signed-off-by: Reini Urban <rurban@cpanel.net>
    
    Conflicts:
    	dist/Storable/Storable.pm
    	dist/Storable/Storable.xs

commit faf899a8ccca8b5e00769fa63f94aa2844f998b7
Author: Reini Urban <rurban@cpanel.net>
Date:   Sun May 8 20:28:51 2016 +0200

    Release cperl-5.22.2
    
    Conflicts:
    	INSTALL
    	META.json
    	dist/Module-CoreList/lib/Module/CoreList.pm
    	dist/Module-CoreList/lib/Module/CoreList/Utils.pm
    	pod/perlhist.pod
    	t/porting/customized.dat
    
    TonyC:
     - this was largely a core commit, with a minor change to Storable.
       Only the change to Storable has been included.
    
    Cherry-picked from 5d23481d9dc73edc8b59e3ad1ea9f7da164fcfd3

commit 77c891c9c1f42fef039434a9e257b6b9cfe02f88
Author: Reini Urban <rurban@cpanel.net>
Date:   Fri Apr 29 12:26:47 2016 +0200

    Storable: fix win32, missing INT32_MAX

commit f2f9a84444b4078f9a6779e9e0e72b24dd29d1af
Author: Reini Urban <rurban@cpanel.net>
Date:   Fri Apr 1 09:42:41 2016 +0200

    parser: expand tokenbuf from 256 to 1024
    
    This should speed up parsing,
    and changes the "Identifier too long" limitation from max 256 to 1024.
    See [cperl #124]
    
    TonyC:
     - this was largely a core change, with an incidental change to Storable,
       only the Storable change has been included for compatibility with cperl

commit 1cb8a344aa3ff4a6c8e6c40299815d8fa31240de
Author: Reini Urban <rurban@cpanel.net>
Date:   Tue Mar 29 17:50:09 2016 +0200

    Storable 3.00: u64 strings, arrays and hashes >2G
    
    via a new LOBJECT tag. This is for 32bit systems and lengths
    between 2GB and 4GB (I32-U32), and 64bit (>I32).
    Use SSize_t array and hash lengths, see [cperl #123].
    
    Even for hashes, which we cannot iterate over.
    This is a upstream limitation in the HvAUX struct and API.
    We can store >2G keys though, which is fully supported
    in subsequent cperl commits for #123, but not perl5 upstream.
    
    Add several helper functions for strings and hash entries,
    removed a lot of duplicate code.
    
    Reformat consistently (tabs: 8)
    
    Modernize:
    * get rid of main'dump
    * get rid of *FILE typeglob, replace with lexical filehandle
    * fix parallel tests, use unique filenames.
    * fixed many instances of 2arg open,
    * keep backcompat default handling for XS functions, handle the flag
      default there.
    * remove default $Storable::flags settings in the tests
    * fix some too short I32 len types in the XS
    
    Conflicts:
    	dist/Storable/Storable.pm
    	dist/Storable/Storable.xs
    	dist/Storable/t/attach_errors.t
    	dist/Storable/t/blessed.t
    	dist/Storable/t/destroy.t
    	dist/Storable/t/testlib.pl

commit ec4c87747930b1ba81d2c4d1d103e66a62975441
Author: Aaron Crane <arc@cpan.org>
Date:   Fri Mar 18 15:22:12 2016 +0000

    Storable: throw exception on huge values
    
    The Storable data format is incapable of representing lengths of 2**31 or
    greater; and if you try, you can get segfaults or corrupt data or other fun
    and games.
    
    Though it would be undeniably good to fix this properly, this is just a
    simple starting point: the limitation is documented, and an exception is
    thrown when such data is encountered.
    
    Signed-off-by: Reini Urban <rurban@cpanel.net>
    
    Conflicts:
    	dist/Storable/Storable.pm
    	dist/Storable/Storable.xs

commit d0071613f9303a6ad8d483f3164d6fef5bf6f0f5
Author: Reini Urban <rurban@cpanel.net>
Date:   Tue Mar 29 14:59:02 2016 +0200

    Storable: document, reformat and fix for DEBUGGING
    
    fix t/blessed.t: we do try to auto-load modules
    for bless, and avoid regressions. One security flag
    BLESS_OK is enough to disable this.
    
    fix all DEBUGGING 64bit warnings, with TRACEME.
    
    add asserts from blead perl 5.24.
    
    update hints/linux.pl for the known gcc -O3 bug.
    Not repro with gcc 4 nor clang.
    
    fix documentation: SECURITY WARNING, Large data
    on 64-bit platforms
    
    Conflicts:
    	dist/Storable/Storable.xs
    	dist/Storable/t/blessed.t
    
    Cherry-picked from fe00be04fba2ec29f6d0c897a21d0c2771954def

commit c86b4700df6eb1ec7e579c6f7427228277ab0724
Author: Todd Rinaldo <toddr@cpanel.net>
Date:   Tue Oct 3 12:49:07 2017 +1100

    cPanel Storable 2.53_03: don't bless [security]
    
    Optional flags arg to disable bless|tie on retrieve/thaw
    
    Signed-off-by: Reini Urban <rurban@cpanel.net>
    and added documentation, reformat, compute CAN_FLOCK at compile-time.
    See [cperl #120]
    
    TonyC:
    
     - removed pod/perlcdelta.pod changes
     - this commit removed auto-loading modules for overloading, which
       was reinstated in a later commit.
    
    cherry-picked from 04b58ce1b1c391d04efb2c0a3da108603b8cafc6

commit 17847ee19861cdb5d00ef54bca92da1a2eb529a6
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu Mar 24 17:49:07 2016 +0100

    Storable: bump to 2.53_02
    
    enable STORABLE_DEBUGME with -DEBUGGING.
    add split debugging trace messages.
    improve canonical store_hash pre-allocation.
    
    Conflicts:
    	dist/Storable/Storable.pm
    	dist/Storable/Storable.xs
    	dist/Storable/t/restrict.t

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                         |    1 +
 AUTHORS                            |    2 +-
 MANIFEST                           |    9 +
 Makefile.SH                        |   43 +-
 dist/.gitignore                    |    1 +
 dist/Storable/ChangeLog            |  183 +
 dist/Storable/Makefile.PL          |   73 +-
 dist/Storable/README               |   19 +-
 dist/Storable/Storable.xs          | 9548 ++++++++++++++++++++----------------
 dist/Storable/__Storable__.pm      |  509 +-
 dist/Storable/hints/linux.pl       |    5 +-
 dist/Storable/stacksize            |  194 +
 dist/Storable/stacksize_in.h       |    2 +
 dist/Storable/t/CVE-2015-1592.inc  |  261 +
 dist/Storable/t/CVE-2015-1592.t    |   22 +
 dist/Storable/t/attach_errors.t    |    4 -
 dist/Storable/t/attach_singleton.t |    7 +-
 dist/Storable/t/blessed.t          |  204 +-
 dist/Storable/t/canonical.t        |    2 +-
 dist/Storable/t/code.t             |   11 +-
 dist/Storable/t/flags.t            |  103 +
 dist/Storable/t/forgive.t          |    8 +-
 dist/Storable/t/freeze.t           |    2 +
 dist/Storable/t/huge.t             |  104 +
 dist/Storable/t/hugeids.t          |  372 ++
 dist/Storable/t/just_plain_nasty.t |    2 +
 dist/Storable/t/leaks.t            |   15 +
 dist/Storable/t/lock.t             |    6 +-
 dist/Storable/t/malice.t           |    8 +-
 dist/Storable/t/overload.t         |    2 +
 dist/Storable/t/recurse.t          |  253 +-
 dist/Storable/t/regexp.t           |  127 +
 dist/Storable/t/restrict.t         |    9 +-
 dist/Storable/t/retrieve.t         |   37 +-
 dist/Storable/t/st-dump.pl         |    2 +-
 dist/Storable/t/store.t            |   15 +-
 dist/Storable/t/testlib.pl         |    7 +-
 dist/Storable/t/tied.t             |    2 +
 dist/Storable/t/tied_hook.t        |    3 +
 dist/Storable/t/tied_items.t       |    2 +
 dist/Storable/t/tied_reify.t       |   36 +
 dist/Storable/t/utf8hash.t         |    1 +
 dist/Storable/t/weak.t             |    2 +
 win32/GNUmakefile                  |   13 +-
 win32/Makefile                     |   11 +-
 win32/Makefile.ce                  |   10 +-
 win32/makefile.mk                  |   14 +-
 47 files changed, 7682 insertions(+), 4584 deletions(-)
 create mode 100644 dist/Storable/stacksize
 create mode 100644 dist/Storable/stacksize_in.h
 create mode 100644 dist/Storable/t/CVE-2015-1592.inc
 create mode 100644 dist/Storable/t/CVE-2015-1592.t
 create mode 100644 dist/Storable/t/flags.t
 create mode 100644 dist/Storable/t/huge.t
 create mode 100644 dist/Storable/t/hugeids.t
 create mode 100644 dist/Storable/t/regexp.t
 create mode 100644 dist/Storable/t/tied_reify.t

diff --git a/.gitignore b/.gitignore
index 7f3b7b1933..6ce50f0efd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -116,6 +116,7 @@ lib/Config.pod
 lib/Cross.pm
 lib/ExtUtils/MANIFEST.SKIP
 lib/ExtUtils/xsubpp
+lib/Storable/Limit.pm
 lib/auto/
 lib/perldoc.pod
 lib/buildcustomize.pl
diff --git a/AUTHORS b/AUTHORS
index e5295161bc..3fc48c7c30 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1032,7 +1032,7 @@ Raphael Manfredi		<Raphael.Manfredi@pobox.com>
 Raul Dias			<raul@dias.com.br>
 Raymund Will			<ray@caldera.de>
 Redvers Davies			<red@criticalintegration.com>
-Reini Urban			<rurban@x-ray.at>
+Reini Urban			<rurban@cpan.org>
 Renee Baecker			<module@renee-baecker.de>
 Reuben Thomas			<rrt@sc3d.org>
 Rex Dieter			<rdieter@math.unl.edu>
diff --git a/MANIFEST b/MANIFEST
index 4a5c649e45..fc86fc9202 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3677,6 +3677,8 @@ dist/Storable/hints/hpux.pl		Hint for Storable for named architecture
 dist/Storable/hints/linux.pl		Hint for Storable for named architecture
 dist/Storable/Makefile.PL		Storable extension
 dist/Storable/README			Storable extension
+dist/Storable/stacksize			compute stack sizes
+dist/Storable/stacksize_in.h		computed stack sizes
 dist/Storable/Storable.xs		Storable extension
 dist/Storable/Storable.pm.PL	perl script to generate Storable.pm from template
 dist/Storable/t/attach.t		Check STORABLE_attach doesn't create objects unnecessarily
@@ -3689,15 +3691,20 @@ dist/Storable/t/code.t			See if Storable works
 dist/Storable/t/compat01.t		See if Storable works
 dist/Storable/t/compat06.t		See if Storable works
 dist/Storable/t/croak.t			See if Storable works
+dist/Storable/t/CVE-2015-1592.inc	See if Storable works
+dist/Storable/t/CVE-2015-1592.t		See if Storable works
 dist/Storable/t/dclone.t		See if Storable works
 dist/Storable/t/destroy.t		Test Storable in global destructon
 dist/Storable/t/downgrade.t		See if Storable works
 dist/Storable/t/file_magic.t		See if file_magic function works
+dist/Storable/t/flags.t			See if Storable works
 dist/Storable/t/forgive.t		See if Storable works
 dist/Storable/t/freeze.t		See if Storable works
 dist/Storable/t/HAS_ATTACH.pm		For auto-requiring of modules for STORABLE_attach
 dist/Storable/t/HAS_HOOK.pm		For auto-requiring of modules for STORABLE_thaw
 dist/Storable/t/HAS_OVERLOAD.pm		For auto-requiring of mdoules for overload
+dist/Storable/t/huge.t			See how Storable handles huge data
+dist/Storable/t/hugeids.t		See how Storable handles huge object ids
 dist/Storable/t/integer.t		See if Storable works
 dist/Storable/t/interwork56.t		Test compatibility kludge for 64bit data under 5.6.x
 dist/Storable/t/just_plain_nasty.t	See if Storable works
@@ -3709,6 +3716,7 @@ dist/Storable/t/make_overload.pl	Make test data for overload.t
 dist/Storable/t/malice.t		See if Storable copes with corrupt files
 dist/Storable/t/overload.t		See if Storable works
 dist/Storable/t/recurse.t		See if Storable works
+dist/Storable/t/regexp.t		See if Storable works with regexps
 dist/Storable/t/restrict.t		See if Storable works
 dist/Storable/t/retrieve.t		See if Storable works
 dist/Storable/t/robust.t		See if it survives mangled %INC
@@ -3720,6 +3728,7 @@ dist/Storable/t/threads.t		Does Storable work with threads?
 dist/Storable/t/tied.t			See if Storable works
 dist/Storable/t/tied_hook.t		See if Storable works
 dist/Storable/t/tied_items.t		See if Storable works
+dist/Storable/t/tied_reify.t		See if Storable works
 dist/Storable/t/tied_store.t		See if Storable works
 dist/Storable/t/utf8.t			See if Storable works
 dist/Storable/t/utf8hash.t		See if Storable works
diff --git a/Makefile.SH b/Makefile.SH
index b0f70cf045..486953a0bd 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -176,11 +176,15 @@ esac
 
 : is Cwd static or dynamic
 static_cwd='define'
+storable_limit_dep=''
+storable_type=''
 list_util_dep='$(PERL_EXE)'
 for f in $dynamic_ext; do
    case $f in
        Cwd) static_cwd='undef' ;;
-       List/Util) list_util_dep=lib/auto/List/Util/Util.$dlext
+       List/Util) list_util_dep=lib/auto/List/Util/Util.$dlext ;;
+       Storable) storable_limit_dep=lib/auto/Storable/Storable.$dlext
+                 storable_type='dynamic' ;;
    esac
 done
 
@@ -217,6 +221,7 @@ for f in $static_ext; do
 $this_target: lib/auto/List/Util/Util\$(LIB_EXT)" ;;
 	Unicode/Normalize) extra_dep="$extra_dep
 $this_target: uni.data" ;;
+        Storable) storable_type='static' ;;
     esac
 done
 
@@ -618,7 +623,7 @@ lintflags = \
 	@echo `$(CCCMDSRC)` -S $*.c
 	@`$(CCCMDSRC)` -S $*.c
 
-all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make $(MANIFEST_SRT)
+all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make $(MANIFEST_SRT) common_build
 	@echo " ";
 	@echo "	Everything is up to date. Type '$(MAKE) test' to run test suite."
 
@@ -1090,7 +1095,7 @@ esac
 
 $spitshell >>$Makefile <<'!NO!SUBS!'
 
-.PHONY: preplibrary
+.PHONY: preplibrary common_build
 preplibrary: $(MINIPERL_EXE) $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
 
 $(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD)
@@ -1109,7 +1114,7 @@ uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
 # $(PERL_EXE) and ext because pod_lib.pl needs Digest::MD5
 # But also this ensures that all extensions are built before we try to scan
 # them, which picks up Devel::PPPort's documentation.
-pod/perltoc.pod: $(perltoc_pod_prereqs)  $(PERL_EXE) $(ext) pod/buildtoc
+pod/perltoc.pod: $(perltoc_pod_prereqs) $(PERL_EXE) $(ext) pod/buildtoc
 	$(RUN_PERL) -f pod/buildtoc -q
 
 pod/perlapi.pod: pod/perlintern.pod
@@ -1153,6 +1158,21 @@ no_install no-install: install-notify
 install: install-all
 !NO!SUBS!
 
+if test "$storable_type" != "" ; then
+
+$spitshell >>$Makefile <<EOT
+
+dist/Storable/lib/Storable/Limit.pm : \$(PERL_EXE) dist/Storable/stacksize $storable_limit_dep
+	\$(RUN_PERL) dist/Storable/stacksize --core
+
+lib/Storable/Limit.pm : dist/Storable/lib/Storable/Limit.pm
+	test -d lib/Storable || mkdir lib/Storable
+	cp dist/Storable/lib/Storable/Limit.pm lib/Storable/Limit.pm
+EOT
+
+common_build_deps="$common_build_deps lib/Storable/Limit.pm"
+
+fi
 
 for name in all notify silent strip verbose; do
     flags="--$name";
@@ -1500,7 +1520,7 @@ test_prep_pre: preplibrary utilities $(nonxs_ext)
 case "$targethost" in
 '') $spitshell >>$Makefile <<'!NO!SUBS!'
 test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
-	$(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods)
+	$(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build
 	cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
 
 !NO!SUBS!
@@ -1508,7 +1528,7 @@ test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
 *) $spitshell >>$Makefile <<!GROK!THIS!
 test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE) \
 	\$(dynamic_ext) \$(TEST_PERL_DLL) runtests \
-	\$(generated_pods)
+	\$(generated_pods) common_build
 	$to libperl.*
 	$to t/*
 	$to lib/*
@@ -1643,6 +1663,17 @@ test_reonly test-reonly: test_prep_reonly
 test_porting test-porting: test_prep
 	cd t && $(RUN_PERL) harness porting/*.t ../lib/diagnostics.t
 
+!NO!SUBS!
+
+$spitshell>>$Makefile <<!GROK!THIS!
+
+# intended as a common way to add dependencies to test-prep and all
+common_build: $common_build_deps
+
+!GROK!THIS!
+
+$spitshell >>$Makefile <<'!NO!SUBS!'
+
 # Handy way to run perlbug -ok without having to install and run the
 # installed perlbug. We don't re-run the tests here - we trust the user.
 # Please *don't* use this unless all tests pass.
diff --git a/dist/.gitignore b/dist/.gitignore
index d8a22d5c8f..2120f50040 100644
--- a/dist/.gitignore
+++ b/dist/.gitignore
@@ -6,5 +6,6 @@ pm_to_blib
 Makefile
 Makefile.PL
 ppport.h
+Storable/lib/Storable/Limit.pm
 Time-HiRes/*.inc
 Time-HiRes/xdefine
diff --git a/dist/Storable/ChangeLog b/dist/Storable/ChangeLog
index c9748fd5d3..3f3076ac60 100644
--- a/dist/Storable/ChangeLog
+++ b/dist/Storable/ChangeLog
@@ -1,3 +1,186 @@
+2018-02-07 15:08:00 tonyc
+    Version 3.06
+
+        * support large object ids.  The code in theory supported arrays
+        with more than 2**32 elements, but references to the elements
+        emitted at the end of the array with be retrieved as references to
+        the wrong elements.
+        * 32-bit object ids over 2**31-1 weren't correctly handled.
+        * hook object id generation now supports 64-bit ids where needed
+        * writing 64-bit lengths in network order now works
+        * reading 64-bit lengths in network order now reads the components
+        in the correct order.
+        * retrieving large object tags are now only handled on 64-bit
+        platforms, large object tags should only be emitted for objects
+        that are too large for the 32-bit address space, so it was only
+        wasted code.
+        * reading 32-bit lengths for LSCALAR and LUTF8STR as unsigned
+        (perl #131990)
+        * reading flagged large object hashes didn't read the flags
+        * treat the 32-bit size of hook data as unsigned, values over 2GB
+        were treated as large (close to 2**64) parameters to NEWSV().
+        (perl #131999)
+        * added support for hook data over 4GB in size
+        * zero length data receievd from STORABLE_freeze() no longer
+        results in an invalid SV being passed to STORABLE_thaw/_attach()
+        (perl #118551)
+        * where practical, padding is now cleared when emitting a long
+        double (perl #131136)
+        * cache the value of $Storable::DEBUGME (since cperl enabled
+        Storable TRACEME builds for all -DDEBUGGING builds)
+        * no longer discard exceptions thrown by
+        STORABLE_freeze/_thaw/attach() (perl #25933)
+        * fix dependencies used to build Storable.pm from __Storable__.pm
+        * add experimental support for freezing/thawing regular
+        expressions (perl #50608)
+        * re-work recursion limiting to store the limit in a perl variable
+        instead of baked into Storable.$so.  This allows static Storable
+        builds to work, and avoids the kind of circular reference on
+        Storable.$so.
+
+2017-07-24 13:57:13 rurban
+    Version 3.05_13
+
+        * mingw fix: use safe defaults, not segfaulting defaults.
+        mingw fails on the stacksize binary search, leaving it empty.
+
+Wed Apr 19 09:11:07 2017 +0200 Reini Urban <rurban@cpan.org>
+    Version 3.05_12
+
+        * enhance stack reserve from 8 to 16
+        * fix LD_LIBRARY_PATH usage for CORE
+        * fixed some coverity warnings and leaks
+        * added a release make target
+
+Wed Mar 29 21:04:28 2017 +0200 Reini Urban <rurban@cpan.org>
+    Version 3.05_11
+
+        * croak on sizes read > I32_MAX
+        * simplify last_op_in_netorder
+        * protect from empty retrieve_vstring
+        * protect store_other error buf, potential static
+        buffer overflow.
+
+Tue Mar 14 09:52:20 2017 +0100 Reini Urban <rurban@cpan.org>
+    Version 3.05_10
+
+        * CORE-only improvements to stacksize
+
+Thu Mar 9 19:20:19 2017 +0100 Reini Urban <rurban@cpan.org>
+    Version 3.05_09
+
+        * compute the stacksizes, improve cleanup within croak
+        from stack exhaustion.
+        * added stack_depth and stack_depth_hash getters.
+
+Wed Mar  8 21:03:43 CET 2017 Reini Urban <rurban@cpan.org>
+    Version 3.05_08
+
+        * finetune the max stack limit, for C++, DEBUGGING and 32bit.
+        * fix t/blessed.t for cperl5.22
+
+Sun Mar 5 13:36:47 2017 +0100 Reini Urban <rurban@cpan.org>
+    Version 3.05_07
+
+        * Fixed a podchecker issue
+
+Sun Mar 5 11:42:04 2017 +0100 Reini Urban <rurban@cpan.org>
+    Version 3.05_06
+
+        * Fixed wrong recursion depth error with large arrays containing
+        another array.
+	L<[cperl #257]|https://github.com/perl11/cperl/issues/257>
+
+Thu Feb 2 12:40:44 2017 +0100 Reini Urban <rurban@cpanel.net>
+    Version 3.05_05
+
+        * Add leak tests for [cpan #97316], [perl #121928]
+        * Limit the max recursion depth to 1200 on 32bit systems.
+        We have no max_depth option yet, as in JSON::XS.
+
+Thu Feb 2 11:59:21 2017 +0100 Reini Urban <rurban@cpanel.net>
+    Version 3.05_04
+
+        * Fix retrieve_tied_array which fails since 5.16
+        [cpan #84705]
+        * Improve t/blessed.t in the creation of sv_yes/sv_no
+        with threaded perls.
+
+Tue Jan 31 02:55:30 2017 +0100 Reini Urban <rurban@cpanel.net>
+    Version 3.05_03
+
+        * Tune t/recurse.t stack-overflow limit more.
+
+Mon Jan 30 19:50:29 2017 +0100 Reini Urban <rurban@cpanel.net>
+    Version 3.05_02
+
+        * Tune t/recurse.t stack-overflow limit. Small 64bit systems overflow
+        even with depth 3000, where 32bit are ok.
+
+Mon Jan 30 15:13:38 2017 +0100 Reini Urban <rurban@cpanel.net>
+    Version 3.05_01
+
+        * Protect against stack overflows with nested arrays and hashes
+        [cpan #97526]. This imposes a new limit to your nested structures,
+        but JSON::XS has a limit of 512. We use a max_depth of 3000 for the
+        typical stack limit of 8k.
+
+
+Sun Jan 29 11:36:43 2017 +0100 Reini Urban <rurban@cpanel.net>
+    Version 3.05
+
+        * Protect against classname len overflow on the stack
+        and 2x on the heap with retrieve_bless and retrieve_hook.
+        A serious security issue with malcrafted storable files or buffers,
+        but p5p accepts no CVE on Storable attacks. See RT #130635
+        (reported by JD).
+        * Fix NULL ptr SEGVs with retrieve_code and retrieve_other.
+        See RT #130098 (reported and fixed by JD)
+        * Fix wrong huge LOBJECT support, broken since 3.00c.
+        Repro with `export PERL_TEST_MEMORY=8`
+        * Fix the few remaining 2-arg open calls.
+        * Portability and backport fixes back to 5.6.2
+
+Sat Jan 7 09:01:29 2017 +0100 Reini Urban <rurban@cpanel.net>
+    Version 3.04c
+
+        * fix printf types and warnings, esp. for 32bit use64bitint
+        * Change sv_setpvn(…, "…", …) to sv_setpvs(…, "…")
+
+Tue Jul 26 11:49:33 2016 +1000 Tony Cook <tony@develop-help.com>
+    Version 3.03c
+
+        * remove . from @INC when loading optional modules
+
+Sun Nov 20 18:06:45 2016 +0100 Reini Urban <rurban@cpanel.net>
+    Version 3.02c
+
+        * Fix -Wc++11-compat warnings, fix -Wchar-subscripts
+
+Fri Sep 16 01:32:59 2016 +0200 Reini Urban <rurban@cpanel.net>
+    Version 3.01c
+
+        * Added warn_security("Movable-Type CVE-2015-1592 Storable metasploit attack")
+          when detecting the third destructive metasploit vector,
+          thawing bless \"mt-config.cgi", "CGITempFile".
+
+Thu Mar 31 17:10:27 2016 +0200 Reini Urban <rurban@cpanel.net>
+    Version 3.00c
+
+        * Added support for u64 strings, arrays and hashes >2G
+          via a new LOBJECT tag. This is for 32bit systems and lengths
+          between 2GB and 4GB (I32-U32), and 64bit (>I32).
+        * Bumped STORABLE_BIN_MINOR and STORABLE_BIN_WRITE_MINOR from 10 to 11
+        * fix parallel tests, use unique filenames.
+        * fixed 2 instances of 2arg open,
+        * added optional flag arguments to skip tie and bless on retrieve/thaw,
+        * added SECURITY WARNING and Large data support to docs
+        * compute CAN_FLOCK at compile-time
+        * reformat everything consistently
+        * enable DEBUGME tracing and asserts with -DDEBUGGING
+        * fix all 64 bit compiler warnings
+        * added some abstraction methods to avoid code duplication
+
 ?????? p5p <perl5-porters@perl.org>
     Version 2.65
 
diff --git a/dist/Storable/Makefile.PL b/dist/Storable/Makefile.PL
index a1f0b703da..0878ce5c42 100644
--- a/dist/Storable/Makefile.PL
+++ b/dist/Storable/Makefile.PL
@@ -1,5 +1,6 @@
 #
 #  Copyright (c) 1995-2000, Raphael Manfredi
+#  Copyright (c) 2017, Reini Urban
 #  
 #  You may redistribute only under the same terms as Perl 5, as specified
 #  in the README file that comes with the distribution.
@@ -7,14 +8,29 @@
 
 use ExtUtils::MakeMaker;
 use Config;
+use File::Copy qw(move copy);
+
+my ($fn, $in) = ("stacksize.h", "stacksize_h.in");
+if (-f $fn) {
+    unlink $fn;
+    move $in, $fn;
+} else {
+    copy $in, $fn;
+}
+
+my $pm = { 'Storable.pm' => '$(INST_ARCHLIB)/Storable.pm' };
+unless ($ENV{PERL_CORE}) {
+    # the core Makefile takes care of this for core builds
+    $pm->{"lib/Storable/Limit.pm"} = '$(INST_ARCHLIB)/Storable/Limit.pm';
+}
 
 WriteMakefile(
     NAME                => 'Storable',
     DISTNAME            => "Storable",
 # We now ship this in t/
 #    PREREQ_PM           => { 'Test::More' => '0.41' },
-    PL_FILES        => { 'Storable.pm.PL'  => 'Storable.pm' },
-    PM              => { 'Storable.pm' => '$(INST_ARCHLIB)/Storable.pm' },
+    PL_FILES        => { }, # prevent default behaviour
+    PM              => $pm,
     PREREQ_PM           => { XSLoader => 0 },
     INSTALLDIRS => ($] >= 5.007 && $] < 5.012) ? 'perl' : 'site',
     VERSION_FROM    => '__Storable__.pm',
@@ -32,7 +48,7 @@ WriteMakefile(
                            },
     ) : ()),
     dist                => { SUFFIX => 'gz', COMPRESS => 'gzip -f' },
-    clean               => { FILES => 'Storable-* Storable.pm' },
+    clean               => { FILES => 'Storable-* Storable.pm lib/Storable/Limit.pm' },
 );
 
 # Unlink the .pm file included with the distribution
@@ -57,3 +73,54 @@ in the Storable documentation for instructions on how to read your data.
 
 EOM
 }
+
+# compute the maximum stacksize, before and after linking
+package MY;
+
+# FORCE finish of INST_DYNAMIC, avoid loading the old Storable (failed XS_VERSION check)
+sub xlinkext {
+    my $s = shift->SUPER::linkext(@_);
+    $s =~ s|( :: .*)| $1 FORCE stacksize|;
+    $s
+}
+
+sub depend {
+    my $extra_deps = "";
+    unless ($ENV{PERL_CORE}) {
+        # blib.pm needs arch/lib
+        $extra_deps = ' Storable.pm';
+    }
+    "
+lib/Storable/Limit.pm : \$(INST_DYNAMIC)$extra_deps
+	\$(MKPATH) \$(INST_LIB)
+	\$(PERLRUNINST) stacksize
+
+release : dist
+	git tag \$(VERSION)
+	cpan-upload \$(DISTVNAME).tar\$(SUFFIX)
+	git push
+	git push --tags
+"
+}
+
+sub test {
+    my ($self, %attr) = @_;
+
+    my $out = $self->SUPER::test(%attr);
+
+    if ($ENV{PERL_CORE}) {
+        $out =~ s!^(test(?:db)?_(?:static|dynamic)\b.*)!$1 lib/Storable/Limit.pm!gm;
+    }
+
+    $out;
+}
+
+sub postamble {
+'
+all :: Storable.pm
+	$(NOECHO) $(NOOP)
+
+Storable.pm :: Storable.pm.PL __Storable__.pm
+	$(PERLRUN) Storable.pm.PL
+'
+}
diff --git a/dist/Storable/README b/dist/Storable/README
index 247dcc245a..f63ace9434 100644
--- a/dist/Storable/README
+++ b/dist/Storable/README
@@ -1,6 +1,7 @@
-                         Storable 2.14
+                         Storable 3.05c
                Copyright (c) 1995-2000, Raphael Manfredi
                Copyright (c) 2001-2004, Larry Wall
+               Copyright (c) 2016,2017 cPanel Inc
 
 ------------------------------------------------------------------------
     This program is free software; you can redistribute it and/or modify
@@ -15,8 +16,8 @@
 +=======================================================================
 | Storable is distributed as a module, but is also part of the official
 | Perl core distribution, as of perl 5.8. 
-| Maintenance is now done by the perl5-porters.  We thank Raphael
-| Manfredi for providing us with this very useful module.
+| Maintenance is partially done by the perl5-porters, and for cperl by cPanel.
+| We thank Raphael Manfredi for providing us with this very useful module.
 +=======================================================================
 
 The Storable extension brings persistence to your data.
@@ -47,7 +48,10 @@ To compile this extension, run:
 There is an embedded POD manual page in Storable.pm.
 
 Storable was written by Raphael Manfredi <Raphael_Manfredi@pobox.com>
-Maintenance is now done by the perl5-porters <perl5-porters@perl.org>
+Maintenance is now done by cperl, https://github.com/rurban/Storable/
+Note that p5p still ships an old broken version, without stack overflow
+protection and large object support. As long as you don't store overlarge
+objects, they are compatible.
 
 Please e-mail us with problems, bug fixes, comments and complaints,
 although if you have complements you should send them to Raphael.
@@ -68,6 +72,10 @@ Thanks to (in chronological order):
     Marc Lehmann <pcg@opengroup.org>
     Justin Banks <justinb@wamnet.com>
     Jarkko Hietaniemi <jhi@iki.fi> (AGAIN, as perl 5.7.0 Pumpkin!)
+    Todd Rinaldo <toddr@cpanel.net> and JD Lightsey <jd@cpanel.net>
+      for optional disabling tie and bless for increased security.
+    Reini Urban <rurban@cpanel.net> for the 3.0x >2G support and rewrite
+    JD Lightsey <jd@cpanel.net>
 
 for their contributions.
 
@@ -104,6 +112,3 @@ bring you this Storable release:
     Tim Bunce <Tim.Bunce@pobox.com>
     VMSperlers
     Yitzchak Scott-Thoennes <sthoenna@efn.org>
-
-If I've missed you out, please accept my apologies, and e-mail your
-patch to perl5-porters@perl.org.
diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index dcd24e7bdc..df0c433b0e 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -1,8 +1,11 @@
-/*
- *  Store and retrieve mechanism.
+/* -*-  c-basic-offset: 4 -*-
+ *
+ *  Fast store and retrieve mechanism.
  *
  *  Copyright (c) 1995-2000, Raphael Manfredi
- *  
+ *  Copyright (c) 2016, 2017 cPanel Inc
+ *  Copyright (c) 2017 Reini Urban
+ *
  *  You may redistribute only under the same terms as Perl 5, as specified
  *  in the README file that comes with the distribution.
  *
@@ -18,6 +21,8 @@
 #endif
 
 #if !defined(PERL_VERSION) || PERL_VERSION < 10 || (PERL_VERSION == 10 && PERL_SUBVERSION < 1)
+#define NEED_PL_parser
+#define NEED_sv_2pv_flags
 #define NEED_load_module
 #define NEED_vload_module
 #define NEED_newCONSTSUB
@@ -26,7 +31,7 @@
 #include "ppport.h"             /* handle old perls */
 #endif
 
-#if 0
+#ifdef DEBUGGING
 #define DEBUGME /* Debug mode, turns assertions on as well */
 #define DASSERT /* Assertion mode */
 #endif
@@ -67,19 +72,23 @@
 #endif
 
 #ifndef HvRITER_get
-#  define HvRITER_get HvRITER
+#  define HvRITER_get           HvRITER
 #endif
 #ifndef HvEITER_get
-#  define HvEITER_get HvEITER
+#  define HvEITER_get           HvEITER
 #endif
 
 #ifndef HvPLACEHOLDERS_get
-#  define HvPLACEHOLDERS_get HvPLACEHOLDERS
+#  define HvPLACEHOLDERS_get    HvPLACEHOLDERS
 #endif
 
 #ifndef HvTOTALKEYS
 #  define HvTOTALKEYS(hv)	HvKEYS(hv)
 #endif
+/* 5.6 */
+#ifndef HvUSEDKEYS
+#  define HvUSEDKEYS(hv)	HvKEYS(hv)
+#endif
 
 #ifdef SVf_IsCOW
 #  define SvTRULYREADONLY(sv)	SvREADONLY(sv)
@@ -88,7 +97,11 @@
 #endif
 
 #ifndef SvPVCLEAR
-#  define SvPVCLEAR(sv) sv_setpvs((sv), "")
+#  define SvPVCLEAR(sv) sv_setpvs(sv, "")
+#endif
+
+#ifndef strEQc
+#  define strEQc(s,c) memEQ(s, ("" c ""), sizeof(c))
 #endif
 
 #ifdef DEBUGME
@@ -98,27 +111,46 @@
 #endif
 
 /*
- * TRACEME() will only output things when the $Storable::DEBUGME is true.
+ * TRACEME() will only output things when the $Storable::DEBUGME is true,
+ * using the value traceme cached in the context.
+ *
+ *
+ * TRACEMED() directly looks at the variable, for use before traceme has been
+ * updated.
  */
 
-#define TRACEME(x)										\
-  STMT_START {											\
-	if (SvTRUE(perl_get_sv("Storable::DEBUGME", GV_ADD)))	\
-		{ PerlIO_stdoutf x; PerlIO_stdoutf("\n"); }		\
-  } STMT_END
+#define TRACEME(x)                                            \
+    STMT_START {					      \
+        if (cxt->traceme)				      \
+            { PerlIO_stdoutf x; PerlIO_stdoutf("\n"); }       \
+    } STMT_END
+
+#define TRACEMED(x)                                           \
+    STMT_START {                                              \
+        if (SvTRUE(get_sv("Storable::DEBUGME", GV_ADD)))      \
+            { PerlIO_stdoutf x; PerlIO_stdoutf("\n"); }       \
+    } STMT_END
+
+#define INIT_TRACEME							\
+    STMT_START {							\
+	cxt->traceme = SvTRUE(get_sv("Storable::DEBUGME", GV_ADD));	\
+    } STMT_END
+
 #else
 #define TRACEME(x)
+#define TRACEMED(x)
+#define INIT_TRACEME
 #endif	/* DEBUGME */
 
 #ifdef DASSERT
-#define ASSERT(x,y)										\
-  STMT_START {											\
-	if (!(x)) {												\
-		PerlIO_stdoutf("ASSERT FAILED (\"%s\", line %d): ",	\
-			__FILE__, __LINE__);							\
-		PerlIO_stdoutf y; PerlIO_stdoutf("\n");				\
-	}														\
-  } STMT_END
+#define ASSERT(x,y)                                              \
+    STMT_START {                                                 \
+        if (!(x)) {                                              \
+            PerlIO_stdoutf("ASSERT FAILED (\"%s\", line %d): ",  \
+                           __FILE__, (int)__LINE__);             \
+            PerlIO_stdoutf y; PerlIO_stdoutf("\n");              \
+        }                                                        \
+    } STMT_END
 #else
 #define ASSERT(x,y)
 #endif
@@ -161,39 +193,41 @@
 #define SX_VSTRING	C(29)	/* vstring forthcoming (small) */
 #define SX_LVSTRING	C(30)	/* vstring forthcoming (large) */
 #define SX_SVUNDEF_ELEM	C(31)	/* array element set to &PL_sv_undef */
-#define SX_ERROR	C(32)	/* Error */
+#define SX_REGEXP	C(32)	/* Regexp */
+#define SX_LOBJECT	C(33)	/* Large object: string, array or hash (size >2G) */
+#define SX_LAST		C(34)	/* invalid. marker only */
 
 /*
  * Those are only used to retrieve "old" pre-0.6 binary images.
  */
-#define SX_ITEM		'i'		/* An array item introducer */
-#define SX_IT_UNDEF	'I'		/* Undefined array item */
-#define SX_KEY		'k'		/* A hash key introducer */
-#define SX_VALUE	'v'		/* A hash value introducer */
-#define SX_VL_UNDEF	'V'		/* Undefined hash value */
+#define SX_ITEM		'i'	/* An array item introducer */
+#define SX_IT_UNDEF	'I'	/* Undefined array item */
+#define SX_KEY		'k'	/* A hash key introducer */
+#define SX_VALUE	'v'	/* A hash value introducer */
+#define SX_VL_UNDEF	'V'	/* Undefined hash value */
 
 /*
  * Those are only used to retrieve "old" pre-0.7 binary images
  */
 
-#define SX_CLASS	'b'		/* Object is blessed, class name length <255 */
-#define SX_LG_CLASS	'B'		/* Object is blessed, class name length >255 */
-#define SX_STORED	'X'		/* End of object */
+#define SX_CLASS	'b'	/* Object is blessed, class name length <255 */
+#define SX_LG_CLASS	'B'	/* Object is blessed, class name length >255 */
+#define SX_STORED	'X'	/* End of object */
 
 /*
  * Limits between short/long length representation.
  */
 
-#define LG_SCALAR	255		/* Large scalar length limit */
-#define LG_BLESS	127		/* Large classname bless limit */
+#define LG_SCALAR	255	/* Large scalar length limit */
+#define LG_BLESS	127	/* Large classname bless limit */
 
 /*
  * Operation types
  */
 
-#define ST_STORE	0x1		/* Store operation */
-#define ST_RETRIEVE	0x2		/* Retrieval operation */
-#define ST_CLONE	0x4		/* Deep cloning operation */
+#define ST_STORE	0x1	/* Store operation */
+#define ST_RETRIEVE	0x2	/* Retrieval operation */
+#define ST_CLONE	0x4	/* Deep cloning operation */
 
 /*
  * The following structure is used for hash table key retrieval. Since, when
@@ -207,10 +241,10 @@
  * is required. Hence the aptr pointer.
  */
 struct extendable {
-	char *arena;		/* Will hold hash key strings, resized as needed */
-	STRLEN asiz;		/* Size of aforementioned buffer */
-	char *aptr;			/* Arena pointer, for in-place read/write ops */
-	char *aend;			/* First invalid address */
+    char *arena;	/* Will hold hash key strings, resized as needed */
+    STRLEN asiz;	/* Size of aforementioned buffer */
+    char *aptr;		/* Arena pointer, for in-place read/write ops */
+    char *aend;		/* First invalid address */
 };
 
 /*
@@ -231,6 +265,19 @@ struct extendable {
 
 typedef unsigned long stag_t;	/* Used by pre-0.6 binary format */
 
+/*
+ * Make the tag type 64-bit on 64-bit platforms.
+ *
+ * If the tag number is low enough it's stored as a 32-bit value, but
+ * with very large arrays and hashes it's possible to go over 2**32
+ * scalars.
+ */
+
+typedef STRLEN ntag_t;
+
+/* used for where_is_undef - marks an unset value */
+#define UNSET_NTAG_T (~(ntag_t)0)
+
 /*
  * The following "thread-safe" related defines were contributed by
  * Murray Nesbitt <murray@activestate.com> and integrated by RAM, who
@@ -291,6 +338,34 @@ typedef unsigned long stag_t;	/* Used by pre-0.6 binary format */
 #define USE_PTR_TABLE
 #endif
 
+/* do we need/want to clear padding on NVs? */
+#if defined(LONG_DOUBLEKIND) && defined(USE_LONG_DOUBLE)
+#  if LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN || \
+      LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN
+#    define NV_PADDING (NVSIZE - 10)
... 14197 lines suppressed ...

-- 
Perl5 Master Repository

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About