[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.5-190-g0899e13b81

2017-11-22 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/0899e13b811b52f2fe97d08c5266a40902c1a309?hp=f312f2979eda7c1d079d420eb28669cf63b45a26>

- Log -
commit 0899e13b811b52f2fe97d08c5266a40902c1a309
Author: Tony Cook 
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 0a43d538d71254cf9882925d7d76c25d794e5d7f
Author: Tony Cook 
Date:   Wed Nov 22 05:07:05 2017 +0100

fix the test count I broke in Storable/t/huge.t

commit a1bfdbad3f294b08c11d2624f0f3915ab95d8b88
Author: Tony Cook 
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 9110438d719f97922a98b9f67f75d539f6dbbd34
Author: Tony Cook 
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 15e55730d5cc55e6b4da2a740290dfd153dc5a3d
Author: Tony Cook 
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 105985c4bd3294ed741d07d37567a25a6e99f063
Author: Tony Cook 
Date:   Tue Nov 21 05:12:16 2017 +0100

(perl #127743) fix some -DDEBUGGING build issues

---

Summary of changes:
 dist/Storable/Storable.xs | 85 +--
 dist/Storable/t/huge.t|  2 +-
 dist/Storable/t/hugeids.t | 39 +++---
 3 files changed, 88 insertions(+), 38 deletions(-)

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index 9e0ed7aaff..900894ebfc 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -1028,13 +1028,13 @@ static const char byteorderstr_56[] = 
{BYTEORDER_BYTES_56, 0};
 STMT_START {   \
 ASSERT(sizeof(x) == 8, ("W64LEN writing a U64"));   \
 if (cxt->netorder) {\
-union u64_t { U32 a; U32 b; } y;\
-y.b = htonl(x & 0xUL);\
-y.a = htonl(x >> 32);   \
+U32 buf[2];\
+buf[1] = htonl(x & 0xUL);   \
+buf[0] = htonl(x >> 32);\
 if (!cxt->fio)  \
-MBUF_PUTLONG(y);\
-else if (PerlIO_write(cxt->fio,oI(&y),  \
-  oS(sizeof(y))) != oS(sizeof(y)))  \
+MBUF_PUTLONG(buf);  \
+else if (PerlIO_write(cxt->fio, buf,\
+  sizeof(buf)) != sizeof(buf))  \
 return -1;  \
 } else {\
 if (!cxt->fio)  \
@@ -1167,19 +1167,34 @@ static const char byteorderstr_56[] = 
{BYTEORDER_BYTES_56, 0};
 }   \
 } STMT_END
 
-#define READ_U64(x)   \
+#ifdef HAS_U64
+
+#  if defined(HAS_NTOHL)
+#define Sntohl(x) ntohl(x)
+#  elif BYTEORDER == 0x87654321 || BYTEORDER == 0x4321
+#define Sntohl(x) (x)
+#  else
+static U32 Sntohl(U32 x) {
+return ((x & 0xFF) << 24) + ((x * 0xFF00) << 8)
+   + ((x & 0xFF) >> 8) + ((x & 0xFF00) >>

[perl.git] branch tonyc/127743-cperl-storable-fixes deleted. v5.27.5-190-g0899e13b81

2017-11-22 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been deleted



   was  0899e13b811b52f2fe97d08c5266a40902c1a309

- Log -
0899e13b811b52f2fe97d08c5266a40902c1a309 (perl #127743) read the hash's flags 
for large SX_FLAG_HASH ops
---

-- 
Perl5 Master Repository


[perl.git] branch tonyc/127743-cperl-storable-fixes created. v5.27.6-80-g6a90b60ea9

2017-11-22 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been created

<https://perl5.git.perl.org/perl.git/commitdiff/6a90b60ea989e9e529eb46e73903f321c47d8458?hp=>

at  6a90b60ea989e9e529eb46e73903f321c47d8458 (commit)

- Log -
commit 6a90b60ea989e9e529eb46e73903f321c47d8458
Author: Tony Cook 
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 053646a3b568cac2d90e04afd11aa61605e598e3
Author: Tony Cook 
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 95cf28e9c44346bd4275ac74cad761b74c05533e
Author: Tony Cook 
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 e66d28554ee5ae935a4efba8644774350d90e470
Author: Tony Cook 
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 7aa8439cbc3b78cdbc2f5fbb53122fac9aa103c0
Author: Tony Cook 
Date:   Tue Nov 21 05:12:16 2017 +0100

(perl #127743) fix some -DDEBUGGING build issues

commit a56a37f47a3712d56d868388135c4b97ed45c72f
Author: Tony Cook 
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 19b370e7c8e499f8f74869919f1cb533a44966e6
Author: Tony Cook 
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
 

[perl.git] branch tonyc/132506-renameat-unimplemented-netbsd created. v5.27.6-59-g24033c0ee7

2017-11-29 Thread Tony Cook
In perl.git, the branch tonyc/132506-renameat-unimplemented-netbsd has been 
created

<https://perl5.git.perl.org/perl.git/commitdiff/24033c0ee7d77540fdd786f1cd89cd2e1cff37a7?hp=>

at  24033c0ee7d77540fdd786f1cd89cd2e1cff37a7 (commit)

- Log -
commit 24033c0ee7d77540fdd786f1cd89cd2e1cff37a7
Author: Tony Cook 
Date:   Fri Dec 1 01:05:07 2017 +1100

(perl #132506) deal with un-/partly implemented *at() functions

NetBSD 6 provides renameat() etc in it's libc, but in the cases where
we use them they fail with ENOSYS.

So I've modified the in-place edit clean up code to attempt to
fallback to the non-at versions of these functions, after checking
that the current directory is sane.

Once I was sure that worked, since the *at() functions don't work for
my use case on NetBSD 6, I've disabled them in hints.

---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-89-g184f90dc41

2017-11-29 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/184f90dc410cf3e66a5e682337ae54b3c9f9311f?hp=5f7616bdb343ddcfb39747caa700dcc75c2e2b66>

- Log -
commit 184f90dc410cf3e66a5e682337ae54b3c9f9311f
Author: Tony Cook 
Date:   Fri Dec 1 01:05:07 2017 +1100

(perl #132506) deal with un-/partly implemented *at() functions

NetBSD 6 provides renameat() etc in it's libc, but in the cases where
we use them they fail with ENOSYS.

So I've modified the in-place edit clean up code to attempt to
fallback to the non-at versions of these functions, after checking
that the current directory is sane.

Once I was sure that worked, since the *at() functions don't work for
my use case on NetBSD 6, I've disabled them in hints.

---

Summary of changes:
 doio.c   | 155 +++
 hints/netbsd.sh  |  11 
 t/run/switches.t |   5 +-
 3 files changed, 115 insertions(+), 56 deletions(-)

diff --git a/doio.c b/doio.c
index a99b2c9cb7..f15005d299 100644
--- a/doio.c
+++ b/doio.c
@@ -877,10 +877,8 @@ S_openindirtemp(pTHX_ GV *gv, SV *orig_name, SV 
*temp_out_name) {
 /* Win32 doesn't necessarily return useful information
  * in st_dev, st_ino.
  */
-#ifndef ARGV_USE_ATFUNCTIONS
-#  ifndef DOSISH
-#define ARGV_USE_STAT_INO
-#  endif
+#ifndef DOSISH
+#  define ARGV_USE_STAT_INO
 #endif
 
 #define ARGVMG_BACKUP_NAME 0
@@ -889,21 +887,32 @@ S_openindirtemp(pTHX_ GV *gv, SV *orig_name, SV 
*temp_out_name) {
 #define ARGVMG_ORIG_MODE 3
 #define ARGVMG_ORIG_PID 4
 
-#if defined(ARGV_USE_ATFUNCTIONS)
-#define ARGVMG_ORIG_DIRP 5
-#elif defined(ARGV_USE_STAT_INO)
 /* we store the entire stat_t since the ino_t and dev_t values might
not fit in an IV.  I could have created a new structure and
transferred them across, but this seemed too much effort for very
little win.
+
+   We store it even when the *at() functions are available, since
+   while the C runtime might have definitions for these functions, the
+   operating system or a specific filesystem might not implement them.
+   eg. NetBSD 6 implements linkat() but only where the fds are AT_FDCWD.
  */
-#define ARGVMG_ORIG_CWD_STAT 5
+#ifdef ARGV_USE_STAT_INO
+#  define ARGVMG_ORIG_CWD_STAT 5
+#endif
+
+#ifdef ARGV_USE_ATFUNCTIONS
+#  define ARGVMG_ORIG_DIRP 6
+#endif
+
+#ifdef ENOTSUP
+#define NotSupported(e) ((e) == ENOSYS || (e) == ENOTSUP)
+#else
+#define NotSupported(e) ((e) == ENOSYS)
 #endif
 
 static int
 S_argvout_free(pTHX_ SV *io, MAGIC *mg) {
-SV **temp_psv;
-
 PERL_UNUSED_ARG(io);
 
 /* note this can be entered once the file has been
@@ -930,20 +939,24 @@ S_argvout_free(pTHX_ SV *io, MAGIC *mg) {
 /* if we get here the file hasn't been closed explicitly by the
user and hadn't been closed implicitly by nextargv(), so
abandon the edit */
+SV **temp_psv = av_fetch((AV*)mg->mg_obj, ARGVMG_TEMP_NAME, FALSE);
+const char *temp_pv = SvPVX(*temp_psv);
+
+assert(temp_psv && *temp_psv && SvPOK(*temp_psv));
 (void)PerlIO_close(iop);
 IoIFP(io) = IoOFP(io) = NULL;
-temp_psv = av_fetch((AV*)mg->mg_obj, ARGVMG_TEMP_NAME, FALSE);
-assert(temp_psv && *temp_psv && SvPOK(*temp_psv));
 #ifdef ARGV_USE_ATFUNCTIONS
 dir_psv = av_fetch((AV*)mg->mg_obj, ARGVMG_ORIG_DIRP, FALSE);
 assert(dir_psv && *dir_psv && SvIOK(*dir_psv));
 dir = INT2PTR(DIR *, SvIV(*dir_psv));
 if (dir) {
-(void)unlinkat(my_dirfd(dir), SvPVX(*temp_psv), 0);
+if (unlinkat(my_dirfd(dir), temp_pv, 0) < 0 &&
+NotSupported(errno))
+(void)UNLINK(temp_pv);
 closedir(dir);
 }
 #else
-(void)UNLINK(SvPVX(*temp_psv));
+(void)UNLINK(temp_pv);
 #endif
 }
 }
@@ -970,8 +983,11 @@ S_argvout_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *param) {
4: pid of the process we opened at, to prevent doing the renaming
   etc in both the child and the parent after a fork
 
+If we have useful inode/device ids in stat_t we also keep:
+   5: a stat of the original current working directory
+
 If we have unlinkat(), renameat(), fchmodat(), dirfd() we also keep:
-   5: the DIR * for the current directory when we open the file, stored as an 
IV
+   6: the DIR * for the current directory when we open the file, stored as an 
IV
  */
 
 static const MGVTBL argvout_vtbl =
@@ -1220,6 +1236,48 @@ S_my_renameat(int olddfd, const char *oldpath, int 
newdfd, const char *newpath)
 #  endif /* if defined(__FreeBSD__) */
 #endif
 
+static bool
+S_dir_unchanged(pTHX_

[perl.git] branch blead updated. v5.27.6-90-g848643a918

2017-11-29 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/848643a91802503d27202eb4d302cef07435275e?hp=184f90dc410cf3e66a5e682337ae54b3c9f9311f>

- Log -
commit 848643a91802503d27202eb4d302cef07435275e
Author: Tony Cook 
Date:   Thu Nov 30 15:15:26 2017 +1100

(perl #132506) remove an unneeded argument

---

Summary of changes:
 doio.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/doio.c b/doio.c
index f15005d299..565f896c01 100644
--- a/doio.c
+++ b/doio.c
@@ -1237,7 +1237,7 @@ S_my_renameat(int olddfd, const char *oldpath, int 
newdfd, const char *newpath)
 #endif
 
 static bool
-S_dir_unchanged(pTHX_ const char *orig_pv, MAGIC *mg, bool is_explicit) {
+S_dir_unchanged(pTHX_ const char *orig_pv, MAGIC *mg) {
 Stat_t statbuf;
 
 #ifdef ARGV_USE_STAT_INO
@@ -1275,8 +1275,8 @@ S_dir_unchanged(pTHX_ const char *orig_pv, MAGIC *mg, 
bool is_explicit) {
 return TRUE;
 }
 
-#define dir_unchanged(orig_psv, mg, is_explicit) \
-S_dir_unchanged(aTHX_ (orig_psv), (mg), (is_explicit))
+#define dir_unchanged(orig_psv, mg) \
+S_dir_unchanged(aTHX_ (orig_psv), (mg))
 
 /* explicit renamed to avoid C++ conflict-- kja */
 bool
@@ -1360,7 +1360,7 @@ Perl_do_close(pTHX_ GV *gv, bool not_implicit)
 }
 #endif
 #ifndef ARGV_USE_ATFUNCTIONS
-if (!dir_unchanged(orig_pv, mg, not_implicit))
+if (!dir_unchanged(orig_pv, mg))
 goto abort_inplace;
 #endif
 if (back_psv && *back_psv) {
@@ -1369,7 +1369,7 @@ Perl_do_close(pTHX_ GV *gv, bool not_implicit)
 #  ifdef ARGV_USE_ATFUNCTIONS
 linkat(dfd, orig_pv, dfd, SvPVX(*back_psv), 0) < 0 &&
 !(UNLIKELY(NotSupported(errno)) &&
-  dir_unchanged(orig_pv, mg, not_implicit) &&
+  dir_unchanged(orig_pv, mg) &&
link(orig_pv, SvPVX(*back_psv)) == 0)
 #  else
 link(orig_pv, SvPVX(*back_psv)) < 0
@@ -1382,7 +1382,7 @@ Perl_do_close(pTHX_ GV *gv, bool not_implicit)
 #  ifdef ARGV_USE_ATFUNCTIONS
 S_my_renameat(dfd, orig_pv, dfd, SvPVX(*back_psv)) < 0 
&&
 !(UNLIKELY(NotSupported(errno)) &&
-  dir_unchanged(orig_pv, mg, not_implicit) &&
+  dir_unchanged(orig_pv, mg) &&
   PerlLIO_rename(orig_pv, SvPVX(*back_psv)) == 0)
 #  else
 PerlLIO_rename(orig_pv, SvPVX(*back_psv)) < 0
@@ -1392,7 +1392,7 @@ Perl_do_close(pTHX_ GV *gv, bool not_implicit)
 #  ifdef ARGV_USE_ATFUNCTIONS
 if (unlinkat(dfd, SvPVX_const(*temp_psv), 0) < 0 &&
 UNLIKELY(NotSupported(errno)) &&
-dir_unchanged(orig_pv, mg, not_implicit))
+dir_unchanged(orig_pv, mg))
 (void)UNLINK(SvPVX_const(*temp_psv));
 #  else
 UNLINK(SvPVX(*temp_psv));
@@ -1429,7 +1429,7 @@ Perl_do_close(pTHX_ GV *gv, bool not_implicit)
 #elif defined(ARGV_USE_ATFUNCTIONS)
S_my_renameat(dfd, SvPVX(*temp_psv), dfd, orig_pv) < 0 &&
 !(UNLIKELY(NotSupported(errno)) &&
-  dir_unchanged(orig_pv, mg, not_implicit) &&
+  dir_unchanged(orig_pv, mg) &&
   PerlLIO_rename(SvPVX(*temp_psv), orig_pv) == 0)
 #else
 PerlLIO_rename(SvPVX(*temp_psv), orig_pv) < 0

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-107-g3c67ad9b9e

2017-11-30 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3c67ad9b9e6d659feb76f3acfc9f81cfe59e3660?hp=7b9d2ba3d09352167d77ea97c7857509f147ef49>

- Log -
commit 3c67ad9b9e6d659feb76f3acfc9f81cfe59e3660
Author: Tony Cook 
Date:   Fri Dec 1 14:36:52 2017 +1100

(perl #132506) finish the correction to dir_unchanged()

and adjust the error message for renaming the work file

---

Summary of changes:
 doio.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/doio.c b/doio.c
index 9f76c10ea4..9b713e1507 100644
--- a/doio.c
+++ b/doio.c
@@ -1266,7 +1266,7 @@ S_dir_unchanged(pTHX_ const char *orig_pv, MAGIC *mg) {
 */
 if (!PERL_FILE_IS_ABSOLUTE(orig_pv)
 && PerlLIO_stat(SvPVX(*temp_psv), &statbuf) < 0) {
-Perl_croak(aTHX_ "Cannot complete in-place edit of %" SVf ": %s",
+Perl_croak(aTHX_ "Cannot complete in-place edit of %s: %s",
orig_pv,
"Work file is missing - did you change directory?");
 }
@@ -1443,8 +1443,9 @@ Perl_do_close(pTHX_ GV *gv, bool not_implicit)
 #else
 UNLINK(SvPVX(*temp_psv));
 #endif
-Perl_croak(aTHX_ "Can't rename in-place work file '%s' to 
'%s': %s\n",
-   SvPVX(*temp_psv), SvPVX(*orig_psv), 
Strerror(errno));
+/* diag_listed_as: Cannot complete in-place edit of %s: %s 
*/
+Perl_croak(aTHX_ "Cannot complete in-place edit of %s: 
failed to rename work file '%s' to '%s': %s",
+   orig_pv, SvPVX(*temp_psv), orig_pv, 
Strerror(errno));
 }
 abort_inplace:
 UNLINK(SvPVX_const(*temp_psv));

-- 
Perl5 Master Repository


[perl.git] branch tonyc/127743-cperl-storable-fixes deleted. v5.27.6-80-g6a90b60ea9

2017-12-03 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been deleted



   was  6a90b60ea989e9e529eb46e73903f321c47d8458

- Log -
6a90b60ea989e9e529eb46e73903f321c47d8458 (perl #127743) read the hash's flags 
for large SX_FLAG_HASH ops
---

-- 
Perl5 Master Repository


[perl.git] branch tonyc/127743-cperl-storable-fixes created. v5.27.6-171-gbcaac9000a

2017-12-03 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been created

<https://perl5.git.perl.org/perl.git/commitdiff/bcaac9000a0dd41b5737b733c4321f0871af64c4?hp=>

at  bcaac9000a0dd41b5737b733c4321f0871af64c4 (commit)

- Log -
commit bcaac9000a0dd41b5737b733c4321f0871af64c4
Author: Tony Cook 
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 5d90b9482f0c633f8e8bbcb4dffc923220b51343
Author: Tony Cook 
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 d41a4567e14a95e33d6dab14b204dafa9e404c39
Author: Tony Cook 
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 834d02519a14daf598cb73f41e3b49ba5d338387
Author: Tony Cook 
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 118fcabaceb652d6b8465322062159f0a06ec988
Author: Tony Cook 
Date:   Tue Nov 21 05:12:16 2017 +0100

(perl #127743) fix some -DDEBUGGING build issues

commit 4945f944782f8bebfcbc94e957bd16756021eb45
Author: Tony Cook 
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 4ccd13254fc85764d4ed434811d6933dba4df6b1
Author: Tony Cook 
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
 

[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.6-173-g06682a00b1

2017-12-03 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/06682a00b1b33d7ae62d117ac156ce40ac144202?hp=bcaac9000a0dd41b5737b733c4321f0871af64c4>

- Log -
commit 06682a00b1b33d7ae62d117ac156ce40ac144202
Author: Tony Cook 
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 93f5f3fe1302b2c8415a1912e1c807566d87595d
Author: Tony Cook 
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

---

Summary of changes:
 dist/Storable/Storable.xs | 34 +-
 1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index 900894ebfc..f10780fc7f 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -256,6 +256,9 @@ typedef unsigned long stag_t;   /* Used by pre-0.6 
binary format */
 
 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  and integrated by RAM, who
@@ -317,7 +320,7 @@ typedef STRLEN ntag_t;
 #endif
 
 /* Needed for 32bit with lengths > 2G - 4G, and 64bit */
-#if UVSIZE > 4
+#if PTRSIZE > 4
 #define HAS_U64
 #endif
 
@@ -343,7 +346,7 @@ typedef struct stcxt {
 HV *hseen;
 AV *hook_seen; /* which SVs were returned by STORABLE_freeze() 
*/
 AV *aseen; /* which objects have been seen, retrieve time 
*/
-IV where_is_undef; /* index in aseen of PL_sv_undef */
+ntag_t where_is_undef; /* index in aseen of PL_sv_undef */
 HV *hclass;/* which classnames have been seen, 
store time */
 AV *aclass;/* which classnames have been seen, 
retrieve time */
 HV *hook;  /* cache for hook methods per class name */
@@ -1024,6 +1027,9 @@ static const char byteorderstr_56[] = 
{BYTEORDER_BYTES_56, 0};
 return -1;  \
 }   \
 } STMT_END
+
+#  ifdef HAS_U64
+
 #define W64LEN(x)  \
 STMT_START {   \
 ASSERT(sizeof(x) == 8, ("W64LEN writing a U64"));   \
@@ -1044,6 +1050,13 @@ static const char byteorderstr_56[] = 
{BYTEORDER_BYTES_56, 0};
 return -1;  \
 }   \
 } STMT_END
+
+#  else
+
+#define W64LEN(x) CROAK(("No 64bit UVs"))
+
+#  endif
+
 #else
 #define WLEN(x)WRITE_I32(x)
 #ifdef HAS_U64
@@ -1369,8 +1382,8 @@ static SV *retrieve_lobject(pTHX_ stcxt_t *cxt, const 
char *cname);
 /* helpers for U64 lobjects */
 
 static SV *get_lstring(pTHX_ stcxt_t *cxt, UV len, int isutf8, const char 
*cname);
-static SV *get_larray(pTHX_ stcxt_t *cxt, UV len, const char *cname);
 #ifdef HAS_U64
+static SV *get_larray(pTHX_ stcxt_t *cxt, UV len, const char *cname);
 static SV *get_lhash(pTHX_ stcxt_t *cxt, UV len, int hash_flags, const char 
*cname);
 static int store_lhash(pTHX_ stcxt_t *cxt, HV *hv, unsigned char hash_flags);
 #endif
@@ -1734,7 +1747,7 @@ static void init_retrieve_context(pTHX_
   ? newHV() : 0);
 
 cxt->aseen = newAV();  /* Where retrieved objects are kept */
-cxt->where_is_undef = -1;  /* Special case for PL_sv_undef */
+cxt->where_is_undef = UNSET_NTAG_T;/* Special case for PL_sv_undef 
*/
 cxt->aclass = newAV(); /* Where seen classnames are kept */
 cxt->tagnum = 0;   /* Have to count objects... */
 cxt->classnum = 0; /* ...and class names as well */
@@ -1768,7 +1781,7 @@ static void clean_retrieve_context(pTHX_ stcxt_t *cxt)
 av_undef(aseen);
 sv_free((SV *) aseen);
 }
-cxt->where_is_undef = -1;
+cxt->where_is_undef = UNSET_NTAG_T;
 
 if (cx

[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.6-174-g862c79b288

2017-12-03 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/862c79b288b39ec55970c5a0d601f38a6e0a33c5?hp=06682a00b1b33d7ae62d117ac156ce40ac144202>

- Log -
commit 862c79b288b39ec55970c5a0d601f38a6e0a33c5
Author: Tony Cook 
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.

---

Summary of changes:
 dist/Storable/Storable.xs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index f10780fc7f..29d4c79963 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -5607,7 +5607,7 @@ static SV *get_lstring(pTHX_ stcxt_t *cxt, UV len, int 
isutf8, const char *cname
  */
 static SV *retrieve_lscalar(pTHX_ stcxt_t *cxt, const char *cname)
 {
-I32 len;
+U32 len;
 RLEN(len);
 return get_lstring(aTHX_ cxt, len, 0, cname);
 }
@@ -5656,7 +5656,7 @@ static SV *retrieve_utf8str(pTHX_ stcxt_t *cxt, const 
char *cname)
  */
 static SV *retrieve_lutf8str(pTHX_ stcxt_t *cxt, const char *cname)
 {
-int len;
+U32 len;
 
 TRACEME(("retrieve_lutf8str"));
 

-- 
Perl5 Master Repository


[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.6-176-g69b3f9233f

2017-12-04 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/69b3f9233f147fd65005942ffc200c502847b01e?hp=862c79b288b39ec55970c5a0d601f38a6e0a33c5>

- Log -
commit 69b3f9233f147fd65005942ffc200c502847b01e
Author: Tony Cook 
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 adc6b5a1b5b347f66b06957f112a9ac4db833891
Author: Tony Cook 
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.

---

Summary of changes:
 dist/Storable/Storable.xs | 51 +
 dist/Storable/t/hugeids.t | 83 +--
 2 files changed, 125 insertions(+), 9 deletions(-)

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index 29d4c79963..f380faa007 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -1428,6 +1428,8 @@ static const sv_retrieve_t sv_old_retrieve[] = {
 (sv_retrieve_t)retrieve_other, /* SX_LOBJECT not supported */
 };
 
+static SV *retrieve_hook_common(pTHX_ stcxt_t *cxt, const char *cname, int 
large);
+
 static SV *retrieve_array(pTHX_ stcxt_t *cxt, const char *cname);
 static SV *retrieve_hash(pTHX_ stcxt_t *cxt, const char *cname);
 static SV *retrieve_sv_undef(pTHX_ stcxt_t *cxt, const char *cname);
@@ -3694,7 +3696,11 @@ static int store_hook(
 
 /* [SX_HOOK]  [] */
 if (!recursed++) {
-PUTMARK(SX_HOOK);
+#ifdef HAS_U64
+if (len2 > INT32_MAX)
+PUTMARK(SX_LOBJECT);
+#endif
+   PUTMARK(SX_HOOK);
 PUTMARK(flags);
 if (obj_type == SHT_EXTRA)
 PUTMARK(eflags);
@@ -3810,7 +3816,11 @@ static int store_hook(
 
 /* SX_HOOK  [] */
 if (!recursed) {
-PUTMARK(SX_HOOK);
+#ifdef HAS_U64
+if (len2 > INT32_MAX)
+   PUTMARK(SX_LOBJECT);
+#endif
+   PUTMARK(SX_HOOK);
 PUTMARK(flags);
 if (obj_type == SHT_EXTRA)
 PUTMARK(eflags);
@@ -3836,8 +3846,14 @@ static int store_hook(
 }
 
 /*   */
+#ifdef HAS_U64
+if (len2 > INT32_MAX) {
+W64LEN(len2);
+}
+else
+#endif
 if (flags & SHF_LARGE_STRLEN) {
-I32 wlen2 = len2;  /* STRLEN might be 8 bytes */
+U32 wlen2 = len2;  /* STRLEN might be 8 bytes */
 WLEN(wlen2);   /* Must write an I32 for 64-bit 
machines */
 } else {
 unsigned char clen = (unsigned char) len2;
@@ -4693,13 +4709,13 @@ static SV *retrieve_blessed(pTHX_ stcxt_t *cxt, const 
char *cname)
  * processing (since we won't have seen the magic object by the time the hook
  * is called).  See comments below for why it was done that way.
  */
-static SV *retrieve_hook(pTHX_ stcxt_t *cxt, const char *cname)
+static SV *retrieve_hook_common(pTHX_ stcxt_t *cxt, const char *cname, int 
large)
 {
 U32 len;
 char buf[LG_BLESS + 1];/* Avoid malloc() if possible */
 char *classname = buf;
 unsigned int flags;
-I32 len2;
+STRLEN len2;
 SV *frozen;
 I32 len3 = 0;
 AV *av = 0;
@@ -4720,6 +4736,11 @@ static SV *retrieve_hook(pTHX_ stcxt_t *cxt, const char 
*cname)
 TRACEME(("retrieve_hook (#%d)", (int)cxt->tagnum));
 ASSERT(!cname, ("no bless-into class given here, got %s", cname));
 
+#ifndef HAS_U64
+assert(!large);
+PERL_UNUSED_ARG(large);
+#endif
+
 /*
  * Read flags, which tell us about the type, and whether we need
  * to recurse.
@@ -4868,8 +4889,17 @@ static SV *retrieve_hook(pTHX_ stcxt_t *cxt, const char 
*cname)
  * To understand that code, read retrieve_scalar()
  */
 
-if (flags & SHF_LARGE_STRLEN)
-RLEN(len2);
+#ifdef HAS_U64
+if (large) {
+  

[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.6-178-g3ee455a11e

2017-12-05 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3ee455a11edcc4afaae1f5acd85a7959ada7ba9a?hp=69b3f9233f147fd65005942ffc200c502847b01e>

- Log -
commit 3ee455a11edcc4afaae1f5acd85a7959ada7ba9a
Author: Tony Cook 
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 8e9e9c93795ddad86ed8b77c6e5633c37527860c
Author: Tony Cook 
Date:   Tue Dec 5 06:53:16 2017 +0100

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

---

Summary of changes:
 dist/Storable/Storable.xs |  6 +++---
 dist/Storable/t/blessed.t | 37 -
 dist/Storable/t/hugeids.t | 19 ++-
 3 files changed, 57 insertions(+), 5 deletions(-)

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index f380faa007..2a6c58d613 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -4903,12 +4903,12 @@ static SV *retrieve_hook_common(pTHX_ stcxt_t *cxt, 
const char *cname, int large
 else
 GETMARK(len2);
 
-frozen = NEWSV(10002, len2);
+frozen = NEWSV(10002, len2 ? len2 : 1);
 if (len2) {
 SAFEREAD(SvPVX(frozen), len2, frozen);
-SvCUR_set(frozen, len2);
-*SvEND(frozen) = '\0';
 }
+SvCUR_set(frozen, len2);
+*SvEND(frozen) = '\0';
 (void) SvPOK_only(frozen); /* Validates string pointer */
 if (cxt->s_tainted)/* Is input source tainted? */
 SvTAINT(frozen);
diff --git a/dist/Storable/t/blessed.t b/dist/Storable/t/blessed.t
index c93274434c..b37d020fc6 100644
--- a/dist/Storable/t/blessed.t
+++ b/dist/Storable/t/blessed.t
@@ -44,7 +44,7 @@ use Storable qw(freeze thaw store retrieve);
'long VSTRING' => \(my $lvstring = eval "v" . 0 x 300),
LVALUE => \(my $substr  = substr((my $str = "foo"), 0, 3)));
 
-my $test = 12;
+my $test = 13;
 my $tests = $test + 23 + (2 * 6 * keys %::immortals) + (3 * keys 
%::weird_refs);
 plan(tests => $tests);
 
@@ -322,3 +322,38 @@ is(ref $t, 'STRESS_THE_STACK');
 }
 }
 }
+
+{
+# [perl #118551]
+{
+package RT118551;
+
+sub new {
+my $class = shift;
+my $string = shift;
+die 'Bad data' unless defined $string;
+my $self = { string => $string };
+return bless $self, $class;
+}
+
+sub STORABLE_freeze {
+my $self = shift;
+my $cloning = shift;
+return if $cloning;
+return ($self->{string});
+}
+
+sub STORABLE_attach {
+my $class = shift;
+my $cloning = shift;
+my $string = shift;
+return $class->new($string);
+}
+}
+
+my $x = [ RT118551->new('a'), RT118551->new('') ];
+
+$y = freeze($x);
+
+ok(eval {thaw($y)}, "empty serialized") or diag $@; # <-- dies here with 
"Bad data"
+}
diff --git a/dist/Storable/t/hugeids.t b/dist/Storable/t/hugeids.t
index b0c4af0814..c0e19ae0bf 100644
--- a/dist/Storable/t/hugeids.t
+++ b/dist/Storable/t/hugeids.t
@@ -12,7 +12,7 @@ use Config;
 use Storable qw(store_fd retrieve_fd nstore_fd);
 use Test::More;
 use File::Temp qw(tempfile);
-use Devel::Peek;
+use File::Spec;
 
 BEGIN {
 plan skip_all => 'Storable was not built'
@@ -29,6 +29,11 @@ BEGIN {
 unless $Config{d_fork};
 }
 
+find_exe("gzip")
+or plan skip_all => "Need gzip for this test";
+find_exe("gunzip")
+or plan skip_all => "Need gunzip for this test";
+
 plan tests => 12;
 
 my $skips = $ENV{PERL_STORABLE_SKIP_ID_TEST} || '';
@@ -299,6 +304,18 @@ sub check_4g_hook_data {
 print "OK";
 }
 
+sub find_exe {
+my ($exe) = @_;
+
+$exe .= $Config{_exe};
+my @path = split /\Q$Config{path_sep}/, $ENV{PATH};
+for my $dir (@path) {
+my $abs = File::Spec->catfile($dir, $exe);
+-x $abs
+and return $abs;
+}
+}
+
 package HookLargeIds;
 
 sub new {

-- 
Perl5 Master Repository


[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.6-179-g3944c89c8c

2017-12-06 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3944c89c8cc00f0ae8ceb6cb84b8168524b5def7?hp=3ee455a11edcc4afaae1f5acd85a7959ada7ba9a>

- Log -
commit 3944c89c8cc00f0ae8ceb6cb84b8168524b5def7
Author: Tony Cook 
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

---

Summary of changes:
 dist/Storable/Storable.xs | 42 +-
 1 file changed, 37 insertions(+), 5 deletions(-)

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index 2a6c58d613..1714d5cb50 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -319,6 +319,29 @@ typedef STRLEN ntag_t;
 #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)
+#  else
+#define NV_PADDING 0
+#  endif
+#else
+/* This is kind of a guess - it means we'll get an unneeded clear on 128-bit NV
+   but an upgraded perl will fix that
+*/
+#  if NVSIZE > 8
+#define NV_CLEAR
+#  endif
+#  define NV_PADDING 0
+#endif
+
+typedef union {
+NV nv;
+U8 bytes[sizeof(NV)];
+} NV_bytes;
+
 /* Needed for 32bit with lengths > 2G - 4G, and 64bit */
 #if PTRSIZE > 4
 #define HAS_U64
@@ -2483,9 +2506,15 @@ static int store_scalar(pTHX_ stcxt_t *cxt, SV *sv)
 
 TRACEME(("ok (integer 0x%" UVxf ", value = %" IVdf ")", PTR2UV(sv), 
iv));
 } else if (flags & SVf_NOK) {
-NV nv;
+NV_bytes nv;
+#ifdef NV_CLEAR
+/* if we can't tell if there's padding, clear the whole NV and hope the
+   compiler leaves the padding alone
+*/
+Zero(&nv, 1, NV_bytes);
+#endif
 #if (PATCHLEVEL <= 6)
-nv = SvNV(sv);
+nv.nv = SvNV(sv);
 /*
  * Watch for number being an integer in disguise.
  */
@@ -2500,18 +2529,21 @@ static int store_scalar(pTHX_ stcxt_t *cxt, SV *sv)
 iv = SvIV(sv);
 goto integer;  /* Share code above */
 }
-nv = SvNV(sv);
+nv.nv = SvNV(sv);
 #endif
 
 if (cxt->netorder) {
-TRACEME(("double %" NVff " stored as string", nv));
+TRACEME(("double %" NVff " stored as string", nv.nv));
 goto string_readlen;   /* Share code below */
 }
+#if NV_PADDING
+Zero(nv.bytes + NVSIZE - NV_PADDING, NV_PADDING, char);
+#endif
 
 PUTMARK(SX_DOUBLE);
 WRITE(&nv, sizeof(nv));
 
-TRACEME(("ok (double 0x%" UVxf ", value = %" NVff ")", PTR2UV(sv), 
nv));
+TRACEME(("ok (double 0x%" UVxf ", value = %" NVff ")", PTR2UV(sv), 
nv.nv));
 
 } else if (flags & (SVp_POK | SVp_NOK | SVp_IOK)) {
 #ifdef SvVOK

-- 
Perl5 Master Repository


[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.6-182-gaa060bea5c

2017-12-11 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/aa060bea5c3eb0bee9f357e611932c8c882ce7dd?hp=3944c89c8cc00f0ae8ceb6cb84b8168524b5def7>

- Log -
commit aa060bea5c3eb0bee9f357e611932c8c882ce7dd
Author: Tony Cook 
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 7e1adb0ccd5ca60820a340ba0593c013220ee49d
Author: Tony Cook 
Date:   Mon Dec 11 03:52:05 2017 +0100

fix type typo

commit 62de7af9916b2f620c3b98f839fd6a8ac9ecb5ad
Author: Tony Cook 
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.

---

Summary of changes:
 dist/Storable/Storable.xs | 72 +--
 dist/Storable/__Storable__.pm | 25 ---
 dist/Storable/t/blessed.t | 61 ++--
 3 files changed, 135 insertions(+), 23 deletions(-)

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index 1714d5cb50..81d699b9b1 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -111,16 +111,35 @@
 #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 (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
@@ -403,6 +422,9 @@ typedef struct stcxt {
 int in_retrieve_overloaded; /* performance hack for retrieving overloaded 
objects */
 int flags; /* controls whether to bless or tie objects */
 U16 recur_depth;   /* avoid stack overflows RT #97526 */
+#ifdef DEBUGME
+int traceme;/* TRACEME() produces output */
+#endif
 } stcxt_t;
 
 /* Note: We dont count nested scalars. This will have to count all refs
@@ -1525,7 +1547,7 @@ static SV *mbuf2sv(pTHX);
 static void init_perinterp(pTHX)
 {
 INIT_STCXT;
-
+INIT_TRACEME;
 cxt->netorder = 0; /* true if network order used */
 cxt->forgive_me = -1;  /* whether to be forgiving... */
 cxt->accept_future_minor = -1; /* would otherwise occur too late */
@@ -1557,6 +1579,8 @@ static void init_store_context(pTHX_
 int optype,

[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.6-184-g0d2e3f5610

2017-12-18 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/0d2e3f5610524ae212869a459a1c9fe33f792f7d?hp=aa060bea5c3eb0bee9f357e611932c8c882ce7dd>

- Log -
commit 0d2e3f5610524ae212869a459a1c9fe33f792f7d
Author: Tony Cook 
Date:   Tue Dec 19 01:06:31 2017 +0100

(perl #50608) add regular expression support

This may need some changes to work on older perls.

commit 904e927ac92941e456409e2c32d1d8285648b788
Author: Tony Cook 
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.

---

Summary of changes:
 dist/Storable/Makefile.PL |  12 ++-
 dist/Storable/Storable.xs | 188 +++---
 dist/Storable/__Storable__.pm |  65 ++-
 dist/Storable/t/malice.t  |   4 +-
 dist/Storable/t/regexp.t  | 114 +
 5 files changed, 368 insertions(+), 15 deletions(-)
 create mode 100644 dist/Storable/t/regexp.t

diff --git a/dist/Storable/Makefile.PL b/dist/Storable/Makefile.PL
index 622265599b..73e80337fe 100644
--- a/dist/Storable/Makefile.PL
+++ b/dist/Storable/Makefile.PL
@@ -23,7 +23,7 @@ WriteMakefile(
 DISTNAME=> "Storable",
 # We now ship this in t/
 #PREREQ_PM   => { 'Test::More' => '0.41' },
-PL_FILES=> { 'Storable.pm.PL'  => 'Storable.pm' },
+PL_FILES=> { }, # prevent default behaviour
 PM  => { 'Storable.pm' => '$(INST_ARCHLIB)/Storable.pm' },
 PREREQ_PM   => { XSLoader => 0 },
 INSTALLDIRS => ($] >= 5.007 && $] < 5.012) ? 'perl' : 'site',
@@ -95,3 +95,13 @@ release : dist
git push --tags
 "
 }
+
+sub postamble {
+'
+all :: Storable.pm
+   $(NOECHO) $(NOOP)
+
+Storable.pm :: Storable.pm.PL __Storable__.pm
+   $(PERLRUN) Storable.pm.PL
+'
+}
diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index 81d699b9b1..605518727d 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -193,7 +193,7 @@
 #define SX_VSTRING C(29)   /* vstring forthcoming (small) */
 #define SX_LVSTRINGC(30)   /* vstring forthcoming (large) */
 #define SX_SVUNDEF_ELEMC(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_LASTC(34)   /* invalid. marker only */
 
@@ -853,7 +853,8 @@ static stcxt_t *Context_ptr = NULL;
 #define svis_TIED  4
 #define svis_TIED_ITEM 5
 #define svis_CODE  6
-#define svis_OTHER 7
+#define svis_REGEXP7
+#define svis_OTHER 8
 
 /*
  * Flags for SX_HOOK.
@@ -906,6 +907,12 @@ static stcxt_t *Context_ptr = NULL;
 #define FLAG_BLESS_OK 2
 #define FLAG_TIE_OK   4
 
+/*
+ * Flags for SX_REGEXP.
+ */
+
+#define SHR_U32_RE_LEN 0x01
+
 /*
  * Before 0.6, the magic string was "perl-store" (binary version number 0).
  *
@@ -1384,6 +1391,7 @@ static int store_hash(pTHX_ stcxt_t *cxt, HV *hv);
 static int store_tied(pTHX_ stcxt_t *cxt, SV *sv);
 static int store_tied_item(pTHX_ stcxt_t *cxt, SV *sv);
 static int store_code(pTHX_ stcxt_t *cxt, CV *cv);
+static int store_regexp(pTHX_ stcxt_t *cxt, SV *sv);
 static int store_other(pTHX_ stcxt_t *cxt, SV *sv);
 static int store_blessed(pTHX_ stcxt_t *cxt, SV *sv, int type, HV *pkg);
 
@@ -1397,6 +1405,7 @@ static const sv_store_t sv_store[] = {
 (sv_store_t)store_tied,/* svis_TIED */
 (sv_store_t)store_tied_item,/* svis_TIED_ITEM */
 (sv_store_t)store_code,/* svis_CODE */
+(sv_store_t)store_regexp,  /* svis_REGEXP */
 (sv_store_t)store_other,   /* svis_OTHER */
 };
 
@@ -1423,6 +1432,7 @@ static SV *retrieve_tied_hash(pTHX_ stcxt_t *cxt, const 
char *cname);
 static SV *retrieve_tied_scalar(pTHX_ stcxt_t *cxt, const char *cname);
 static SV *retrieve_other(pTHX_ stcxt_t *cxt, const char *cname);
 static SV *retrieve_lobject(pTHX_ stcxt_t *cxt, const char *cname);
+static SV *retrieve_regexp(pTHX_ stcxt_t *cxt, const char *cname);
 
 /* helpers for U64 lobjects */
 
@@ -1469,8 +1479,9 @@ static const sv_retrieve_t sv_old_re

[perl.git] branch tonyc/127743-cperl-storable-fixes deleted. v5.27.6-184-g0d2e3f5610

2018-01-09 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been deleted



   was  0d2e3f5610524ae212869a459a1c9fe33f792f7d

- Log -
0d2e3f5610524ae212869a459a1c9fe33f792f7d (perl #50608) add regular expression 
support
---

-- 
Perl5 Master Repository


[perl.git] branch tonyc/127743-cperl-storable-fixes created. v5.27.7-190-g9964147008

2018-01-09 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been created

<https://perl5.git.perl.org/perl.git/commitdiff/996414700843d168274960e55b9381f342167066?hp=>

at  996414700843d168274960e55b9381f342167066 (commit)

- Log -
commit 996414700843d168274960e55b9381f342167066
Author: Tony Cook 
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.

This needs work for Win32 builds.

commit 9ab82a50d61fe6da4a8fe16948419170b2e5a656
Author: Tony Cook 
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 9d57dbe9426baf7bd1a7f70edf68726d43f9f832
Author: Tony Cook 
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 a525099adba4ac3d54e420b753e96360b4bc7f71
Author: Tony Cook 
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 4c24efa3718b7927d11aec7d76f5a248bcae8c98
Author: Tony Cook 
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 fe9d131e66d2448e44f962988a03754a0dab33be
Author: Tony Cook 
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 eccf68b19803193b457aaa87353ee8c0a2c1ff05
Author: Tony Cook 
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.

com

[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.7-191-gdb57e3b185

2018-01-09 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/db57e3b1850301b2d44040d2f4a1d38b8d856c53?hp=996414700843d168274960e55b9381f342167066>

- Log -
commit db57e3b1850301b2d44040d2f4a1d38b8d856c53
Author: Tony Cook 
Date:   Wed Jan 10 15:09:51 2018 +1100

handle builds without Storable correctly

---

Summary of changes:
 Makefile.SH | 34 ++
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/Makefile.SH b/Makefile.SH
index a174a2397e..6f7be44183 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -177,12 +177,14 @@ 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 ;;
-   Storable) storable_limit_dep=lib/auto/Storable/Storable.$dlext ;;
+   Storable) storable_limit_dep=lib/auto/Storable/Storable.$dlext
+ storable_type='dynamic' ;;
esac
 done
 
@@ -219,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
 
@@ -620,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."
 
@@ -1092,7 +1095,7 @@ esac
 
 $spitshell >>$Makefile <<'!NO!SUBS!'
 
-.PHONY: preplibrary rebuild_storable
+.PHONY: preplibrary common_build
 preplibrary: $(MINIPERL_EXE) $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
 
 $(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD)
@@ -1135,7 +1138,7 @@ extra.pods: $(MINIPERL_EXE)
echo "pod/perl"$$nx".pod" >> extra.pods ; \
done
 
-extras.make: $(PERL_EXE) rebuild_storable
+extras.make: $(PERL_EXE)
-@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" 
$(RUN_PERL) -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`
 
 extras.test: $(PERL_EXE)
@@ -1155,9 +1158,9 @@ no_install no-install: install-notify
 install: install-all
 !NO!SUBS!
 
-$spitshell >>$Makefile <>$Makefile <>$Makefile <<'!NO!SUBS!'
 test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) 
\
-   $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) 
rebuild_storable
+   $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build
cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
 
 !NO!SUBS!
@@ -1521,7 +1528,7 @@ test_prep test-prep: test_prep_pre $(MINIPERL_EXE) 
$(unidatafiles) $(PERL_EXE) \
 *) $spitshell >>$Makefile <>$Makefile <>$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.

-- 
Perl5 Master Repository


[perl.git] branch tonyc/127743-cperl-storable-fixes updated. v5.27.7-192-gb7969de591

2018-01-10 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/b7969de59118890b5545014a0c60107f8d19bf8d?hp=db57e3b1850301b2d44040d2f4a1d38b8d856c53>

- Log -
commit b7969de59118890b5545014a0c60107f8d19bf8d
Author: Tony Cook 
Date:   Thu Jan 11 15:25:07 2018 +1100

win32 builds

---

Summary of changes:
 dist/Storable/stacksize |  7 +++
 win32/GNUmakefile   | 13 +++--
 win32/Makefile  | 10 +-
 win32/makefile.mk   | 10 +++---
 4 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/dist/Storable/stacksize b/dist/Storable/stacksize
index 2514e5c432..690645a4b4 100644
--- a/dist/Storable/stacksize
+++ b/dist/Storable/stacksize
@@ -29,6 +29,13 @@ sub is_miniperl {
 if (is_miniperl()) {
 die "Should not run during miniperl\n";
 }
+if ($^O eq "MSWin32") {
+# prevent Windows popping up a dialog each time we overflow
+# the stack
+require Win32API::File;
+Win32API::File->import(qw(SetErrorMode SEM_NOGPFAULTERRORBOX 
SEM_FAILCRITICALERRORS));
+SetErrorMode(SEM_NOGPFAULTERRORBOX() | SEM_FAILCRITICALERRORS());
+}
 if (@ARGV and $ARGV[0] eq '--core') {
 $ENV{PERL_CORE} = 1;
 }
diff --git a/win32/GNUmakefile b/win32/GNUmakefile
index ede1b05723..abc6524422 100644
--- a/win32/GNUmakefile
+++ b/win32/GNUmakefile
@@ -1164,7 +1164,7 @@ CFG_VARS  =   \
 
 .PHONY: all info
 
-all : info rebasePE Extensions_nonxs $(PERLSTATIC)
+all : info rebasePE Extensions_nonxs $(PERLSTATIC) PostExt
 
 info :
@echo # CCTYPE=$(CCTYPE)
@@ -1597,6 +1597,15 @@ Extensions_clean :
 Extensions_realclean :
-if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl 
"MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all 
--target=realclean
 
+PostExt : ..\lib\Storable\Limit.pm
+
+# we need the exe, perl(ver).dll, and the Exporter, Storable, Win32 extensions
+# rebasePE covers just about that, including adjustment for static builds
+..\lib\Storable\Limit.pm : rebasePE
+   $(PERLEXE) -I..\lib -I. ..\dist\Storable\stacksize --core
+   if not exist ..\lib\Storable mkdir ..\lib\Storable
+   copy ..\dist\Storable\lib\Storable\Limit.pm ..\lib\Storable\Limit.pm
+
 # all PE files need to be built by the time this target runs, PP files can 
still
 # be running in parallel like UNIDATAFILES, this target a placeholder for the
 # future
@@ -1676,7 +1685,7 @@ distclean: realclean
-del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
-del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
-del /f $(LIBDIR)\File\Glob.pm
-   -del /f $(LIBDIR)\Storable.pm
+   -del /f $(LIBDIR)\Storable.pm $(LIBDIR)\Storable\Limit.pm
-del /f $(LIBDIR)\Sys\Hostname.pm
-del /f $(LIBDIR)\Time\HiRes.pm
-del /f $(LIBDIR)\Unicode\Normalize.pm
diff --git a/win32/Makefile b/win32/Makefile
index 703639a907..f9c28eb5a2 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -1225,13 +1225,12 @@ Extensions_clean:
 Extensions_realclean: 
-if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl 
"MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all 
--target=realclean
 
-PostExt: rebuild_storable
+PostExt: ..\lib\Storable\Limit.pm
 
-rebuild_storable: $(PERLEXE)
+..\lib\Storable\Limit.pm: $(PERLEXE) Extensions
$(PERLEXE) -I..\lib -I. ..\dist\Storable\stacksize --core
-   cd ..\dist\Storable
-   $(MAKE) PERL_CORE=1
-   cd ..\..\win32
+   if not exist ..\lib\Storable mkdir ..\lib\Storable
+   copy ..\dist\Storable\lib\Storable\Limit.pm ..\lib\Storable\Limit.pm
 
 
#---
 
@@ -1311,6 +1310,7 @@ distclean: realclean
-del /f $(LIBDIR)\Time\HiRes.pm
-del /f $(LIBDIR)\Unicode\Normalize.pm
-del /f $(LIBDIR)\Math\BigInt\FastCalc.pm
+   -del /f $(LIBDIR)\Storable.pm $(LIBDIR)\Storable\Limit.pm
-del /f $(LIBDIR)\Win32.pm
-del /f $(LIBDIR)\Win32CORE.pm
-del /f $(LIBDIR)\Win32API\File.pm
diff --git a/win32/makefile.mk b/win32/makefile.mk
index fb48af3f99..1426baef38 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -1548,11 +1548,14 @@ rebasePE : Extensions $(PERLDLL) Extensions_normalize 
$(PERLEXE) PostExt
 .ENDIF
$(NOOP)
 
-PostExt: rebuild_storable
+PostExt: ..\lib\Storable\Limit.pm
 
-rebuild_storable: $(PERLEXE)
+# we need the exe, perl(ver).dll, and the Exporter, Storable, Win32 extensions
+# rebasePE covers just about that, including adjustment for static builds
+..\lib\Storable\Limit.pm : rebasePE
$(PERLEXE) -I..\lib -I. ..\dist\Storable\stacksize --core
-   cd ..\dist\Storable && $(MAKE) PERL_CORE=1
+   if n

[perl.git] branch smoke-me/tonyc/127743-cperl-storable-fixes created. v5.27.7-199-ga2cb31d2f1

2018-01-14 Thread Tony Cook
In perl.git, the branch smoke-me/tonyc/127743-cperl-storable-fixes has been 
created



at  a2cb31d2f11146e16b4bce8f808bf6d7f2331e9d (commit)

- Log -
---

-- 
Perl5 Master Repository


[perl.git] branch tonyc/127743-cperl-storable-fixes created. v5.27.7-199-ga2cb31d2f1

2018-01-14 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been created

<https://perl5.git.perl.org/perl.git/commitdiff/a2cb31d2f11146e16b4bce8f808bf6d7f2331e9d?hp=>

at  a2cb31d2f11146e16b4bce8f808bf6d7f2331e9d (commit)

- Log -
commit a2cb31d2f11146e16b4bce8f808bf6d7f2331e9d
Author: Tony Cook 
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 stacksize to prevent popping up segfault error messages
at the user on Win32.

commit e262a6c0508a1a51861ceccf27aacbc4129b303c
Author: Tony Cook 
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 1c68a505be3b9ac8b47fdac463dba76d88fee20d
Author: Tony Cook 
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 dfcadb711db06c682798aed204c80ea238a0811d
Author: Tony Cook 
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 d6562c2a96f0bccabceeb7085401033eeed2d558
Author: Tony Cook 
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 fb275b356ddac0434b62af336566274b5577d693
Author: Tony Cook 
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 80d5b89e9e532886624e91afe919022b65358304
Author: Tony Cook 
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(), 

[perl.git] branch tonyc/127743-cperl-storable-fixes deleted. v5.27.7-192-gb7969de591

2018-01-14 Thread Tony Cook
In perl.git, the branch tonyc/127743-cperl-storable-fixes has been deleted



   was  b7969de59118890b5545014a0c60107f8d19bf8d

- Log -
b7969de59118890b5545014a0c60107f8d19bf8d win32 builds
---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-146-g45d58ad0e1

2018-01-15 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/45d58ad0e10897c87404967eed23f3f290d00fd8?hp=1d2af5744d75143cf7ee8bfd33d4366a95dd1b95>

- Log -
commit 45d58ad0e10897c87404967eed23f3f290d00fd8
Merge: 1d2af5744d 9769b95f6c
Author: Tony Cook 
Date:   Tue Jan 16 10:56:37 2018 +1100

(perl #132533) updates to Devel::PPPort

commit 9769b95f6c4f605bfd34860a619d9f54387bc13e
Author: Tony Cook 
Date:   Tue Jan 16 10:28:53 2018 +1100

(perl #132533) bump $Devel::PPPort::VERSION

commit 6ac0580f186dac6deaf07dbe98b58392fd0a91f7
Author: Tony Cook 
Date:   Tue Jan 16 10:18:51 2018 +1100

(perl #132533) add missing generated file updates

commit a70a2aeb86bc82dbf40f06ed530a9bbc38916e0f
Author: Pali 
Date:   Sun Dec 3 17:42:14 2017 +0100

Fix test warning: Use of uninitialized value

Function ok() compares values as strings which leads to stringification of
undef and throwing warning.

commit 7ceac2e89b40347b95855c622b9f8f31bd6560f4
Author: Pali 
Date:   Sun Dec 3 17:02:53 2017 +0100

Fix security problem: CWE-134: Use of Externally-Controlled Format String

Function croak() takes printf-like formatted string, so passing arbitrary
char* can leads to buffer overflow. Use croak_sv() which is now available
and avoids converting SV* to char*.

commit 051475ba96b05e8ea21b4fdea8bd58b2644b4d2d
Author: Pali 
Date:   Sun Dec 3 17:01:10 2017 +0100

Use croak_sv in threads

Now when croak_sv is available, there is no need to use croak() with SV* to
char* conversion.

commit f87c37b1822dc27ee027ad18a8de36d3ae1999da
Author: Pali 
Date:   Sun Dec 3 16:57:46 2017 +0100

Implement mess

This patch provides implementation of the following functions:
croak_sv, die_sv, mess_sv, warn_sv, mess, vmess, warn_nocontext,
croak_nocontext, croak_no_modify, croak_memory_wrap, croak_xs_usage

TonyC: add parts/inc/mess to MANIFEST

---

Summary of changes:
 MANIFEST |   2 +
 dist/Devel-PPPort/PPPort_pm.PL   |   8 +-
 dist/Devel-PPPort/parts/inc/HvNAME   |   2 +-
 dist/Devel-PPPort/parts/inc/call |   4 +-
 dist/Devel-PPPort/parts/inc/mess | 527 +++
 dist/Devel-PPPort/parts/inc/ppphtest |   1 +
 dist/Devel-PPPort/parts/inc/threads  |   4 +-
 dist/Devel-PPPort/parts/todo/5006000 |   2 -
 dist/Devel-PPPort/parts/todo/5010001 |   1 -
 dist/Devel-PPPort/parts/todo/5013001 |   4 -
 dist/Devel-PPPort/parts/todo/5013003 |   1 -
 dist/Devel-PPPort/parts/todo/5019003 |   1 -
 dist/Devel-PPPort/t/HvNAME.t |   2 +-
 dist/Devel-PPPort/t/mess.t   | 282 +++
 dist/Devel-PPPort/t/ppphtest.t   |   1 +
 15 files changed, 824 insertions(+), 18 deletions(-)
 create mode 100644 dist/Devel-PPPort/parts/inc/mess
 create mode 100644 dist/Devel-PPPort/t/mess.t

diff --git a/MANIFEST b/MANIFEST
index e1522512fc..1f2bf305b8 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3172,6 +3172,7 @@ dist/Devel-PPPort/parts/inc/HvNAMEDevel::PPPort 
include
 dist/Devel-PPPort/parts/inc/limits Devel::PPPort include
 dist/Devel-PPPort/parts/inc/magic  Devel::PPPort include
 dist/Devel-PPPort/parts/inc/memory Devel::PPPort include
+dist/Devel-PPPort/parts/inc/mess   Devel::PPPort include
 dist/Devel-PPPort/parts/inc/misc   Devel::PPPort include
 dist/Devel-PPPort/parts/inc/mPUSH  Devel::PPPort include
 dist/Devel-PPPort/parts/inc/MY_CXT Devel::PPPort include
@@ -3352,6 +3353,7 @@ dist/Devel-PPPort/t/HvNAME.t  Devel::PPPort 
test file
 dist/Devel-PPPort/t/limits.t   Devel::PPPort test file
 dist/Devel-PPPort/t/magic.tDevel::PPPort test file
 dist/Devel-PPPort/t/memory.t   Devel::PPPort test file
+dist/Devel-PPPort/t/mess.t Devel::PPPort test file
 dist/Devel-PPPort/t/misc.t Devel::PPPort test file
 dist/Devel-PPPort/t/mPUSH.tDevel::PPPort test file
 dist/Devel-PPPort/t/MY_CXT.t   Devel::PPPort test file
diff --git a/dist/Devel-PPPort/PPPort_pm.PL b/dist/Devel-PPPort/PPPort_pm.PL
index a44b9c354c..983b6b44bc 100644
--- a/dist/Devel-PPPort/PPPort_pm.PL
+++ b/dist/Devel-PPPort/PPPort_pm.PL
@@ -539,7 +539,7 @@ package Devel::PPPort;
 use strict;
 use vars qw($VERSION $data);
 
-$VERSION = '3.37';
+$VERSION = '3.38';
 
 sub _init_data
 {
@@ -622,6 +622,10 @@ __DATA__
 
 %include misc
 
+%include format
+
+%include mess
+
 %include variables
 
 %include mPUSH
@@ -634,8 +638,6 @@ __DATA__
 
 %include MY_CXT
 
-%include format
-
 %include SvREFCNT
 
 %include newSV_type
diff --git a/dist/Devel-PPPort/parts/inc/HvNAME 
b/dist/Devel-PPPort/parts/inc/HvNAME
index 9b8602bd7e..9fba5029fb 100644
--- a/dist/Devel-PPPort/parts/inc/HvNAME
+++ b/dist/Devel-PPPort/parts/inc/HvNAME
@@ -32,7 +32,7 @@ HvNA

[perl.git] branch smoke-me/tonyc/127743-cperl-storable-fixes updated. v5.27.7-200-ge4b11f15c4

2018-01-15 Thread Tony Cook
In perl.git, the branch smoke-me/tonyc/127743-cperl-storable-fixes has been 
updated

<https://perl5.git.perl.org/perl.git/commitdiff/e4b11f15c4a65de8979fb0033ff2872517f0126a?hp=a2cb31d2f11146e16b4bce8f808bf6d7f2331e9d>

- Log -
commit e4b11f15c4a65de8979fb0033ff2872517f0126a
Author: Tony Cook 
Date:   Tue Jan 16 15:50:24 2018 +1100

bump $Storable::VERSION to 2.66

This number will change for the final merge

---

Summary of changes:
 dist/Storable/__Storable__.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dist/Storable/__Storable__.pm b/dist/Storable/__Storable__.pm
index 43d77bce0a..4cc1f2840c 100644
--- a/dist/Storable/__Storable__.pm
+++ b/dist/Storable/__Storable__.pm
@@ -27,7 +27,7 @@ our @EXPORT_OK = qw(
 
 our ($canonical, $forgive_me);
 
-our $VERSION = '2.65';
+our $VERSION = '2.66';
 
 our $recursion_limit;
 our $recursion_limit_hash;

-- 
Perl5 Master Repository


[perl.git] branch tonyc/132704-freebsd-optimize created. v5.27.7-147-g4d8d7a4152

2018-01-15 Thread Tony Cook
In perl.git, the branch tonyc/132704-freebsd-optimize has been created



at  4d8d7a4152178168855cb6a4506025a5d82465c7 (commit)

- Log -
commit 4d8d7a4152178168855cb6a4506025a5d82465c7
Author: Tom Hukins 
Date:   Wed Jan 10 18:53:24 2018 +

Set more sensible -O optimization on FreeBSD

FreeBSD's /usr/share/mk/sys.mk specifies -O2 for architectures other
than arm and mips.  By default, compile perl with the same optimization
levels.

---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-147-g4d8d7a4152

2018-01-15 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
---

Summary of changes:
 hints/freebsd.sh | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/hints/freebsd.sh b/hints/freebsd.sh
index 5d69dee0eb..07eab0e252 100644
--- a/hints/freebsd.sh
+++ b/hints/freebsd.sh
@@ -343,3 +343,10 @@ case "$cc" in
   ;;
 esac
 
+case `uname -p` in
+arm|mips)
+  ;;
+*)
+  test "$optimize" || optimize='-O2'
+  ;;
+esac

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-156-g57bd660029

2018-01-16 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/57bd660029d94312ca4eb88993889d981f41b484?hp=d77401488a85b2a1918a46d5ac1bcc94e6ae1a20>

- Log -
commit 57bd660029d94312ca4eb88993889d981f41b484
Author: Tony Cook 
Date:   Thu Aug 24 15:52:33 2017 +1000

(perl #131954) don't initialize mark before a possible move of the stack

---

Summary of changes:
 pp.c|  4 +++-
 t/op/list.t | 42 +-
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/pp.c b/pp.c
index ae6d9c94d1..4b1ccbba80 100644
--- a/pp.c
+++ b/pp.c
@@ -5104,9 +5104,11 @@ PP(pp_list)
 {
 I32 markidx = POPMARK;
 if (GIMME_V != G_ARRAY) {
-   SV **mark = PL_stack_base + markidx;
+/* don't initialize mark here, EXTEND() may move the stack */
+SV **mark;
dSP;
 EXTEND(SP, 1);  /* in case no arguments, as in @empty */
+mark = PL_stack_base + markidx;
if (++MARK <= SP)
*MARK = *SP;/* unwanted list, return last item */
else
diff --git a/t/op/list.t b/t/op/list.t
index 3f9487b96f..2acb03a321 100644
--- a/t/op/list.t
+++ b/t/op/list.t
@@ -6,7 +6,7 @@ BEGIN {
 set_up_inc(qw(. ../lib));
 }
 
-plan( tests => 71 );
+plan( tests => 72 );
 
 @foo = (1, 2, 3, 4);
 cmp_ok($foo[0], '==', 1, 'first elem');
@@ -228,3 +228,43 @@ ok(($0[()[()]],1), "[perl #126193] list slice with zero 
indexes");
 @x;
 pass('no panic'); # panics only under DEBUGGING
 }
+
+fresh_perl_is(<<'EOS', "", {}, "[perl #131954] heap use after free in 
pp_list");
+#!./perl
+BEGIN {
+my $bar = "bar";
+
+sub test_no_error {
+eval $_[0];
+}
+
+test_no_error($_) for split /\n/,
+q[ x
+   definfoo, $bar;
+   x
+   x
+   x
+   grep((not $bar, $bar, $bar), $bar);
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+x
+   x
+x
+x
+x
+x
+x
+x
+ ];
+}
+EOS

-- 
Perl5 Master Repository


[perl.git] branch maint-votes updated. d8075561cf6c62e066bb602969a7fac08c49f301

2018-01-16 Thread Tony Cook
In perl.git, the branch maint-votes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d8075561cf6c62e066bb602969a7fac08c49f301?hp=45e26ba03d1098685dde15ca44ae768f53eb78c4>

- Log -
commit d8075561cf6c62e066bb602969a7fac08c49f301
Author: Tony Cook 
Date:   Wed Jan 17 11:47:45 2018 +1100

add 57bd6600

commit 898781bdc7420a789bef342f8e6fb81bf1b7851b
Author: Tony Cook 
Date:   Wed Jan 17 11:43:10 2018 +1100

close some tags

---

Summary of changes:
 votes-5.26.xml | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/votes-5.26.xml b/votes-5.26.xml
index d8b6b391d6..f66d932b7d 100644
--- a/votes-5.26.xml
+++ b/votes-5.26.xml
@@ -39,8 +39,10 @@ Both of these or neither
 
 
 
-
+
+
+
 
 
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-157-g4e235a450a

2018-01-16 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/4e235a450ab8452a3fcc4eb1ecb7dd354928bb95?hp=57bd660029d94312ca4eb88993889d981f41b484>

- Log -
commit 4e235a450ab8452a3fcc4eb1ecb7dd354928bb95
Author: Tony Cook 
Date:   Wed Jan 17 12:01:03 2018 +1100

perldelta for 57bd660029

---

Summary of changes:
 pod/perldelta.pod | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index da5fe0b745..f87dcae033 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -446,7 +446,7 @@ files in F and F are best summarized in 
L.
 
 =item *
 
-XXX
+Fixed a use after free bug in pp_list introduced in 5.27.1.  [perl #131954]
 
 =back
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-166-g8e14f284e9

2018-01-17 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/8e14f284e9d93dc3a96622cee4ebdc135e677581?hp=5109e49ff544d495902386fbfc547a0fc9e35200>

- Log -
commit 8e14f284e9d93dc3a96622cee4ebdc135e677581
Author: Tony Cook 
Date:   Thu Oct 12 14:51:23 2017 +1100

(perl #131878) don't call croak() with a potential format string

Since this has security implications, explain the change in
perldelta.

---

Summary of changes:
 pod/perldelta.pod | 16 ++--
 pod/perlembed.pod |  2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index f87dcae033..ce35d7368a 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -246,13 +246,25 @@ section.
 
 Additionally, the following selected changes have been made:
 
-=head3 L
+=head3 L
 
 =over 4
 
 =item *
 
-XXX Description of the change here
+An example in L used the string value of C as a
+format string when calling croak().  If that string contains format
+codes such as C<%s> this could crash the program.
+
+This has been changed to a call to croak_sv().
+
+An alternative could have been to supply a trivial format string:
+
+  croak("%s", SvPV_nolen(ERRSV));
+
+or as a special case for C simply:
+
+  croak(NULL);
 
 =back
 
diff --git a/pod/perlembed.pod b/pod/perlembed.pod
index eeffd9381c..adcaf958b5 100644
--- a/pod/perlembed.pod
+++ b/pod/perlembed.pod
@@ -431,7 +431,7 @@ been wrapped here):
  PUTBACK;
 
  if (croak_on_error && SvTRUE(ERRSV))
-   croak(SvPVx_nolen(ERRSV));
+croak_sv(ERRSV);
 
  return retval;
  }

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/tonyc/127743-cperl-storable-fixes updated. v5.27.7-202-g9e081404a2

2018-01-22 Thread Tony Cook
In perl.git, the branch smoke-me/tonyc/127743-cperl-storable-fixes has been 
updated

<https://perl5.git.perl.org/perl.git/commitdiff/9e081404a2589566d90c1c4eea0ad3e47a635165?hp=e4b11f15c4a65de8979fb0033ff2872517f0126a>

- Log -
commit 9e081404a2589566d90c1c4eea0ad3e47a635165
Author: Tony Cook 
Date:   Tue Jan 23 14:52:01 2018 +1100

(perl #127743) avoid searching very large limits

If there was no default stack size limit this would end up running the
system out of memory/swap.

commit 81130eee3c75dd7d921bb31d888012dd17df2f55
Author: Tony Cook 
Date:   Mon Jan 22 14:31:21 2018 +1100

(perl #127743) re-incorporate the recursion limits for cygwin

I missed including this when I translated the preprocessor macros
in Storable.xs to perl, and cygwin64 was unhappy.

Doing the same check that stacksize does works without these changes,
but recurse.t failed (in the retrieve code).

This exposes a limitation in these calculations - calls to Storable may
occur from deeper in the call stack than the checks done by stacksize.

The calculations ($stack_reserve) do try to fudge around that, but
user code may end up doing that from even deeper within the call
stack.

---

Summary of changes:
 dist/Storable/stacksize | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dist/Storable/stacksize b/dist/Storable/stacksize
index 690645a4b4..b390419b6b 100644
--- a/dist/Storable/stacksize
+++ b/dist/Storable/stacksize
@@ -7,7 +7,8 @@ use Cwd;
 use strict;
 
 my $fn = "lib/Storable/Limit.pm";
-my ($bad1, $bad2) = (45000, 25000);
+my $ptrsize = $Config{ptrsize};
+my ($bad1, $bad2) = (65001, 25000);
 sub QUIET () {
 (defined $ENV{MAKEFLAGS} and $ENV{MAKEFLAGS} =~ /\b(s|silent|quiet)\b/
  and !defined($ENV{TRAVIS}))
@@ -163,7 +164,7 @@ my $max_depth_hash = $n;
 # the limits the use sees.
 
 my $stack_reserve = $^O eq "MSWin32" ? 32 : 16;
-if ($] ge "5.016") {
+if ($] ge "5.016" && !($^O eq "cygwin" && $ptrsize == 8)) {
 $max_depth -= $stack_reserve;
 $max_depth_hash -= $stack_reserve;
 }

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-24-gf05f24e529

2018-01-24 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/f05f24e529a8da95d8b88a6bcbf0ffe8a0076027?hp=1556073b177050bb1fd52d5e76c72d4f215c0730>

- Log -
commit f05f24e529a8da95d8b88a6bcbf0ffe8a0076027
Author: Tony Cook 
Date:   Thu Jan 25 11:43:07 2018 +1100

George Hartzell is now a perl author

commit a9d53a924999b5c5611eb3b2a46201fbfa3bfbfc
Author: Tony Cook 
Date:   Thu Jan 25 11:42:51 2018 +1100

bump $Errno::VERSION

commit 79c8ecffcf3a7e3c0396a470229f729a5dd383c6
Author: George Hartzell 
Date:   Wed Jan 24 13:36:10 2018 -0800

Typo: 'at alia' should be 'et alia'

---

Summary of changes:
 AUTHORS   | 1 +
 ext/Errno/Errno_pm.PL | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index e2c794510e..e5295161bc 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -438,6 +438,7 @@ Geoffrey F. Green   
 Geoffrey T. Dairiki
 Georg Schwarz  
 George Greer   
+George Hartzell
 George Necula  
 Geraint A Edwards  
 Gerard Goossen 
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index d345e98042..d565f31b2f 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
 use Config;
 use strict;
 
-our $VERSION = "1.28";
+our $VERSION = "1.29";
 
 my %err = ();
 
@@ -257,7 +257,7 @@ sub write_errno_pm {
my($name,$expr);
next unless ($name, $expr) = /"(.*?)"\s*\[\s*\[\s*(.*?)\s*\]\s*\]/;
next if $name eq $expr;
-   $expr =~ s/\(?\(\s*[a-z_]\w*\s*\)\(?([^\)]+)\)?\)?/$1/i; # 
((type)0xcafebabe) at alia
+   $expr =~ s/\(?\(\s*[a-z_]\w*\s*\)\(?([^\)]+)\)?\)?/$1/i; # 
((type)0xcafebabe) et alia
$expr =~ s/\b((?:0x)?[0-9a-f]+)[LU]+\b/$1/gi; # 2147483647L et alia
next if $expr =~ m/\b[a-z_]\w*\b/i; # skip expressions containing 
function names etc
if($expr =~ m/^0[xX]/) {

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/tonyc/127743-cperl-storable-fixes updated. v5.27.7-203-g0eb937de16

2018-01-28 Thread Tony Cook
In perl.git, the branch smoke-me/tonyc/127743-cperl-storable-fixes has been 
updated

<https://perl5.git.perl.org/perl.git/commitdiff/0eb937de163da00a0779e7c6c9674ca479778ca8?hp=9e081404a2589566d90c1c4eea0ad3e47a635165>

- Log -
commit 0eb937de163da00a0779e7c6c9674ca479778ca8
Author: Tony Cook 
Date:   Mon Jan 29 10:41:21 2018 +1100

(perl #127743) be more conservative on the default max recursion limits

I'm still seeing failures on a variety of platforms, and these limits
are fairly useful unless they prevent these crashes in a large
variety of circumstances.

---

Summary of changes:
 dist/Storable/stacksize | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/dist/Storable/stacksize b/dist/Storable/stacksize
index b390419b6b..3665d64d03 100644
--- a/dist/Storable/stacksize
+++ b/dist/Storable/stacksize
@@ -163,6 +163,12 @@ my $max_depth_hash = $n;
 # instead so a user setting of either variable more closely matches
 # the limits the use sees.
 
+# be fairly aggressive in trimming this, smoke testing showed several
+# several apparently random failures here, eg. working in one
+# configuration, but not in a very similar configuration.
+$max_depth = int(0.6 * $max_depth);
+$max_depth_hash = int(0.6 * $max_depth);
+
 my $stack_reserve = $^O eq "MSWin32" ? 32 : 16;
 if ($] ge "5.016" && !($^O eq "cygwin" && $ptrsize == 8)) {
 $max_depth -= $stack_reserve;

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-63-gd4fe620715

2018-01-30 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d4fe620715e0928f3ccf8a60d20c9393bbb3527f?hp=2b9519f04ca8ec89b5551bc43e2f67de293a9679>

- Log -
commit d4fe620715e0928f3ccf8a60d20c9393bbb3527f
Merge: 2b9519f04c 0a6ff07673
Author: Tony Cook 
Date:   Wed Jan 31 11:00:01 2018 +1100

(perl #132761) Devel::PPPort updates for older perls

commit 0a6ff076732e9ade9613a8567e7089c0c8e7d750
Author: Tony Cook 
Date:   Wed Jan 31 10:46:49 2018 +1100

bump $Devel::PPPort::VERSION to 3,39

commit 95afac5cb6951e84cb1a8c9a7af2f0eac829d512
Author: Pali 
Date:   Fri Jan 26 19:39:49 2018 +0100

Devel::PPPort: Use croak_nocontext() intead of croak() when dTHX is not 
declared

commit d397b1c445474100d5170622b04476ff92c1a55c
Author: Pali 
Date:   Fri Jan 26 19:39:14 2018 +0100

Devel::PPPort: Declare dTHX in croak_xs_usage()

CvGV() takes aTHX_ as first argument.

commit 0e9335ba6e82b9e22f7549f19b529b5feeced85a
Author: Tony Cook 
Date:   Thu Jan 25 14:39:54 2018 +1100

(perl #132761) croak_xs_usage() shouldn't accept a THX arguement

commit a4c10f7d47db969bf3e0044ff38f73fc5e3adda8
Author: Pali 
Date:   Tue Jan 23 23:36:06 2018 +0100

Devel::PPPort: Do not run tests which use \N{U+XX} on Perl 5.12.0

Perl 5.12.0 has bug when parsing \N{U+XX} syntax and throw error:
Invalid hexadecimal number in \N{U+...} in regex.

commit b2f1aa3851347cb95fc82b32e842fd4d6e8ed99c
Author: Pali 
Date:   Tue Jan 23 23:00:55 2018 +0100

Devel::PPPort: Do not define PERL_MAGIC_qr more times

make regen show warning: magic: PERL_MAGIC_qr already provided by misc

Remove it from misc, but because misc depends on it, put magic before misc.

commit 11eb46e92e3b89398d0d9878da8a5b434aaf563a
Author: Pali 
Date:   Tue Jan 23 22:50:20 2018 +0100

Devel::PPPort: Do not mask Perl_warn_nocontext and Perl_croak_nocontext

It cause compile errors on older threaded Perl versions.

---

Summary of changes:
 dist/Devel-PPPort/PPPort_pm.PL   |  6 +++---
 dist/Devel-PPPort/parts/inc/mess | 21 ++---
 dist/Devel-PPPort/parts/inc/misc |  3 ---
 dist/Devel-PPPort/t/mess.t   |  2 +-
 4 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/dist/Devel-PPPort/PPPort_pm.PL b/dist/Devel-PPPort/PPPort_pm.PL
index 983b6b44bc..15cfe63405 100644
--- a/dist/Devel-PPPort/PPPort_pm.PL
+++ b/dist/Devel-PPPort/PPPort_pm.PL
@@ -539,7 +539,7 @@ package Devel::PPPort;
 use strict;
 use vars qw($VERSION $data);
 
-$VERSION = '3.38';
+$VERSION = '3.39';
 
 sub _init_data
 {
@@ -620,6 +620,8 @@ __DATA__
 
 %include memory
 
+%include magic
+
 %include misc
 
 %include format
@@ -660,8 +662,6 @@ __DATA__
 
 %include pvs
 
-%include magic
-
 %include cop
 
 %include grok
diff --git a/dist/Devel-PPPort/parts/inc/mess b/dist/Devel-PPPort/parts/inc/mess
index d73b4e5605..eb2de7b15e 100644
--- a/dist/Devel-PPPort/parts/inc/mess
+++ b/dist/Devel-PPPort/parts/inc/mess
@@ -19,10 +19,8 @@ mess_nocontext
 mess
 
 warn_nocontext
-Perl_warn_nocontext
 
 croak_nocontext
-Perl_croak_nocontext
 
 croak_no_modify
 Perl_croak_no_modify
@@ -184,28 +182,20 @@ mess_sv(pTHX_ SV *basemsg, bool consume)
 #define warn_nocontext warn
 #endif
 
-#ifndef Perl_warn_nocontext
-#define Perl_warn_nocontext warn_nocontext
-#endif
-
 #ifndef croak_nocontext
 #define croak_nocontext croak
 #endif
 
-#ifndef Perl_croak_nocontext
-#define Perl_croak_nocontext croak_nocontext
-#endif
-
 #ifndef croak_no_modify
-#define croak_no_modify() croak("%s", PL_no_modify)
+#define croak_no_modify() croak_nocontext("%s", PL_no_modify)
 #define Perl_croak_no_modify() croak_no_modify()
 #endif
 
 #ifndef croak_memory_wrap
 #if { VERSION >= 5.9.2 } || ( { VERSION >= 5.8.6 } && { VERSION < 5.9.0 } )
-#  define croak_memory_wrap() croak("%s", PL_memory_wrap)
+#  define croak_memory_wrap() croak_nocontext("%s", PL_memory_wrap)
 #else
-#  define croak_memory_wrap() croak("panic: memory wrap")
+#  define croak_memory_wrap() croak_nocontext("panic: memory wrap")
 #endif
 #endif
 
@@ -216,8 +206,9 @@ mess_sv(pTHX_ SV *basemsg, bool consume)
 #ifndef croak_xs_usage
 #if { NEED croak_xs_usage }
 void
-croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
+croak_xs_usage(const CV *const cv, const char *const params)
 {
+dTHX;
 const GV *const gv = CvGV(cv);
 
 PERL_ARGS_ASSERT_CROAK_XS_USAGE;
@@ -435,7 +426,7 @@ if ($] ge '5.006') {
 
 if (ord('A') != 65) {
 skip 'skip: no ASCII support', 0 for 1..24;
-} elsif ($] ge '5.008') {
+} elsif ($] ge '5.008' && $] ne '5.012000') {
 undef $die;
 ok !defined eval { Devel::PPPort::croak_sv(eval '"\N{U+E1}\n"&#x

[perl.git] branch blead updated. v5.27.8-155-gbb4e4c3869

2018-02-05 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/bb4e4c3869d9fb6ee5bddd820c2a373601ecc310?hp=4bfb5532d393d56b18d13bc19f70f6f7a64ae781>

- Log -
commit bb4e4c3869d9fb6ee5bddd820c2a373601ecc310
Author: Tony Cook 
Date:   Tue Jan 30 16:40:53 2018 +1100

(perl #125351) abort parsing if parse errors happen in a sub lex

We've had a few reports of segmentation faults and other misbehaviour
when sub-parsing, such as within interpolated expressions, fails.

This change aborts compilation if anything complex enough to not be
parsed by the lexer is compiled in a sub-parse *and* an error
occurs within the sub-parse.

An earlier version of this patch failed on simpler expressions,
which caused many test failures, which this version doesn't (which may
just mean we need more tests...)

---

Summary of changes:
 parser.h |  2 ++
 t/base/lex.t | 11 ++-
 toke.c   | 18 ++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/parser.h b/parser.h
index 4187e0a93d..216e9deca8 100644
--- a/parser.h
+++ b/parser.h
@@ -58,6 +58,7 @@ typedef struct yy_parser {
   1 = @{...}  2 = ->@ */
 U8 expect; /* how to interpret ambiguous tokens */
 bool   preambled;
+boolsub_no_recover; /* can't recover from a sublex error */
 I32lex_formbrack;  /* bracket count at outer format level 
*/
 OP *lex_inpat; /* in pattern $) and $| are special */
 OP *lex_op;/* extra info to pass back on op */
@@ -95,6 +96,7 @@ typedef struct yy_parser {
 U16in_my;  /* we're compiling a "my"/"our" 
declaration */
 U8 lex_state;  /* next token is determined */
 U8 error_count;/* how many compile errors so far, max 10 */
+U8 sub_error_count; /* the number of errors before sublexing */
 HV *in_my_stash;   /* declared class of this "my" declaration */
 PerlIO *rsfp;  /* current source file pointer */
 AV *rsfp_filters;  /* holds chain of active source filters */
diff --git a/t/base/lex.t b/t/base/lex.t
index de33e7a688..414aa1fceb 100644
--- a/t/base/lex.t
+++ b/t/base/lex.t
@@ -1,6 +1,6 @@
 #!./perl
 
-print "1..117\n";
+print "1..120\n";
 
 $x = 'x';
 
@@ -557,6 +557,15 @@ eval q|s##[}#e|;
  eval ('/@0{0*->@*/*]');
  print "ok $test - 128171\n"; $test++;
 }
+{
+  # various sub-parse recovery issues that crashed perl
+  eval 's//${sub{b{]]]{}#$/ sub{}';
+  print "ok $test - 132640\n"; $test++;
+  eval 'qq{@{sub{]];shift';
+  print "ok $test - 125351\n"; $test++;
+  eval 'qq{@{sub{]]-shift';
+  print "ok $test - 126192\n"; $test++;
+}
 
 $foo = "WRONG"; $foo:: = "bar"; $bar = "baz";
 print "not " unless "$foo::$bar" eq "barbaz";
diff --git a/toke.c b/toke.c
index 4e0c3c3189..9f37f53ba4 100644
--- a/toke.c
+++ b/toke.c
@@ -2390,6 +2390,8 @@ S_sublex_start(pTHX)
 PL_parser->lex_super_state = PL_lex_state;
 PL_parser->lex_sub_inwhat = (U16)op_type;
 PL_parser->lex_sub_op = PL_lex_op;
+PL_parser->sub_no_recover = FALSE;
+PL_parser->sub_error_count = PL_error_count;
 PL_lex_state = LEX_INTERPPUSH;
 
 PL_expect = XTERM;
@@ -2569,6 +2571,20 @@ S_sublex_done(pTHX)
 else {
const line_t l = CopLINE(PL_curcop);
LEAVE;
+if (PL_parser->sub_error_count != PL_error_count) {
+const char * const name = OutCopFILE(PL_curcop);
+if (PL_parser->sub_no_recover) {
+const char * msg = "";
+if (PL_in_eval) {
+SV *errsv = ERRSV;
+if (SvCUR(ERRSV)) {
+msg = Perl_form(aTHX_ "%" SVf, SVfARG(errsv));
+}
+}
+abort_execution(msg, name);
+NOT_REACHED;
+}
+}
if (PL_multi_close == '<')
PL_parser->herelines += l - PL_multi_end;
PL_bufend = SvPVX(PL_linestr);
@@ -4157,6 +4173,7 @@ S_intuit_more(pTHX_ char *s, char *e)
return TRUE;
 if (*s != '{' && *s != '[')
return FALSE;
+PL_parser->sub_no_recover = TRUE;
 if (!PL_lex_inpat)
return TRUE;
 
@@ -9580,6 +9597,7 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, 
I32 ck_uni)
 CopLINE_set(PL_curcop, orig_copline);
 PL_parser->herelines = herelines;
*dest = '\0';
+PL_parser->sub_no_recover = TRUE;
}
 }
 else if (   PL_lex_state == LEX_INTERPNORMAL

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-156-g084ed71b2c

2018-02-05 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/084ed71b2c938c47d8ff7e92e8cbd84f598779d3?hp=bb4e4c3869d9fb6ee5bddd820c2a373601ecc310>

- Log -
commit 084ed71b2c938c47d8ff7e92e8cbd84f598779d3
Author: Tony Cook 
Date:   Tue Feb 6 10:57:26 2018 +1100

perldelta for bb4e4c3869d9

---

Summary of changes:
 pod/perldelta.pod | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 1582af6808..4c488804d7 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -369,7 +369,14 @@ files in F and F are best summarized in 
L.
 
 =item *
 
-XXX
+Failures while compiling code within other constructs, such as with
+string interpolation and the right part of C now cause
+compilation to abort earlier.
+
+Previously compilation could continue in order to report other errors,
+but the failed sub-parse could leave partly parsed constructs on the
+parser shift-reduce stack, confusing the parser, leading to perl
+crashes. [perl #125351]
 
 =back
 

-- 
Perl5 Master Repository


[perl.git] branch maint-votes updated. 92bbe1f3f9ded80e8acddb641e0b2fb05ee5565e

2018-02-06 Thread Tony Cook
In perl.git, the branch maint-votes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/92bbe1f3f9ded80e8acddb641e0b2fb05ee5565e?hp=69df0ce8cf463d8af3aed2d4994d4ebc8280bed2>

- Log -
commit 92bbe1f3f9ded80e8acddb641e0b2fb05ee5565e
Author: Tony Cook 
Date:   Wed Feb 7 14:15:11 2018 +1100

add fix for 132593 for 5.24/5.26 votes

---

Summary of changes:
 votes-5.24.xml | 2 ++
 votes-5.26.xml | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/votes-5.24.xml b/votes-5.24.xml
index 50b2d9b874..7f10b2bcab 100644
--- a/votes-5.24.xml
+++ b/votes-5.24.xml
@@ -33,6 +33,8 @@ There doesn't seem to be a blead commit for this ticket, so 
nothing to backport.
 Correct: As noted on the ticket, it was listed here in the hope that it could 
be fixed in time, but it hasn't happened yet. -steveh
 
 
+
+
 
 
 Regression Fixes
diff --git a/votes-5.26.xml b/votes-5.26.xml
index 9cefd8e075..dbc9341c65 100644
--- a/votes-5.26.xml
+++ b/votes-5.26.xml
@@ -29,6 +29,8 @@ The same criteria apply to code in dual-life modules as to 
core code.)
 
 Crash / Assertion / Memory Corruption Fixes
 
+
+
 
 
 Regression Fixes

-- 
Perl5 Master Repository


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

2018-02-07 Thread Tony Cook
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 
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 
Date:   Tue Jan 16 15:50:24 2018 +1100

bump $Storable::VERSION to 3.06

commit 5b1bc10167d01c4a9a1fa41a7ac852a825233b82
Author: Tony Cook 
Date:   Wed Feb 7 15:56:24 2018 +1100

(perl #127743) update Changes

commit c0e3b4b51cabf15ed8fc5f564dfeea31c25f5239
Author: Tony Cook 
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 
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 
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 
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 
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 
Date:   Thu Dec 7 01:47:47 2017 +0100

(perl #131136) clear padding before writing long doubles

This means:

- val

[perl.git] branch blead updated. v5.27.8-248-g95634b11ca

2018-02-11 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/95634b11ca08a0894253d3b2939f815ef86600c3?hp=a7caeb5ea5f808dade098c97e87d3354b994f68f>

- Log -
commit 95634b11ca08a0894253d3b2939f815ef86600c3
Author: Tony Cook 
Date:   Mon Feb 12 11:07:14 2018 +1100

bump $warnings::VERSION

since warnings.(pm|pl) was updated in 25ebbc2270

---

Summary of changes:
 lib/warnings.pm   | 2 +-
 regen/warnings.pl | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/warnings.pm b/lib/warnings.pm
index 911c5aad5a..7b7540ca64 100644
--- a/lib/warnings.pm
+++ b/lib/warnings.pm
@@ -5,7 +5,7 @@
 
 package warnings;
 
-our $VERSION = "1.40";
+our $VERSION = "1.41";
 
 # Verify that we're called correctly so that warnings will work.
 # Can't use Carp, since Carp uses us!
diff --git a/regen/warnings.pl b/regen/warnings.pl
index ef2d16999b..d9243a6b11 100644
--- a/regen/warnings.pl
+++ b/regen/warnings.pl
@@ -16,7 +16,7 @@
 #
 # This script is normally invoked from regen.pl.
 
-$VERSION = '1.40';
+$VERSION = '1.41';
 
 BEGIN {
 require './regen/regen_lib.pl';

-- 
Perl5 Master Repository


[perl.git] branch tonyc/132849-stacksize-core-files created. v5.27.8-250-ged09a16519

2018-02-11 Thread Tony Cook
In perl.git, the branch tonyc/132849-stacksize-core-files has been created

<https://perl5.git.perl.org/perl.git/commitdiff/ed09a16519577b7438c703ede12cbf91cbe88850?hp=>

at  ed09a16519577b7438c703ede12cbf91cbe88850 (commit)

- Log -
commit ed09a16519577b7438c703ede12cbf91cbe88850
Author: Tony Cook 
Date:   Mon Feb 12 11:02:26 2018 +1100

(perl #127743) remove the no longer needed stacksize_in.h

I should have removed this when I changed the limits from being baked
into the binary.

commit 75d799cca5ab94cbf0a0d101ed865b64dd582635
Author: Tony Cook 
Date:   Mon Feb 12 10:50:24 2018 +1100

(perl #132849) try to disable core files when deliberatly segfaulting

The dist/Storable/stacksize tool probes for recursion limits for
Storable, in an attempt to prevent stack overflows, and causes
segfaults when the probes exceed the available stack size.

This was leaving a core file for each failure (whether that ended
up as a single file or one for each segfault depended on the
system settings).

Try to probe for the ulimit -c option and if it doesn't cause an
error, prefix the command used to probe for recursion limits.

Ideally I could use setrlimit() for this, but we don't expose it in
core, nor in POSIX.pm, and adding it wouldn't help for the older
perls that Storable needs to build for.

---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-251-gc16e7f9832

2018-02-11 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/c16e7f98327a78a23d0eba94da62bf70782165ae?hp=48151d4db91e290cc3646c7116cd1be14316a2de>

- Log -
commit c16e7f98327a78a23d0eba94da62bf70782165ae
Author: Tony Cook 
Date:   Mon Feb 12 11:02:26 2018 +1100

(perl #127743) remove the no longer needed stacksize_in.h

I should have removed this when I changed the limits from being baked
into the binary.

commit 7ec112d2a5ff7c80b00801e1c94308e3709d68df
Author: Tony Cook 
Date:   Mon Feb 12 10:50:24 2018 +1100

(perl #132849) try to disable core files when deliberatly segfaulting

The dist/Storable/stacksize tool probes for recursion limits for
Storable, in an attempt to prevent stack overflows, and causes
segfaults when the probes exceed the available stack size.

This was leaving a core file for each failure (whether that ended
up as a single file or one for each segfault depended on the
system settings).

Try to probe for the ulimit -c option and if it doesn't cause an
error, prefix the command used to probe for recursion limits.

Ideally I could use setrlimit() for this, but we don't expose it in
core, nor in POSIX.pm, and adding it wouldn't help for the older
perls that Storable needs to build for.

---

Summary of changes:
 MANIFEST | 1 -
 dist/Storable/Makefile.PL| 8 +---
 dist/Storable/stacksize  | 8 +++-
 dist/Storable/stacksize_in.h | 2 --
 4 files changed, 8 insertions(+), 11 deletions(-)
 delete mode 100644 dist/Storable/stacksize_in.h

diff --git a/MANIFEST b/MANIFEST
index 41e1383f40..a5478f909d 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3679,7 +3679,6 @@ dist/Storable/hints/linux.pl  Hint for 
Storable for named architecture
 dist/Storable/Makefile.PL  Storable extension
 dist/Storable/README   Storable extension
 dist/Storable/stacksizecompute 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
diff --git a/dist/Storable/Makefile.PL b/dist/Storable/Makefile.PL
index 0878ce5c42..2e0c79c833 100644
--- a/dist/Storable/Makefile.PL
+++ b/dist/Storable/Makefile.PL
@@ -10,13 +10,7 @@ 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;
-}
+unlink "lib/Storable/Limit.pm";
 
 my $pm = { 'Storable.pm' => '$(INST_ARCHLIB)/Storable.pm' };
 unless ($ENV{PERL_CORE}) {
diff --git a/dist/Storable/stacksize b/dist/Storable/stacksize
index 3665d64d03..394e6aab23 100644
--- a/dist/Storable/stacksize
+++ b/dist/Storable/stacksize
@@ -30,6 +30,7 @@ sub is_miniperl {
 if (is_miniperl()) {
 die "Should not run during miniperl\n";
 }
+my $prefix = "";
 if ($^O eq "MSWin32") {
 # prevent Windows popping up a dialog each time we overflow
 # the stack
@@ -37,6 +38,11 @@ if ($^O eq "MSWin32") {
 Win32API::File->import(qw(SetErrorMode SEM_NOGPFAULTERRORBOX 
SEM_FAILCRITICALERRORS));
 SetErrorMode(SEM_NOGPFAULTERRORBOX() | SEM_FAILCRITICALERRORS());
 }
+# the ; here is to ensure system() passes this to the shell
+elsif (system("ulimit -c 0 ;") == 0) {
+# try to prevent core dumps
+$prefix = "ulimit -c 0 ; ";
+}
 if (@ARGV and $ARGV[0] eq '--core') {
 $ENV{PERL_CORE} = 1;
 }
@@ -91,7 +97,7 @@ sub cmd {
 my $code = "my \$t; \$Storable::$limit_name = -1; $try for 
1..$i;dclone(\$t);";
 my $q = ($^O eq 'MSWin32') ? '"' : "'";
 
-"$PERL $mblib -MStorable=dclone -e$q$code$q"
+"$prefix $PERL $mblib -MStorable=dclone -e$q$code$q"
 }
 # try more
 sub good {
diff --git a/dist/Storable/stacksize_in.h b/dist/Storable/stacksize_in.h
deleted file mode 100644
index 8c074f6ab9..00
--- a/dist/Storable/stacksize_in.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* initially empty */
-#undef PST_STACK_MAX_DEPTH

-- 
Perl5 Master Repository


[perl.git] branch tonyc/132849-stacksize-core-files deleted. v5.27.8-250-ged09a16519

2018-02-13 Thread Tony Cook
In perl.git, the branch tonyc/132849-stacksize-core-files has been deleted



   was  ed09a16519577b7438c703ede12cbf91cbe88850

- Log -
ed09a16519577b7438c703ede12cbf91cbe88850 (perl #127743) remove the no longer 
needed stacksize_in.h
---

-- 
Perl5 Master Repository


[perl.git] branch tonyc/132867-openpid-delay created. v5.27.8-258-g38350e5370

2018-02-14 Thread Tony Cook
In perl.git, the branch tonyc/132867-openpid-delay has been created

<https://perl5.git.perl.org/perl.git/commitdiff/38350e53702d28f072f80311bc943afead03ef89?hp=>

at  38350e53702d28f072f80311bc943afead03ef89 (commit)

- Log -
commit 38350e53702d28f072f80311bc943afead03ef89
Author: Tony Cook 
Date:   Tue Jan 28 15:52:22 2014 +1100

[perl #121028] avoid creating a shell process

---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-258-gb6811f8d3a

2018-02-14 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/b6811f8d3a5c4826ad03be7b9dc69f5f3dc939be?hp=aed76e69bd9a87baa8ab250f3e953beb2779f66e>

- Log -
commit b6811f8d3a5c4826ad03be7b9dc69f5f3dc939be
Author: Tony Cook 
Date:   Tue Jan 28 15:52:22 2014 +1100

[perl #121028] avoid creating a shell process

Win32 now has list form open, so this can now be supplied.

---

Summary of changes:
 t/io/openpid.t | 20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/t/io/openpid.t b/t/io/openpid.t
index d3fcf7869a..634330ded7 100644
--- a/t/io/openpid.t
+++ b/t/io/openpid.t
@@ -23,11 +23,15 @@ watchdog(15, $^O eq 'MSWin32' ? "alarm" : '');
 use Config;
 $| = 1;
 $SIG{PIPE} = 'IGNORE';
+# reset the handler in case the shell has set a broken default
+$SIG{HUP} = 'DEFAULT';
 $SIG{HUP} = 'IGNORE' if $^O eq 'interix';
 
 my $perl = which_perl();
 $perl .= qq[ "-I../lib"];
 
+my @perl = ( which_perl(), "-I../lib" );
+
 #
 # commands run 4 perl programs.  Two of these programs write a
 # short message to STDOUT and exit.  Two of these programs
@@ -35,16 +39,22 @@ $perl .= qq[ "-I../lib"];
 # the other reader reads one line, waits a few seconds and then
 # exits to test the waitpid function.
 #
-$cmd1 = qq/$perl -e "\$|=1; print qq[first process\\n]; sleep 30;"/;
-$cmd2 = qq/$perl -e "\$|=1; print qq[second process\\n]; sleep 30;"/;
+# Using 4+ arg open for the children that sleep so that that we're
+# killing the perl process instead of an intermediate shell, this
+# allows harness to see the file handles closed sooner.  I didn't
+# convert them all since I wanted 3-arg open to continue to be
+# exercised here.
+#
+@cmd1 = ( @perl, "-e", "\$|=1; print qq[first process\\n]; sleep 30;" );
+@cmd2 = ( @perl, "-e", "\$|=1; print qq[second process\\n]; sleep 30;" );
 $cmd3 = qq/$perl -e "print <>;"/; # hangs waiting for end of STDIN
 $cmd4 = qq/$perl -e "print scalar <>;"/;
 
-#warn "#$cmd1\n#$cmd2\n#$cmd3\n#$cmd4\n";
+#warn "#@cmd1\n#@cmd2\n#$cmd3\n#$cmd4\n";
 
 # start the processes
-ok( $pid1 = open(FH1, "$cmd1 |"), 'first process started');
-ok( $pid2 = open(FH2, "$cmd2 |"), 'second' );
+ok( $pid1 = open(FH1, "-|", @cmd1), 'first process started');
+ok( $pid2 = open(FH2, "-|", @cmd2), 'second' );
 {
 no warnings 'once';
 ok( $pid3 = open(FH3, "| $cmd3"), 'third'  );

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-259-g2a897ae913

2018-02-14 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/2a897ae9131d5aba8d29f80b93ce867ace7c2d73?hp=b6811f8d3a5c4826ad03be7b9dc69f5f3dc939be>

- Log -
commit 2a897ae9131d5aba8d29f80b93ce867ace7c2d73
Author: Tony Cook 
Date:   Thu Feb 15 14:52:33 2018 +1100

perldelta for b6811f8d3a5c

---

Summary of changes:
 pod/perldelta.pod | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 4c488804d7..24de56e1bb 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -283,7 +283,8 @@ made:
 
 =item *
 
-XXX
+F no longer waits for 30 seconds when running
+F.  [perl #121028][perl #132867]
 
 =back
 

-- 
Perl5 Master Repository


[perl.git] branch tonyc/blead-feb18 created. v5.27.8-361-gf6faa7f3a5

2018-02-20 Thread Tony Cook
In perl.git, the branch tonyc/blead-feb18 has been created

<https://perl5.git.perl.org/perl.git/commitdiff/f6faa7f3a5be98e726a16c68b3c31f195936aeb3?hp=>

at  f6faa7f3a5be98e726a16c68b3c31f195936aeb3 (commit)

- Log -
commit f6faa7f3a5be98e726a16c68b3c31f195936aeb3
Author: Karl Williamson 
Date:   Tue Feb 13 07:03:43 2018 -0700

utf8.c: Don't dump malformation past first NUL

When a UTF-8 string contains a malformation, the bytes are dumped out as
a debugging aid.  One should exercise caution, however, and not dump out
bytes that are actually past the end of the string.  Commit 99a765e9e37
from 2016 added the capability to signal to the dumping routines that
we're not sure where the string ends, and to dump the minimal possible.

It occurred to me that an additional safety measure can be easily added,
which this commit does.  And that is, in the dumping routines to stop at
the first NUL.  All strings automatically get a traiing NUL added, even
if they contain embedded NULs.  A NUL can never be part of a
malformation, and so its presence likely signals the end of the string.

commit 8b54f9039f2c06ca8902081e71b50739971ba30d
Author: Tony Cook 
Date:   Mon Feb 19 15:11:42 2018 +1100

(perl #132063) we should no longer warn for this code

The first patch for 132063 prevented the buffer read overflow when
dumping the warning but didn't fix the underlying problem.

The next change treats the supplied buffer correctly, preventing the
non-UTF-8 SV from being treated as UTF-8, preventing the warning.

commit b5ea8f6258b2a8a6acd6e64148c315eca5739b64
Author: Yves Orton 
Date:   Wed Feb 14 10:29:26 2018 +1100

fix TRIE_READ_CHAR and DECL_TRIE_TYPE to account for non-utf8 target

commit 68b5aa63052d6c9c9214256d689065cff84bd11e
Author: Karl Williamson 
Date:   Tue Feb 6 14:50:48 2018 -0700

[perl #132063]: Heap buffer overflow

The proximal cause is several instances in regexec.c of the code
assuming that the input was valid UTF-8, whereas the input was too short
for what the start byte claimed it would be.

I grepped through the core for any other similar uses, and did not find
any.

commit c5996e13f9b8d434ce31e690099511ea29854988
Author: Tony Cook 
Date:   Tue Aug 8 09:32:58 2017 +1000

(perl #131844) fix various space calculation issues in pp_pack.c

- for the originally reported case, if the start/cur pointer is in the
  top 75% of the address space the add (cur) + glen addition would
  overflow, resulting in the condition failing incorrectly.

- the addition of the existing space used to the space needed could
  overflow, resulting in too small an allocation and a buffer overflow.

- the scaling for UTF8 could overflow.

- the multiply to calculate the space needed for many items could
  overflow.

For the first case, do a space calculation without making new pointers.

For the other cases, detect the overflow and croak if there's an
overflow.

---

-- 
Perl5 Master Repository


[perl.git] branch tonyc/blead-feb18 deleted. v5.27.8-361-gf6faa7f3a5

2018-02-20 Thread Tony Cook
In perl.git, the branch tonyc/blead-feb18 has been deleted



   was  f6faa7f3a5be98e726a16c68b3c31f195936aeb3

- Log -
f6faa7f3a5be98e726a16c68b3c31f195936aeb3 utf8.c: Don't dump malformation past 
first NUL
---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-401-g3d79e577a7

2018-02-25 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3d79e577a768f4ffbe0d25be5bcf58ae9d112001?hp=4efd247d4c712a390e5c79db522ef527f439ad6b>

- Log -
commit 3d79e577a768f4ffbe0d25be5bcf58ae9d112001
Author: Tony Cook 
Date:   Tue Feb 20 10:10:34 2018 +1100

suppress error messages from the shell when probing Storable limits

commit f73ae54b0323e4c8ed1192ec7b9807eebfc8c1c9
Author: Tony Cook 
Date:   Tue Feb 20 10:09:44 2018 +1100

make the Storable stacksize messages less scary

commit 8175eebc327f4502765433f742a50d661d0a3ac5
Author: Tony Cook 
Date:   Mon Feb 26 15:04:20 2018 +1100

(perl #127743) don't probe Storable limits so much

Previously any rebuild on the perl executable or the shared library
would re-run the Storable recursion limit probing.  Only do so
if the Storable binary or Storable.pm is rebuilt.

This needs to be ported to the Win32 makefiles too.

---

Summary of changes:
 Makefile.SH   | 2 +-
 dist/Storable/Makefile.PL | 8 ++--
 dist/Storable/stacksize   | 9 +++--
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/Makefile.SH b/Makefile.SH
index 486953a0bd..d776e63f56 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -1163,7 +1163,7 @@ if test "$storable_type" != "" ; then
 $spitshell >>$Makefile <= $i) {
 $j = $good;
@@ -123,6 +124,10 @@ sub bad {
 return $j;
 }
 
+unless ($ENV{STORABLE_NOISY}) {
+# suppress Segmentation fault messages
+open STDERR, ">", File::Spec->devnull;
+}
 while (!$found) {
 my $cmd = cmd($n, '$t=[$t]', 'recursion_limit');
 #print "$cmd\n" unless $QUIET;

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-404-gb58c2b0d98

2018-02-26 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/b58c2b0d98b34cdb1e784267c831fc2feedfe199?hp=9fa1876f8c85a45e62dadb781de3c3a20361cd6f>

- Log -
commit b58c2b0d98b34cdb1e784267c831fc2feedfe199
Author: Tony Cook 
Date:   Tue Feb 27 10:50:35 2018 +1100

(perl #127743) don't probe Storable limits so much (Win32 makefiles)

Win32 port of the changes in 8175eebc32

---

Summary of changes:
 win32/GNUmakefile | 2 +-
 win32/Makefile| 2 +-
 win32/makefile.mk | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/win32/GNUmakefile b/win32/GNUmakefile
index 631366c9fd..c81a825642 100644
--- a/win32/GNUmakefile
+++ b/win32/GNUmakefile
@@ -1602,7 +1602,7 @@ PostExt : ..\lib\Storable\Limit.pm
 # we need the exe, perl(ver).dll, and the Exporter, Storable, Win32 extensions
 # rebasePE covers just about that, including adjustment for static builds
 ..\lib\Storable\Limit.pm : rebasePE
-   $(PERLEXE) -I..\lib -I. ..\dist\Storable\stacksize --core
+   $(PLMAKE) -C ..\dist\Storable lib\Storable\Limit.pm
if not exist ..\lib\Storable mkdir ..\lib\Storable
copy ..\dist\Storable\lib\Storable\Limit.pm ..\lib\Storable\Limit.pm
 
diff --git a/win32/Makefile b/win32/Makefile
index 3889ff9ec5..108022990b 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -1228,7 +1228,7 @@ Extensions_realclean:
 PostExt: ..\lib\Storable\Limit.pm
 
 ..\lib\Storable\Limit.pm: $(PERLEXE) Extensions
-   $(PERLEXE) -I..\lib -I. ..\dist\Storable\stacksize --core
+   cd ..\dist\Storable && $(MAKE) lib\Storable\Limit.pm
if not exist ..\lib\Storable mkdir ..\lib\Storable
copy ..\dist\Storable\lib\Storable\Limit.pm ..\lib\Storable\Limit.pm
 
diff --git a/win32/makefile.mk b/win32/makefile.mk
index e2d53cfd91..78f2d1fbb1 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -1554,7 +1554,7 @@ PostExt : ..\lib\Storable\Limit.pm
 # we need the exe, perl(ver).dll, and the Exporter, Storable, Win32 extensions
 # rebasePE covers just about that, including adjustment for static builds
 ..\lib\Storable\Limit.pm : rebasePE
-   $(PERLEXE) -I..\lib -I. ..\dist\Storable\stacksize --core
+   cd ..\dist\Storable && $(MAKE) lib\Storable\Limit.pm
if not exist ..\lib\Storable mkdir ..\lib\Storable
copy ..\dist\Storable\lib\Storable\Limit.pm ..\lib\Storable\Limit.pm
 

-- 
Perl5 Master Repository


[perl.git] branch tonyc/stacksize-xp created. v5.27.8-413-g2b0e1a9e90

2018-02-27 Thread Tony Cook
In perl.git, the branch tonyc/stacksize-xp has been created

<https://perl5.git.perl.org/perl.git/commitdiff/2b0e1a9e90843f6d924dad756cd6a2bec596784e?hp=>

at  2b0e1a9e90843f6d924dad756cd6a2bec596784e (commit)

- Log -
commit 2b0e1a9e90843f6d924dad756cd6a2bec596784e
Author: Tony Cook 
Date:   Wed Feb 28 16:43:07 2018 +1100

(perl #132893) don't probe for Storable recursion limits on old Win32

---

-- 
Perl5 Master Repository


[perl.git] branch tonyc/stacksize-xp deleted. v5.27.8-413-g2b0e1a9e90

2018-02-27 Thread Tony Cook
In perl.git, the branch tonyc/stacksize-xp has been deleted



   was  2b0e1a9e90843f6d924dad756cd6a2bec596784e

- Log -
2b0e1a9e90843f6d924dad756cd6a2bec596784e (perl #132893) don't probe for 
Storable recursion limits on old Win32
---

-- 
Perl5 Master Repository


[perl.git] branch tonyc/stacksize-xp created. v5.27.8-413-g294b566cb0

2018-02-27 Thread Tony Cook
In perl.git, the branch tonyc/stacksize-xp has been created

<https://perl5.git.perl.org/perl.git/commitdiff/294b566cb0473b53ae94616c3abbf47c13a16409?hp=>

at  294b566cb0473b53ae94616c3abbf47c13a16409 (commit)

- Log -
commit 294b566cb0473b53ae94616c3abbf47c13a16409
Author: Tony Cook 
Date:   Wed Feb 28 16:43:07 2018 +1100

(perl #132893) don't probe for Storable recursion limits on old Win32

---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-415-ga2d15b8e65

2018-02-28 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/a2d15b8e6535fde483485731bed6021643860765?hp=cbb1ea618afe3f0d652a7900aa8f9361d6495f2b>

- Log -
commit a2d15b8e6535fde483485731bed6021643860765
Author: Tony Cook 
Date:   Wed Feb 28 16:43:07 2018 +1100

(perl #132893) don't probe for Storable recursion limits on old Win32

---

Summary of changes:
 dist/Storable/stacksize | 21 +
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/dist/Storable/stacksize b/dist/Storable/stacksize
index 5ea40dab8c..54cd947c53 100644
--- a/dist/Storable/stacksize
+++ b/dist/Storable/stacksize
@@ -33,6 +33,13 @@ if (is_miniperl()) {
 }
 my $prefix = "";
 if ($^O eq "MSWin32") {
+require Win32;
+my ($str, $major, $minor) = Win32::GetOSVersion();
+if ($major < 6 || $major == 6 && $minor < 1) {
+   print "Using defaults for older Win32\n";
+   write_limits(500, 256);
+   exit;
+}
 # prevent Windows popping up a dialog each time we overflow
 # the stack
 require Win32API::File;
@@ -192,9 +199,13 @@ else {
 $max_depth_hash = ($max_depth_hash >> 1) - $stack_reserve * 2;
 }
 
-my $f;
-open $f, ">", $fn or die "$fn $!";
-print $f <", $fn or die "$fn $!";
+print $f <

[perl.git] branch tonyc/stacksize-xp deleted. v5.27.8-413-g294b566cb0

2018-02-28 Thread Tony Cook
In perl.git, the branch tonyc/stacksize-xp has been deleted



   was  294b566cb0473b53ae94616c3abbf47c13a16409

- Log -
294b566cb0473b53ae94616c3abbf47c13a16409 (perl #132893) don't probe for 
Storable recursion limits on old Win32
---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-416-g1c8104f6f4

2018-02-28 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 1c8104f6f402c92bd12af877323398749dec28a8
Author: Daniel Dragan 
Date:   Sun Feb 18 02:57:39 2018 -0500

remove unused var in sv_eq_flags

svrecode became unused in commit 8df0e7a28b
"Remove IN_ENCODING macro, and all code dependent on it" but there was
still a SvREFCNT_dec(NULL) executed at the end of the function. This
commit will reduce size of Perl_sv_eq_flags by the CC not having to
save var eq to a non-volatile register or stack location around the
SvREFCNT_dec func call and instead store var eq in the return register
directly. Also remove the eq var completly, since initializing the var
so early means it has to be stored on the stack around alot func calls,
so just do a direct return of const zero on the only "fall off the end"
path in the func.

---

Summary of changes:
 sv.c | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sv.c b/sv.c
index 1aa5966489..2475d46bf5 100644
--- a/sv.c
+++ b/sv.c
@@ -7802,8 +7802,6 @@ Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
 STRLEN cur1;
 const char *pv2;
 STRLEN cur2;
-I32  eq = 0;
-SV* svrecode = NULL;
 
 if (!sv1) {
pv1 = "";
@@ -7843,11 +7841,9 @@ Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
 }
 
 if (cur1 == cur2)
-   eq = (pv1 == pv2) || memEQ(pv1, pv2, cur1);
-   
-SvREFCNT_dec(svrecode);
-
-return eq;
+   return (pv1 == pv2) || memEQ(pv1, pv2, cur1);
+else
+   return 0;
 }
 
 /*

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-417-g4ac5f10b75

2018-02-28 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 4ac5f10b7537a9008856dd6cd7a9fd94e0dffc32
Author: Daniel Dragan 
Date:   Wed Feb 28 19:42:19 2018 -0500

regen/regcomp.pl: close FH before unlink

On Win32, regen.pl failed if something caused different checksum for
perldebguts.pod and the old file was attempted to be unlinked/renamed, but
that was failing because the FH is still open (Win32 specific thing).
So close the FH before renaming the file instead of having scope exit close
the FH after close_and_rename() executes.

the fixed error console log:

changed 'pod/perldebguts.pod-new' to 'pod/perldebguts.pod'
Couldn't unlink pod/perldebguts.pod: Permission denied
renaming pod/perldebguts.pod-new to pod/perldebguts.pod: Permission denied 
at ./
regen/regen_lib.pl line 120, <$oldguts> line 1046.
Changed: pod/perldebguts.pod
C:\perl\bin\perl.exe -I. regen/regcomp.pl -v failed: 3328 at regen.pl line 
20, <
DATA> line 8.

---

Summary of changes:
 regen/regcomp.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/regen/regcomp.pl b/regen/regcomp.pl
index 88c0ac9b81..ffb7d7a13f 100644
--- a/regen/regcomp.pl
+++ b/regen/regcomp.pl
@@ -649,7 +649,8 @@ END_OF_DESCR
 while (<$oldguts>) {
 last if /=for regcomp.pl end/;
 }
-do { print } while <$oldguts>;
+do { print } while <$oldguts>; #win32 can't unlink an open FH
+close $oldguts or die "Error closing pod/perldebguts.pod: $!";
 select $old_fh;
 close_and_rename($guts);
 }

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.9-112-g74e28a4a73

2018-03-05 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/74e28a4a737c72840f2576bed7ebacf4a288760e?hp=c0221e16334efbe9723722578949dc3916d669d4>

- Log -
commit 74e28a4a737c72840f2576bed7ebacf4a288760e
Author: Tony Cook 
Date:   Thu Mar 1 15:42:56 2018 +1100

(perl #132925) don't use $0 to get the name of mk_invlists.pl

Other regen scripts simply embed the name as a literal, using $0
means that the output varies depending on the path used to call
regen/mk_invlists.pl.

commit b857191d01c23df63dc1112e443b194a13305179
Author: Tony Cook 
Date:   Thu Mar 1 15:26:22 2018 +1100

(perl #132925) correct path handling in mktables

the lexical my $file inside the loop masked the for loop $file,
wasting the work done to canonicalize the path names.

The grep on length is required since splitdir() can return empty
strings.

---

Summary of changes:
 charclass_invlists.h |  4 ++--
 lib/unicore/mktables |  6 +++---
 regcharclass.h   |  2 +-
 regen/mk_invlists.pl | 11 ++-
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/charclass_invlists.h b/charclass_invlists.h
index 72f91e397a..6adcb56c99 100644
--- a/charclass_invlists.h
+++ b/charclass_invlists.h
@@ -109534,8 +109534,8 @@ static const U8 WB_table[24][24] = {
  * be0f129691d479aa38646e4ca0ec1ee576ae7f75b0300a5624a7fa862fa8abba 
lib/unicore/extracted/DLineBreak.txt
  * 92449d354d9f6b6f2f97a292ebb59f6344ffdeb83d120d7d23e569c43ba67cd5 
lib/unicore/extracted/DNumType.txt
  * e3a319527153b0c6c0c549b40fc6f3a01a7a0dcd6620784391db25901df3b154 
lib/unicore/extracted/DNumValues.txt
- * 5671c3de473b25e7ea47097e4906260624dfabe3e9b1739f490aecbc3d858459 
lib/unicore/mktables
+ * 823b41f276979dd5e2df12f0c7339f3d1aa2c805848958f31ddc549cb11bed9f 
lib/unicore/mktables
  * 21653d2744fdd071f9ef138c805393901bb9547cf3e777ebf50215a191f986ea 
lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c 
regen/charset_translations.pl
- * ddcc2a146f5202e3fb5fa448eded5e53b49db82e436a742ca37b8cee15179148 
regen/mk_invlists.pl
+ * 320fca42ad27e06f90c9ea242cd22d7fcf9ccfde7d21a3a0eda01b3c13ad25e2 
regen/mk_invlists.pl
  * ex: set ro: */
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index c6436723d5..88d9c036a3 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -20230,9 +20230,9 @@ if ( $file_list and $make_list ) {
 
 print "Updating '$file_list'\n" if $verbosity >= $PROGRESS;
 foreach my $file (@input_files, @files_actually_output) {
-my (undef, $directories, $file) = File::Spec->splitpath($file);
-my @directories = File::Spec->splitdir($directories);
-$file = join '/', @directories, $file;
+my (undef, $directories, $basefile) = File::Spec->splitpath($file);
+my @directories = grep length, File::Spec->splitdir($directories);
+$file = join '/', @directories, $basefile;
 }
 
 my $ofh;
diff --git a/regcharclass.h b/regcharclass.h
index 36c9d5e72d..c34f2ad13e 100644
--- a/regcharclass.h
+++ b/regcharclass.h
@@ -1898,7 +1898,7 @@
  * be0f129691d479aa38646e4ca0ec1ee576ae7f75b0300a5624a7fa862fa8abba 
lib/unicore/extracted/DLineBreak.txt
  * 92449d354d9f6b6f2f97a292ebb59f6344ffdeb83d120d7d23e569c43ba67cd5 
lib/unicore/extracted/DNumType.txt
  * e3a319527153b0c6c0c549b40fc6f3a01a7a0dcd6620784391db25901df3b154 
lib/unicore/extracted/DNumValues.txt
- * 5671c3de473b25e7ea47097e4906260624dfabe3e9b1739f490aecbc3d858459 
lib/unicore/mktables
+ * 823b41f276979dd5e2df12f0c7339f3d1aa2c805848958f31ddc549cb11bed9f 
lib/unicore/mktables
  * 21653d2744fdd071f9ef138c805393901bb9547cf3e777ebf50215a191f986ea 
lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c 
regen/charset_translations.pl
  * 9ea6338945a7d70e5ea4b31ac7856c0b521df96be002e94b4b3b7d31debbf3ab 
regen/regcharclass.pl
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl
index 00b929eec7..de9adf73c4 100644
--- a/regen/mk_invlists.pl
+++ b/regen/mk_invlists.pl
@@ -36,7 +36,7 @@ my $numeric_re = qr/ ^ -? \d+ (:? \. \d+ )? $ /ax;
 my $enum_name_re = qr / ^ [[:alpha:]] \w* $ /ax;
 
 my $out_fh = open_new('charclass_invlists.h', '>',
- {style => '*', by => $0,
+ {style => '*', by => 'regen/mk_invlists.pl',
   from => "Unicode::UCD"});
 
 my $in_file_pound_if = 0;
@@ -2235,10 +2235,11 @@ output_WB_table();
 end_file_pound_if;
 
 my $sources_list = "lib/unicore/mktables.lst";
-my @sources = ($0, qw(lib/unicore/mktables
-  lib/Unicode/UCD.pm
-  regen/charset_translations.pl
-  ));
+my @sou

[perl.git] branch blead updated. v5.27.9-113-g642ef05ea7

2018-03-05 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/642ef05ea76f32b1c1dabe18f1f142b244191008?hp=74e28a4a737c72840f2576bed7ebacf4a288760e>

- Log -
commit 642ef05ea76f32b1c1dabe18f1f142b244191008
Author: Tony Cook 
Date:   Tue Mar 6 15:39:47 2018 +1100

perldelta for b857191d01c2, 74e28a4a737c

---

Summary of changes:
 pod/perldelta.pod | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 58781e37ee..85a086761b 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -269,7 +269,17 @@ L section, instead.
 
 =item *
 
-XXX
+F now correctly canonicalizes the names of the
+dependencies stored in the files it generates.
+
+F, unlike the other F scripts, used
+C<$0> to name itself in the dependencies stored in the files it
+generates.  It now uses a literal so that the path stored in the
+generated files doesn't depend on how F is
+invoked.
+
+This lack of canonical names could cause test failures in
+F.  [perl #132925]
 
 =back
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.9-121-g4d169ec9e2

2018-03-06 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 4d169ec9e2a0eb93170198ffad69a892f91dd199
Author: Daniel Dragan 
Date:   Tue Mar 6 17:27:04 2018 -0500

File::Glob bsd_glob.c dont use "loop" as a goto label

Using loop as a label conflicts with Perl's "struct loop" and "LOOP" types
and Visual C 2003 in C++ mode (but not the default C build) doesn't like
that. The loop label is from 5.27.1 commit 0db967b2e6
"[perl #131211] fixup File::Glob degenerate matching"

bsd_glob.c(995) : error C2226: syntax error : unexpected type 'loop'

---

Summary of changes:
 ext/File-Glob/bsd_glob.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ext/File-Glob/bsd_glob.c b/ext/File-Glob/bsd_glob.c
index 4ca3e22a24..0d042b4afb 100644
--- a/ext/File-Glob/bsd_glob.c
+++ b/ext/File-Glob/bsd_glob.c
@@ -935,7 +935,7 @@ match(Char *name, Char *pat, Char *patend, int nocase)
Char *nextp = NULL;
Char *nextn = NULL;
 
-loop:
+redo:
while (pat < patend) {
c = *pat++;
switch (c & M_MASK) {
@@ -992,7 +992,7 @@ match(Char *name, Char *pat, Char *patend, int nocase)
if (nextn) {
pat = nextp;
name = nextn;
-   goto loop;
+   goto redo;
}
return 0;
 }

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.9-122-g814eedc877

2018-03-06 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 814eedc877a5aa1dbba0047735733e9491aa94a4
Author: Daniel Dragan 
Date:   Thu Mar 1 16:41:59 2018 -0500

rmv/de-dup static const char array "strings"

MSVC due to a bug doesn't merge identicals between .o'es or discard these
vars and their contents.

MEM_WRAP_CHECK_2 has never been used outside of core according to cpan grep
MEM_WRAP_CHECK_2 was removed on the "have PERL_MALLOC_WRAP" branch in
commit fabdb6c0879 "pre-likely cleanup" without explination, probably bc
it was unused. But MEM_WRAP_CHECK_2 was still left on the "no
PERL_MALLOC_WRAP" branch, so remove it from the "no" side for tidyness
since it was a mistake to leave it there if it was removed from the "yes"
side of the #ifdef.

Add MEM_WRAP_CHECK_s API, letter "s" means argument is string or static.
This lets us get rid of the "%s" argument passed to Perl_croak_nocontext at
a couple call sites since we fully control the next and only argument and
its guaranteed to be a string literal. This allows merging of 2
"Out of memory during array extend" c strings by linker now.

Also change the 2 op.h messages into macros which become string literals
at their call sites instead of "read char * from a global char **" which
was going on before.

VC 2003 32b perl527.dll section size before
  .text name
   DE503 virtual size
  .rdata name
   4B621 virtual size

after
  .text name
   DE503 virtual size
  .rdata name
   4B5D1 virtual size

---

Summary of changes:
 av.c | 12 ++--
 doop.c   |  6 +++---
 handy.h  |  7 ++-
 op.h | 14 +++---
 pp.c |  2 +-
 pp_hot.c |  4 +---
 6 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/av.c b/av.c
index f6ffea627b..918844c376 100644
--- a/av.c
+++ b/av.c
@@ -140,17 +140,13 @@ Perl_av_extend_guts(pTHX_ AV *av, SSize_t key, SSize_t 
*maxp, SV ***allocp,
 ? SSize_t_MAX : key + newmax;
  resize:
{
-#ifdef PERL_MALLOC_WRAP /* Duplicated in pp_hot.c */
-   static const char oom_array_extend[] =
-   "Out of memory during array extend";
-#endif
 /* it should really be newmax+1 here, but if newmax
  * happens to equal SSize_t_MAX, then newmax+1 is
  * undefined. This means technically we croak one
  * index lower than we should in theory; in practice
  * its unlikely the system has SSize_t_MAX/sizeof(SV*)
  * bytes to spare! */
-   MEM_WRAP_CHECK_1(newmax, SV*, oom_array_extend);
+   MEM_WRAP_CHECK_s(newmax, SV*, "Out of memory during array 
extend");
}
 #ifdef STRESS_REALLOC
{
@@ -176,12 +172,8 @@ Perl_av_extend_guts(pTHX_ AV *av, SSize_t key, SSize_t 
*maxp, SV ***allocp,
else {
newmax = key < 3 ? 3 : key;
{
-#ifdef PERL_MALLOC_WRAP /* Duplicated in pp_hot.c */
-   static const char oom_array_extend[] =
-   "Out of memory during array extend";
-#endif
 /* see comment above about newmax+1*/
-   MEM_WRAP_CHECK_1(newmax, SV*, oom_array_extend);
+   MEM_WRAP_CHECK_s(newmax, SV*, "Out of memory during array 
extend");
}
Newx(*allocp, newmax+1, SV*);
ary = *allocp + 1;
diff --git a/doop.c b/doop.c
index 54c7bb6ee4..54e35f10a6 100644
--- a/doop.c
+++ b/doop.c
@@ -1098,19 +1098,19 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV 
*right)
 if (left_utf8 || right_utf8) {
 if (left_utf8) {
 if (right_utf8 || rightlen > leftlen) {
-Perl_croak(aTHX_ fatal_above_ff_msg, PL_op_desc[optype]);
+Perl_croak(aTHX_ FATAL_ABOVE_FF_MSG, PL_op_desc[optype]);
 }
 len = rightlen;
 }
 else if (right_utf8) {
 if (leftlen > rightlen) {
-Perl_croak(aTHX_ fatal_above_ff_msg, PL_op_desc[optype]);
+Perl_croak(aTHX_ FATAL_ABOVE_FF_MSG, PL_op_desc[optype]);
 }
 len = leftlen;
 }
 
 Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
-   deprecated_above_ff_msg, PL_op_desc[optype]);
+   DEPRECATED_ABOVE_FF_MSG, PL_op_desc[optype]);
 }
 else {  /* Neither is UTF-8 */
 len = MIN(leftlen, rightlen);
diff --git a/handy.h b/handy.h
index 7fe1cf6caa..f5c07fde2d 100644
--- a/

[perl.git] branch blead updated. v5.27.9-123-g32ce30d709

2018-03-06 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/32ce30d709666239149a4f04ddcfbdec5288?hp=814eedc877a5aa1dbba0047735733e9491aa94a4>

- Log -
commit 32ce30d709666239149a4f04ddcfbdec5288
Author: Tony Cook 
Date:   Tue Feb 20 16:18:05 2018 +1100

(perl #132870) workaround VC2017 compiler bug

For non-debug builds MSVC could read small integers like 1 as -255.

It's possible it was confused by the AIX compiler bug workaround.

This change needs no further tests, the integer.t fails without
this workaround.

---

Summary of changes:
 dist/Storable/Storable.xs | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index df0c433b0e..45af7be210 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -6106,14 +6106,20 @@ static SV *retrieve_byte(pTHX_ stcxt_t *cxt, const char 
*cname)
 SV *sv;
 HV *stash;
 int siv;
+#ifndef _MSC_VER
 signed char tmp;   /* Workaround for AIX cc bug --H.Merijn Brand */
+#endif
 
 TRACEME(("retrieve_byte (#%d)", (int)cxt->tagnum));
 
 GETMARK(siv);
 TRACEME(("small integer read as %d", (unsigned char) siv));
+#ifdef _MSC_VER
+sv = newSViv(siv - 128);
+#else
 tmp = (unsigned char) siv - 128;
 sv = newSViv(tmp);
+#endif
 stash = cname ? gv_stashpv(cname, GV_ADD) : 0;
 SEEN_NN(sv, stash, 0); /* Associate this new scalar with tag "tagnum" 
*/
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.9-134-gb43c8b6097

2018-03-11 Thread Tony Cook
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/b43c8b6097ab8a06b5e3f161de81ecdc3b88cffa?hp=58e1d6b2a815852ad117bc02ccb9d3fa670291ff>

- Log -
commit b43c8b6097ab8a06b5e3f161de81ecdc3b88cffa
Author: Tony Cook 
Date:   Mon Mar 12 10:53:05 2018 +1100

(perl #127743) re-work for debugging builds with MSVC

My original change here broke debugging builds, since tmp was no longer
available for the TRACEME.

---

Summary of changes:
 dist/Storable/Storable.xs | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index 45af7be210..62a6c46945 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -6106,7 +6106,10 @@ static SV *retrieve_byte(pTHX_ stcxt_t *cxt, const char 
*cname)
 SV *sv;
 HV *stash;
 int siv;
-#ifndef _MSC_VER
+#ifdef _MSC_VER
+/* MSVC 2017 doesn't handle the AIX workaround well */
+int tmp;
+#else
 signed char tmp;   /* Workaround for AIX cc bug --H.Merijn Brand */
 #endif
 
@@ -6114,12 +6117,8 @@ static SV *retrieve_byte(pTHX_ stcxt_t *cxt, const char 
*cname)
 
 GETMARK(siv);
 TRACEME(("small integer read as %d", (unsigned char) siv));
-#ifdef _MSC_VER
-sv = newSViv(siv - 128);
-#else
 tmp = (unsigned char) siv - 128;
 sv = newSViv(tmp);
-#endif
 stash = cname ? gv_stashpv(cname, GV_ADD) : 0;
 SEEN_NN(sv, stash, 0); /* Associate this new scalar with tag "tagnum" 
*/
 

-- 
Perl5 Master Repository


[perl.git] branch maint-votes updated. cffaf215496b5fe17ef81c220ad0dd89d3140774

2018-03-11 Thread Tony Cook
In perl.git, the branch maint-votes has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/cffaf215496b5fe17ef81c220ad0dd89d3140774?hp=5cf8939f5a6207ec1798c0b066a6b93e28572183>

- Log -
commit cffaf215496b5fe17ef81c220ad0dd89d3140774
Author: Tony Cook 
Date:   Mon Mar 12 16:27:02 2018 +1100

votes for 5.26 backports, some comments below

I removed 3cb4cde3dd4d2af2f5065053905708bffa5168f9 since it can change
the behaviour of happens to work programs with a non-threaded build of
perl.

I removed ac1ba09e8362c54848dc27d3484a5882c4b28f43 since the config
keys it fixes are only used/defined in blead.

bb4e4c3869d9fb6ee5bddd820c2a373601ecc310 might be committable if (for
maint only) the new parser structure members were moved to the end (but
that only matters if the parser structure is part of the ABI.)

---

Summary of changes:
 votes-5.26.xml | 51 ++-
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/votes-5.26.xml b/votes-5.26.xml
index bbe35816f3..7c0252d222 100644
--- a/votes-5.26.xml
+++ b/votes-5.26.xml
@@ -30,32 +30,34 @@ The same criteria apply to code in dual-life modules as to 
core code.)
 Crash / Assertion / Memory Corruption Fixes
 
 These two together:
-
-
-
-
+
+
 
 These two together:
-
-
+
+
 
-
+
 
 Move to public list?:
-
+
 
-
+
 
-These two together:
+Note sure about this one, since it may convert non-conforming programs that 
work into non-conforming programs that assert (on debug builds), and should 
include 97fcda75b598695644a4ad496e090941f5b7dcbc if it is applied.
+These three together (if at all)
 
 
+
 
 Move to public list?:
-
+
+
+
+
 
-
-
-
+If the parser structure layout is part of the ABI, this shouldn't be 
backported, or the new parser structure members need to be moved to the end.
+
 
 This ought to have 02c84d7f0f97e083f5d8ea9856488f3ede09364f as well, though 
that makes this sound slightly controversial (so maybe it should be rejected 
for maint?):
 
@@ -73,7 +75,7 @@ Both of these or neither
 and maybe this too
 
 
-
+
 
 
 
@@ -83,32 +85,31 @@ and maybe this too
 
 Build and Installation Fixes
 
-
-
-
-
-
+
+
+
+
+
 
 
 
 Portability Fixes
 
-
-
+
 
 
 
 Platform-Specific Test Fixes
 
-
+
 
 
 
 Documentation Fixes
 
-
+
 
-
+
 
 
 

-- 
Perl5 Master Repository


[perl.git] branch blead, updated. v5.22.0-122-gc986e4c

2015-06-14 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit c986e4cee1d3feb3c0738d98024b577749621d95
Author: Dagfinn Ilmari Mannsåker 
Date:   Sun Jun 14 22:48:40 2015 +0100

Add empty expresion to cpan/.dir-locals.el

Without it, loading any file under the directory gives the message
"Error reading dir-locals: (end-of-file)", which is not fatal, but
annoying.
---

Summary of changes:
 cpan/.dir-locals.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cpan/.dir-locals.el b/cpan/.dir-locals.el
index 13109d1..8690ac6 100644
--- a/cpan/.dir-locals.el
+++ b/cpan/.dir-locals.el
@@ -1,2 +1,3 @@
 ;; Empty file to avoid imposing the defaults from the parent directory
 ;; on code imported from CPAN
+()

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.22.0-124-gcb0fc6b

2015-06-14 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/cb0fc6b21ad6e937bb281f2f76612c49583a012d?hp=c986e4cee1d3feb3c0738d98024b577749621d95>

- Log -
commit cb0fc6b21ad6e937bb281f2f76612c49583a012d
Author: Tony Cook 
Date:   Mon Jun 15 11:19:21 2015 +1000

bump $UNIVERSAL::VERSION

M   lib/UNIVERSAL.pm

commit 1b3ab82cb4bc033c211d9d975557a7a45521f9d5
Author: Karen Etheridge 
Date:   Sun Jun 14 16:24:25 2015 -0700

UNIVERSAL no longer exports anything

so switch to documenting something that would still work

M   lib/UNIVERSAL.pm
---

Summary of changes:
 lib/UNIVERSAL.pm | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm
index 2f16cb5..12800fb 100644
--- a/lib/UNIVERSAL.pm
+++ b/lib/UNIVERSAL.pm
@@ -1,6 +1,6 @@
 package UNIVERSAL;
 
-our $VERSION = '1.12';
+our $VERSION = '1.13';
 
 # UNIVERSAL should not contain any extra subs/methods beyond those
 # that it exists to define. The existence of import() below is a historical
@@ -186,10 +186,8 @@ None.
 Previous versions of this documentation suggested using C as
 a function to determine the type of a reference:
 
-  use UNIVERSAL 'isa';
-
-  $yes = isa $h, "HASH";
-  $yes = isa "Foo", "Bar";
+  $yes = UNIVERSAL::isa($h, "HASH");
+  $yes = UNIVERSAL::isa("Foo", "Bar");
 
 The problem is that this code would I call an overridden C method 
in
 any class.  Instead, use C from L for the first case:

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.22.0-125-g4b95171

2015-06-14 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/4b95171127a01794922992bc572a52c26ca4ed4c?hp=cb0fc6b21ad6e937bb281f2f76612c49583a012d>

- Log -
commit 4b95171127a01794922992bc572a52c26ca4ed4c
Author: Tony Cook 
Date:   Mon Jun 15 11:35:55 2015 +1000

perldelta for 1b3ab82cb4bc
---

Summary of changes:
 pod/perldelta.pod | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 11983ba..693284d 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -169,6 +169,13 @@ debugger finishes.  [perl #71678]
 
 =item *
 
+L has been upgraded from version 1.12 to 1.13.
+
+Don't import from L in its documentation, it no longer
+exports anything.  [perl #125410]
+
+=item *
+
 The Scalar-List-Utils distribution has been upgraded from version 1.41 to 1.42.
 
 =back

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.22.0-127-g23e51b9

2015-06-15 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/23e51b95a8db32227346e84c1c77148c98aba157?hp=4b95171127a01794922992bc572a52c26ca4ed4c>

- Log -
commit 23e51b95a8db32227346e84c1c77148c98aba157
Author: Tony Cook 
Date:   Tue Jun 16 10:17:47 2015 +1000

add Martijn Lievaart as a perl author

M   AUTHORS

commit 065d96f721ebbc64a2ed3b79ad2cfd53f84f418b
Author: Martijn Lievaart 
Date:   Mon Jun 15 17:04:56 2015 +1000

Avoid gcc warning "‘start’ may be used uninitialized in this function"

M   op.c
---

Summary of changes:
 AUTHORS |  1 +
 op.c| 24 +++-
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index a164e7c..779cd68 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -784,6 +784,7 @@ Marko Asplund   

 Marnix van Ammers  
 Martien Verbruggen 
 Martijn Koster 
+Martijn Lievaart   
 Martin Hasch   
 Martin Husemann
 Martin J. Bligh
diff --git a/op.c b/op.c
index 76eee2b..2c2c520 100644
--- a/op.c
+++ b/op.c
@@ -8142,14 +8142,13 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP 
*attrs, OP *block)
   : newUNOP(OP_LEAVESUB, 0, scalarseq(block));
start = LINKLIST(block);
block->op_next = 0;
+if (ps && !*ps && !attrs && !CvLVALUE(compcv))
+const_sv = S_op_const_sv(aTHX_ start, compcv, FALSE);
+else
+const_sv = NULL;
 }
-
-if (!block || !ps || *ps || attrs
-   || CvLVALUE(compcv)
-   )
-   const_sv = NULL;
 else
-   const_sv = S_op_const_sv(aTHX_ start, compcv, FALSE);
+const_sv = NULL;
 
 if (cv) {
 const bool exists = CvROOT(cv) || CvXSUB(cv);
@@ -8547,15 +8546,14 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP 
*attrs,
   : newUNOP(OP_LEAVESUB, 0, scalarseq(block));
start = LINKLIST(block);
block->op_next = 0;
+if (ps && !*ps && !attrs && !CvLVALUE(PL_compcv))
+const_sv =
+S_op_const_sv(aTHX_ start, PL_compcv, CvCLONE(PL_compcv));
+else
+const_sv = NULL;
 }
-
-if (!block || !ps || *ps || attrs
-   || CvLVALUE(PL_compcv)
-   )
-   const_sv = NULL;
 else
-   const_sv =
-   S_op_const_sv(aTHX_ start, PL_compcv, cBOOL(CvCLONE(PL_compcv)));
+const_sv = NULL;
 
 if (SvPOK(gv) || (SvROK(gv) && SvTYPE(SvRV(gv)) != SVt_PVCV)) {
assert (block);

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.22.0-129-gb6d5ddf

2015-06-16 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/b6d5ddf72d1067c498a7ed65623df9f2f8f8d749?hp=bace499647c542e44fa169173393f19316fe05b6>

- Log -
commit b6d5ddf72d1067c498a7ed65623df9f2f8f8d749
Author: Tony Cook 
Date:   Wed Jun 17 10:55:19 2015 +1000

[perl #123264] explicitly document the return value of sysopen
---

Summary of changes:
 pod/perlfunc.pod | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index b2c8bb6..650ad0e 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -7957,6 +7957,8 @@ filehandle wanted; an undefined scalar will be suitably 
autovivified.  This
 function calls the underlying operating system's I(2) function with the
 parameters FILENAME, MODE, and PERMS.
 
+Returns true on success and C otherwise.
+
 The possible values and flag bits of the MODE parameter are
 system-dependent; they are available via the standard module C.  See
 the documentation of your operating system's I(2) syscall to see

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.22.0-130-gb4929cb

2015-06-16 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/b4929cb48878718cd9a8f54a834db6353f8115ec?hp=b6d5ddf72d1067c498a7ed65623df9f2f8f8d749>

- Log -
commit b4929cb48878718cd9a8f54a834db6353f8115ec
Author: Tony Cook 
Date:   Wed Jun 17 11:10:18 2015 +1000

[perl #125305] chdir("") no longer behaves like chdir()
---

Summary of changes:
 pod/perldiag.pod | 10 --
 pp_sys.c |  5 +
 t/op/chdir.t | 30 ++
 3 files changed, 7 insertions(+), 38 deletions(-)

diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 47c23eb..0adabf5 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -6658,16 +6658,6 @@ one.  This doesn't make sense.  Perl will continue, 
assuming a Unicode
 happens to be ISO-8859-1 (Latin1) where this message is spurious and can
 be ignored.
 
-=item Use of chdir('') or chdir(undef) as chdir() deprecated
-
-(D deprecated) chdir() with no arguments is documented to change to
-$ENV{HOME} or $ENV{LOGDIR}.  chdir(undef) and chdir('') share this
-behavior, but that has been deprecated.  In future versions they
-will simply fail.
-
-Be careful to check that what you pass to chdir() is defined and not
-blank, else you might find yourself in your home directory.
-
 =item Use of /c modifier is meaningless in s///
 
 (W regexp) You used the /c modifier in a substitution.  The /c
diff --git a/pp_sys.c b/pp_sys.c
index beca14a..1c2ef9c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3591,8 +3591,7 @@ PP(pp_chdir)
 else if (!(gv = MAYBE_DEREF_GV(sv)))
tmps = SvPV_nomg_const_nolen(sv);
 }
-
-if( !gv && (!tmps || !*tmps) ) {
+else {
HV * const table = GvHVn(PL_envgv);
SV **svp;
 
@@ -3603,8 +3602,6 @@ PP(pp_chdir)
 #endif
)
 {
-if( MAXARG == 1 )
-deprecate("chdir('') or chdir(undef) as chdir()");
 tmps = SvPV_nolen_const(*svp);
 }
 else {
diff --git a/t/op/chdir.t b/t/op/chdir.t
index 813b0ed..84159fe 100644
--- a/t/op/chdir.t
+++ b/t/op/chdir.t
@@ -10,10 +10,11 @@ BEGIN {
 # possibilities into @INC.
 unshift @INC, qw(t . lib ../lib);
 require "./test.pl";
-plan(tests => 48);
+plan(tests => 42);
 }
 
 use Config;
+use Errno qw(ENOENT);
 
 my $IsVMS   = $^O eq 'VMS';
 
@@ -150,29 +151,10 @@ sub check_env {
 
 my $warning = '';
 local $SIG{__WARN__} = sub { $warning .= join '', @_ };
-
-
-# Check the deprecated chdir(undef) feature.
-#line 64
-ok( chdir(undef),   "chdir(undef) w/ only \$ENV{$key} set" );
-is( abs_path, $ENV{$key},   '  abs_path() agrees' );
-is( $warning,  <

[perl.git] branch blead, updated. v5.22.0-137-g1cdd922

2015-06-17 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/1cdd92240cabcef3700b896c9648b3a2b2970e28?hp=f5c4ec3553a69f8037ab6d54bc1e1f1e098572e8>

- Log -
commit 1cdd92240cabcef3700b896c9648b3a2b2970e28
Author: Tony Cook 
Date:   Thu Jun 18 14:08:48 2015 +1000

ensure chdir('') sets $! to ENOENT on non-IMP_SYS Win32 builds
---

Summary of changes:
 win32/win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/win32/win32.c b/win32/win32.c
index fa051ac..0bb0348 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3366,7 +3366,7 @@ win32_rmdir(const char *dir)
 DllExport int
 win32_chdir(const char *dir)
 {
-if (!dir) {
+if (!dir || !*dir) {
errno = ENOENT;
return -1;
 }

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.23.0-63-g6012112

2015-06-28 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/60121127fb9d33a8ca4ab1e213b635fe63c8fa8c?hp=51f0b9cd668a8ebc243325d1c5340c661123e44b>

- Log -
commit 60121127fb9d33a8ca4ab1e213b635fe63c8fa8c
Author: Tony Cook 
Date:   Thu Jun 25 13:58:57 2015 +1000

[perl #125305] handle chdir to closed handle correctly
---

Summary of changes:
 pod/perldiag.pod |  4 
 pp_sys.c | 10 ++
 t/op/chdir.t | 13 ++---
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 9d048cf..6ac8ee8 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -1559,6 +1559,10 @@ defined in the C<:alias> import argument to C, but they
 could be defined by a translator installed into C<$^H{charnames}>.
 See L.
 
+=item chdir() on unopened filehandle %s
+
+(W unopened) You tried chdir() on a filehandle that was never opened.
+
 =item \C no longer supported in regex; marked by S<<-- HERE> in m/%s/
 
 (F) The \C character class used to allow a match of single byte within a
diff --git a/pp_sys.c b/pp_sys.c
index 78d9584..da25f0f 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3599,6 +3599,16 @@ PP(pp_chdir)
SV * const sv = POPs;
if (PL_op->op_flags & OPf_SPECIAL) {
gv = gv_fetchsv(sv, 0, SVt_PVIO);
+if (!gv) {
+if (ckWARN(WARN_UNOPENED)) {
+Perl_warner(aTHX_ packWARN(WARN_UNOPENED),
+"chdir() on unopened filehandle %" SVf, sv);
+}
+SETERRNO(EBADF,RMS_IFI);
+PUSHi(0);
+TAINT_PROPER("chdir");
+RETURN;
+}
}
 else if (!(gv = MAYBE_DEREF_GV(sv)))
tmps = SvPV_nomg_const_nolen(sv);
diff --git a/t/op/chdir.t b/t/op/chdir.t
index e2e5429..8a4c49c 100644
--- a/t/op/chdir.t
+++ b/t/op/chdir.t
@@ -10,11 +10,11 @@ BEGIN {
 # possibilities into @INC.
 unshift @INC, qw(t . lib ../lib);
 require "./test.pl";
-plan(tests => 39);
+plan(tests => 44);
 }
 
 use Config;
-use Errno qw(ENOENT);
+use Errno qw(ENOENT EBADF);
 
 my $IsVMS   = $^O eq 'VMS';
 
@@ -54,7 +54,7 @@ SKIP: {
 $Cwd = abs_path;
 
 SKIP: {
-skip("no fchdir", 16) unless $has_fchdir;
+skip("no fchdir", 21) unless $has_fchdir;
 my $has_dirfd = ($Config{d_dirfd} || $Config{d_dir_dd_fd} || "") eq 
"define";
 ok(opendir(my $dh, "."), "opendir .");
 ok(open(my $fh, "<", "op"), "open op");
@@ -107,6 +107,13 @@ SKIP: {
 ok(closedir(H), "closedir");
 ok(chdir(H), "fchdir to base");
 ok(-f "cond.t", "verify that we are in 'base'");
+ok(close(H), "close");
+$! = 0;
+ok(!chdir(H), "check we can't chdir to closed handle");
+is(0+$!, EBADF, 'check $! set appropriately');
+$! = 0;
+ok(!chdir(NEVEROPENED), "check we can't chdir to never opened handle");
+is(0+$!, EBADF, 'check $! set appropriately');
 chdir ".." or die $!;
 }
 

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.23.0-88-g201e9e2

2015-07-06 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/201e9e2aa1088e65b7160f94706673641f1e018a?hp=ba707cdc782d882662421af06658ff4afdf31003>

- Log -
commit 201e9e2aa1088e65b7160f94706673641f1e018a
Author: Tony Cook 
Date:   Tue Jun 23 10:21:45 2015 +1000

[perl #125373] set $! in chdir() if env not set, clarify docs
---

Summary of changes:
 pod/perlfunc.pod |  4 ++--
 pp_sys.c |  1 +
 t/op/chdir.t | 13 -
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 650ad0e..a3f612d 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -825,8 +825,8 @@ X
 Changes the working directory to EXPR, if possible.  If EXPR is omitted,
 changes to the directory specified by C<$ENV{HOME}>, if set; if not,
 changes to the directory specified by C<$ENV{LOGDIR}>.  (Under VMS, the
-variable C<$ENV{SYS$LOGIN}> is also checked, and used if it is set.)  If
-neither is set, C does nothing.  It returns true on success,
+variable C<$ENV{'SYS$LOGIN'}> is also checked, and used if it is set.)  If
+neither is set, C does nothing and fails.  It returns true on success,
 false otherwise.  See the example under C.
 
 On systems that support fchdir(2), you may pass a filehandle or
diff --git a/pp_sys.c b/pp_sys.c
index da25f0f..b0f7798 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3628,6 +3628,7 @@ PP(pp_chdir)
 }
 else {
 PUSHi(0);
+SETERRNO(EINVAL, LIB_INVARG);
 TAINT_PROPER("chdir");
 RETURN;
 }
diff --git a/t/op/chdir.t b/t/op/chdir.t
index 3a88f82..62ac3b6 100644
--- a/t/op/chdir.t
+++ b/t/op/chdir.t
@@ -10,11 +10,11 @@ BEGIN {
 # possibilities into @INC.
 unshift @INC, qw(t . lib ../lib);
 require "test.pl";
-plan(tests => 46);
+plan(tests => 47);
 }
 
 use Config;
-use Errno qw(ENOENT EBADF);
+use Errno qw(ENOENT EBADF EINVAL);
 
 my $IsVMS   = $^O eq 'VMS';
 
@@ -204,10 +204,13 @@ foreach my $key (@magic_envs) {
 
 {
 clean_env;
-if ($IsVMS && !$Config{'d_setenv'}) {
-pass("Can't reset HOME, so chdir() test meaningless");
-} else {
+  SKIP:
+{
+$IsVMS && !$Config{'d_setenv'}
+  and skip "Can't reset HOME, so chdir() test meaningless", 2;
+$! = 0;
 ok( !chdir(),   'chdir() w/o any ENV set' );
+is( $!+0, EINVAL,   'check $! set to EINVAL');
 }
 is( abs_path, $Cwd, '  abs_path() agrees' );
 }

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.23.0-90-g7ed1d85

2015-07-07 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 7ed1d857c7b7016b9bde564c6802a4721d903d95
Author: Daniel Dragan 
Date:   Wed Jun 24 15:48:12 2015 -0400

fix #124181 double free/refcnt problems in IO types in typemap

commit 50e5165b96 "stop T_IN/OUT/INOUT/STDIO typemaps leaking" changed
newRV to newRV_noinc, but the GV * returned by newGVgen() is owned by the
package tree, like the SV * returned by get_sv(). Now when the RV to GV is
freed on mortal stack, the GV * in the package tree is freed, and now there
is a freed GV * in the package tree, if you turn on "PERL_DESTRUCT_LEVEL=2"
(and perhaps DEBUGGING is needed too), the package tree is destroyed SV *
by SV *, and perl will eventually warn with
"Attempt to free unreferenced scalar" which a very bad panic type warning.

commit 50e5165b96 was reverted in commit bae466e878
"Revert "stop T_IN/OUT/INOUT/STDIO typemaps leaking" for 5.22's release
to stop the panic, but reintroduced the SV/RV leak. So fix the RV leak (the 
val
passed as source arg of sv_setsv) by freeing it after the copying. In a very
unlikely scenario, the RV could still leak if sv_setsv dies.

Also fix the problem, that if this OUTPUT: type is being used for an
incoming arg, not the outgoing RETVAL arg, you can't assign a new SV*
ontop of the old one, that only works for perl stack return args, so
replace "$arg = &PL_sv_undef;" with "sv_setsv($arg, &PL_sv_undef);" if its
not RETVAL, this way OUTPUT on incoming args also works if it goes down the
error path. For efficiency, in a RETVAL siutation, let the undef original
SV* in $arg which is typically obtained from sv_newmortal() by xsubpp pass
through if we error out.

Also for efficiency, if it is RETVAL (which is more common) dont do the
sv_setsv/SvREFCNT_dec_NN stuff (2 function calls), just mortalize
(1 function call) the ex-temp RV and arrange for the RV to wind up on
perl stack.

Also, the GV * already knows what HV * stash it belongs to, so avoid the
stash lookup done by gv_stashpv() and just use GvSTASH which are simple
pointer derefs.

M   lib/ExtUtils/typemap
M   pod/perldelta.pod

commit c1b8440fca7358a5c52763ce726d40026870519c
Author: Daniel Dragan 
Date:   Sun May 10 11:36:05 2015 -0400

add test that fails for #124181 to Typemap.t

These tests will either fail with harness, and randomly SEGV for
me, which is intentional since they are testing memory
corruption.

M   ext/XS-Typemap/Typemap.pm
M   ext/XS-Typemap/Typemap.xs
M   ext/XS-Typemap/t/Typemap.t
---

Summary of changes:
 ext/XS-Typemap/Typemap.pm  |  4 ++--
 ext/XS-Typemap/Typemap.xs  |  9 +
 ext/XS-Typemap/t/Typemap.t | 20 ++--
 lib/ExtUtils/typemap   | 40 
 pod/perldelta.pod  |  5 -
 5 files changed, 61 insertions(+), 17 deletions(-)

diff --git a/ext/XS-Typemap/Typemap.pm b/ext/XS-Typemap/Typemap.pm
index de3319b..a1ae021 100644
--- a/ext/XS-Typemap/Typemap.pm
+++ b/ext/XS-Typemap/Typemap.pm
@@ -36,7 +36,7 @@ require XSLoader;
 
 use vars qw/ $VERSION @EXPORT /;
 
-$VERSION = '0.13';
+$VERSION = '0.14';
 
 @EXPORT = (qw/
   T_SV
@@ -76,7 +76,7 @@ $VERSION = '0.13';
   T_OPAQUEPTR_IN T_OPAQUEPTR_OUT T_OPAQUEPTR_OUT_short
T_OPAQUEPTR_IN_struct T_OPAQUEPTR_OUT_struct
   T_ARRAY
-  T_STDIO_open T_STDIO_close T_STDIO_print
+  T_STDIO_open T_STDIO_open_ret_in_arg T_STDIO_close T_STDIO_print
T_PACKED_in T_PACKED_out
T_PACKEDARRAY_in T_PACKEDARRAY_out
T_INOUT T_IN T_OUT
diff --git a/ext/XS-Typemap/Typemap.xs b/ext/XS-Typemap/Typemap.xs
index 3fa0e74ab..8314cc2 100644
--- a/ext/XS-Typemap/Typemap.xs
+++ b/ext/XS-Typemap/Typemap.xs
@@ -906,6 +906,15 @@ T_STDIO_open( file )
  OUTPUT:
   RETVAL
 
+void
+T_STDIO_open_ret_in_arg( file, io)
+  const char * file
+  FILE * io = NO_INIT
+ CODE:
+  io = xsfopen( file );
+ OUTPUT:
+  io
+
 SysRet
 T_STDIO_close( f )
   PerlIO * f
diff --git a/ext/XS-Typemap/t/Typemap.t b/ext/XS-Typemap/t/Typemap.t
index 27b4086..49ac479 100644
--- a/ext/XS-Typemap/t/Typemap.t
+++ b/ext/XS-Typemap/t/Typemap.t
@@ -6,10 +6,11 @@ BEGIN {
 }
 }
 
-use Test::More tests => 152;
+use Test::More tests => 156;
 
 use strict;
-use warnings;
+#catch WARN_INTERNAL type errors, and anything else unexpected
+use warnings FATAL => 'all';
 use XS::Typemap;
 
 pass();
@@ -213,6 +214,7 @@ is( T_PV("a string"), "a string");
 is( T_PV(52), 52);
 ok !defined T_PV_null, 'RETVAL = NULL returns undef for char*';
 {
+use warnings NONFATAL => 'all';
 my $unin

[perl.git] branch tonyc/ipc_open, created. v5.23.0-91-gc85f23b

2015-07-07 Thread Tony Cook
In perl.git, the branch tonyc/ipc_open has been created



at  c85f23b236fa90fedd9cceed2da12481184d5bbf (commit)

- Log -
commit c85f23b236fa90fedd9cceed2da12481184d5bbf
Author: Daniel Dragan 
Date:   Tue Jul 7 12:59:01 2015 -0400

dont report a $@ exception with uninitialized $!'s message in IPC::Open3

Commit a24d8dfd08 "Make IPC::Open3 work without fork()" from 5.003 created
an eval block, and if that eval block threw an exception, instead of
propagating $@, the code propagated $!, even though no system call was done
and $! is effectivly unintialized data. In one case for me, a taint
exception inside system was turned into open3() throwing an exception
about "Inappropriate I/O control operation" or "Bad file descriptor", which
had nothing to do with the real fault which was a Perl C level croak with
the message "Insecure $ENV{PATH} while running with -T switch at ..."
which was called as Perl_pp_system->Perl_taint_env->Perl_taint_proper->
Perl_croak->Perl_vcroak. This patch does not try to fix the ambiguity of
the error messages between the !DO_SPAWN and IO::Pipe
branches/implementations of _open3.
---

--
Perl5 Master Repository


[perl.git] branch tonyc/ipc_open, deleted. v5.23.0-91-gc85f23b

2015-07-07 Thread Tony Cook
In perl.git, the branch tonyc/ipc_open has been deleted



   was  c85f23b236fa90fedd9cceed2da12481184d5bbf

---
c85f23b236fa90fedd9cceed2da12481184d5bbf dont report a $@ exception with 
uninitialized $!'s message in IPC::Open3
---

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.23.0-91-gc85f23b

2015-07-07 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit c85f23b236fa90fedd9cceed2da12481184d5bbf
Author: Daniel Dragan 
Date:   Tue Jul 7 12:59:01 2015 -0400

dont report a $@ exception with uninitialized $!'s message in IPC::Open3

Commit a24d8dfd08 "Make IPC::Open3 work without fork()" from 5.003 created
an eval block, and if that eval block threw an exception, instead of
propagating $@, the code propagated $!, even though no system call was done
and $! is effectivly unintialized data. In one case for me, a taint
exception inside system was turned into open3() throwing an exception
about "Inappropriate I/O control operation" or "Bad file descriptor", which
had nothing to do with the real fault which was a Perl C level croak with
the message "Insecure $ENV{PATH} while running with -T switch at ..."
which was called as Perl_pp_system->Perl_taint_env->Perl_taint_proper->
Perl_croak->Perl_vcroak. This patch does not try to fix the ambiguity of
the error messages between the !DO_SPAWN and IO::Pipe
branches/implementations of _open3.
---

Summary of changes:
 ext/IPC-Open3/lib/IPC/Open3.pm |  8 ++--
 ext/IPC-Open3/t/IPC-Open3.t| 42 +-
 pod/perldelta.pod  |  7 ++-
 3 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/ext/IPC-Open3/lib/IPC/Open3.pm b/ext/IPC-Open3/lib/IPC/Open3.pm
index 7c7e9b5..273f205 100644
--- a/ext/IPC-Open3/lib/IPC/Open3.pm
+++ b/ext/IPC-Open3/lib/IPC/Open3.pm
@@ -9,7 +9,7 @@ require Exporter;
 use Carp;
 use Symbol qw(gensym qualify);
 
-$VERSION   = '1.18';
+$VERSION   = '1.19';
 @ISA   = qw(Exporter);
 @EXPORT= qw(open3);
 
@@ -412,7 +412,11 @@ sub spawn_with_handles {
} else {
$pid = eval { system 1, @_ }; # 1 == P_NOWAIT
}
-   push @errs, "IO::Pipe: Can't spawn-NOWAIT: $!" if !$pid || $pid < 0;
+   if($@) {
+   push @errs, "IO::Pipe: Can't spawn-NOWAIT: $@";
+   } elsif(!$pid || $pid < 0) {
+   push @errs, "IO::Pipe: Can't spawn-NOWAIT: $!";
+   }
 }
 
 # Do this in reverse, so that STDERR is restored first:
diff --git a/ext/IPC-Open3/t/IPC-Open3.t b/ext/IPC-Open3/t/IPC-Open3.t
index fcaecef..25cfdfb 100644
--- a/ext/IPC-Open3/t/IPC-Open3.t
+++ b/ext/IPC-Open3/t/IPC-Open3.t
@@ -14,7 +14,7 @@ BEGIN {
 }
 
 use strict;
-use Test::More tests => 44;
+use Test::More tests => 45;
 
 use IO::Handle;
 use IPC::Open3;
@@ -165,6 +165,46 @@ $pid = eval { open3 'WRITE', '', 'ERROR', 
'/non/existent/program'; };
 like($@, qr/^open3: Modification of a read-only value attempted at /,
  'open3 faults read-only parameters correctly') or do {waitpid $pid, 0};
 
+package NoFetch;
+
+my $fetchcount = 1;
+
+sub TIESCALAR {
+  my $class = shift;
+  my $instance = shift || undef;
+  return bless \$instance => $class;
+}
+
+sub FETCH {
+my $cmd; #dont let "@args = @DB::args;" in Carp::caller_info fire this die
+#fetchcount may need to be increased to 2 if this code is being stepped 
with
+#a perl debugger
+if($fetchcount == 1 && (caller(1))[3] ne 'Carp::caller_info') {
+   #Carp croak reports the errors as being in IPC-Open3.t, so it is
+   #unacceptable for testing where the FETCH failure occured, we dont want
+   #it failing in a $foo = $_[0]; #later# system($foo), where the failure
+   #is supposed to be triggered in the inner most syscall, aka system()
+   my ($package, $filename, $line, $subroutine) = caller(2);
+
+   die("FETCH not allowed in ".((caller(1))[3])." in 
".((caller(2))[3])."\n");
+} else {
+   $fetchcount++;
+   return tie($cmd, 'NoFetch');
+}
+}
+
+package main;
+
+{
+my $cmd;
+tie($cmd, 'NoFetch');
+
+$pid = eval { open3 'WRITE', 'READ', 'ERROR', $cmd; };
+like($@, qr/^(?:open3: IO::Pipe: Can't spawn-NOWAIT: FETCH not allowed in 
\(eval\) (?x:
+ )in IPC::Open3::spawn_with_handles|FETCH not allowed in \(eval\) in 
IPC::Open3::_open3)/,
+ 'dieing inside Tied arg propagates correctly') or do {waitpid $pid, 0};
+}
+
 foreach my $handle (qw (DUMMY STDIN STDOUT STDERR)) {
 local $::{$handle};
 my $out = IO::Handle->new();
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 68df77f..7818603 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -148,7 +148,12 @@ XXX
 
 =item *
 
-L has been upgraded from version A.xx to B.yy.
+L has been upgraded from version 1.18 to 1.19.
+
+If a Perl exception was thrown from inside this module, the exception
+C threw to the callers of C would have an irrelavent
+message derived from C<$!> which was in an undefined state, instead of the
+C<$@> message which trigg

[perl.git] branch blead, updated. v5.23.0-92-gbb3b7d7

2015-07-07 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit bb3b7d7b82b9d2ba93dc99ecf064f0c701ef2c59
Author: Daniel Dragan 
Date:   Thu Jul 2 17:22:09 2015 -0400

all SV inheriter types have DEBUG_LEAKING_SCALARS data, so always show it

I noticed AV *s in my C debugger didn't the sv_debug_* members, but if I
casted the AV * to a SV * in my C debugger using a expession in my watch
tab, all the info was there. Put the DEBUG_LEAKING_SCALARS in
_SV_HEAD_UNION so the sv_debug_* members appear everywhere (CV/HV/AV/etc),
not just for SVs.
---

Summary of changes:
 sv.h | 22 +-
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/sv.h b/sv.h
index 49cafe4..0076ddd 100644
--- a/sv.h
+++ b/sv.h
@@ -212,20 +212,24 @@ typedef struct hek HEK;
HE**svu_hash;   \
GP* svu_gp; \
PerlIO *svu_fp; \
-}  sv_u
+}  sv_u\
+_SV_HEAD_DEBUG
 
+#ifdef DEBUG_LEAKING_SCALARS
+#define _SV_HEAD_DEBUG ;\
+PERL_BITFIELD32 sv_debug_optype:9; /* the type of OP that allocated us */ \
+PERL_BITFIELD32 sv_debug_inpad:1;  /* was allocated in a pad for an OP */ \
+PERL_BITFIELD32 sv_debug_line:16;  /* the line where we were allocated */ \
+UV sv_debug_serial;/* serial number of sv allocation   */ \
+char * sv_debug_file;  /* the file where we were allocated */ \
+SV *   sv_debug_parent /* what we were cloned from (ithreads)*/
+#else
+#define _SV_HEAD_DEBUG
+#endif
 
 struct STRUCT_SV { /* struct sv { */
 _SV_HEAD(void*);
 _SV_HEAD_UNION;
-#ifdef DEBUG_LEAKING_SCALARS
-PERL_BITFIELD32 sv_debug_optype:9; /* the type of OP that allocated us */
-PERL_BITFIELD32 sv_debug_inpad:1;  /* was allocated in a pad for an OP */
-PERL_BITFIELD32 sv_debug_line:16;  /* the line where we were allocated */
-UV sv_debug_serial;/* serial number of sv allocation   */
-char * sv_debug_file;  /* the file where we were allocated */
-SV *   sv_debug_parent;/* what we were cloned from (ithreads)*/
-#endif
 };
 
 struct gv {

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.23.0-94-g30dc90f

2015-07-08 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 30dc90f1923c08aae65b60f713ac12490a716e10
Author: Daniel Dragan 
Date:   Thu Jul 2 17:15:19 2015 -0400

improve debugging of padlist API

xpadl_alloc should really be pointer to a struct with a flexible array
member, but flexible array members aren't portable enough among CCs. While
debugging the padlist API for memory corruption (caused by an unrelated
XS module), I saw that the pointer in the first slice of xpadl_alloc
pointed to an AV head of gibberish but 2nd slice was fine. This was
confusing and led me to belive the memory corruption was a bad write to
the array in xpadl_alloc. PadlistARRAY's POD a couple pages down mentions
that index 0 is not an AV *, but the struct comments just said
"pointer to beginning of array of AVs " and didnt mention index 0.

Fix the comments to make it clear what xpadl_alloc is. Add a union so it
is easier to analyze a crash dump/breakpoint with a C debugger, without
writing new code "PADNAMELIST * pnl =  PadlistNAMES(pl);" in many places
and recompiling the interp with -O0, just to be able to inspect the
padnamelist struct.
---

Summary of changes:
 pad.h | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/pad.h b/pad.h
index 31b8715..9e3caa6 100644
--- a/pad.h
+++ b/pad.h
@@ -33,7 +33,15 @@ typedef U64TYPE PADOFFSET;
 
 struct padlist {
 SSize_txpadl_max;  /* max index for which array has space */
-PAD ** xpadl_alloc;/* pointer to beginning of array of AVs */
+union {
+   PAD **  xpadlarr_alloc; /* Pointer to beginning of array of AVs.
+  index 0 is a padnamelist *  */
+   struct {
+   PADNAMELIST * padnl;
+   PAD * pad_1;/* this slice of PAD * array always alloced */
+   PAD * pad_2;/* maybe unalloced */
+   } * xpadlarr_dbg;   /* for use with a C debugger only */
+} xpadl_arr;
 U32xpadl_id;   /* Semi-unique ID, shared between 
clones */
 U32xpadl_outid;/* ID of outer pad */
 };
@@ -293,7 +301,7 @@ Restore the old pad saved into the local variable opad by 
PAD_SAVE_LOCAL()
 =cut
 */
 
-#define PadlistARRAY(pl)   (pl)->xpadl_alloc
+#define PadlistARRAY(pl)   (pl)->xpadl_arr.xpadlarr_alloc
 #define PadlistMAX(pl) (pl)->xpadl_max
 #define PadlistNAMES(pl)   *((PADNAMELIST **)PadlistARRAY(pl))
 #define PadlistNAMESARRAY(pl)  PadnamelistARRAY(PadlistNAMES(pl))

--
Perl5 Master Repository


[perl.git] branch smartmatchtoo, created. v5.23.0-112-g04eca49

2015-07-12 Thread Tony Cook
In perl.git, the branch smartmatchtoo has been created

<http://perl5.git.perl.org/perl.git/commitdiff/04eca4932e13bb4d6142487a84e96e6503d9d462?hp=>

at  04eca4932e13bb4d6142487a84e96e6503d9d462 (commit)

- Log -
commit 04eca4932e13bb4d6142487a84e96e6503d9d462
Author: Tony Cook 
Date:   Mon Jul 13 16:20:30 2015 +1000

the behaviour of objects in overloading has changed

re-worked separately because we might re-instate the older behaviour

M   pod/perlop.pod

commit fb71c9f3baf74ecf1270f43abe1df0b1ac42675b
Author: Tony Cook 
Date:   Mon Jul 13 16:07:24 2015 +1000

rip out most of the smartmatch documentation, it's much simpler now

M   pod/perlop.pod

commit 4c33aee068432c746907956fc3c881758e04e8ca
Author: Tony Cook 
Date:   Tue Jul 7 14:13:51 2015 +1000

Warn at compile time where possible.

This commit probably needs work, and the very idea needs discussion.

M   embed.fnc
M   embed.h
M   op.c
M   pod/perldiag.pod
M   proto.h
M   t/lib/warnings/op

commit b0c03a82edec3a11a11e505bff38f9c9e70b1e13
Author: Tony Cook 
Date:   Thu Jul 2 16:22:15 2015 +1000

reintroduce conversion of $foo ~~ /bar/ to $foo ~~ qr/bar/

This does not convert an implicit /bar/ as in when (/bar/)

M   embed.h
M   op.c
M   opcode.h
M   proto.h
M   regen/opcodes
M   t/op/smartmatch.t

commit 2103f6dab71302b4bde5a7884bb7bae2e497d75a
Author: Tony Cook 
Date:   Thu Jul 2 14:14:54 2015 +1000

re-enable overload ~~ any

M   pp_ctl.c
M   t/op/smartmatch.t

commit ee1b3a11c232fe813b6eda4f83fb581324828c33
Author: Tony Cook 
Date:   Thu Jul 2 10:32:16 2015 +1000

update non-autodie tests to work under the new smartmatch limits

M   ext/XS-APItest/t/grok.t
M   pod/perldiag.pod
M   t/lib/feature/switch
M   t/op/coreamp.t
M   t/op/smartmatch.t
M   t/op/state.t
M   t/op/switch.t
M   t/op/taint.t
M   t/op/tie_fetch_count.t

commit 8ce43f254e276072566fa77bd400048d3603e1df
Author: Tony Cook 
Date:   Mon Jun 22 14:06:29 2015 +1000

disallow smartmatches not explicitly permitted (runtime)

M   pp_ctl.c

commit ce8c9afc6b63f8e0f64604dbb164fd3e36531e31
Author: Father Chrysostomos 
Date:   Thu Sep 13 00:18:28 2012 -0700

New whirled order for givwhen/last/next

given now responds to last and next.

break only breaks out of given, and does not complain about an
inner foreach.

when and default do an implicit regular next, not a ‘special’ next
that only breaks out of foreach() and given.

M   embed.fnc
M   embed.h
M   pod/perldiag.pod
M   pp_ctl.c
M   proto.h
M   t/op/switch.t

commit 85c544bba4eb379820cef4d81d2d43787649bc27
Author: Father Chrysostomos 
Date:   Wed Sep 12 16:33:49 2012 -0700

toke.c: use goto to reduce repetitition

I couldn’t think of a name for the label that didn’t just repeat what
the code was doing (increment_lex_allbrackets_and_set_PL_expect), so I
gave it an arbitrary short name.

M   toke.c

commit 4a4c2e2e1f79edb4b921e085bd70e5ee451854c2
Author: Tony Cook 
Date:   Tue Jun 23 15:15:18 2015 +1000

switch to done_testing()

M   t/op/smartmatch.t
M   t/op/switch.t

commit dc02c958c67dc80256eabc878d95c5a538003e5b
Author: Father Chrysostomos 
Date:   Wed Sep 12 00:21:12 2012 -0700

Smart Match 3™

I was persuaded by Smylers’ argument concerning string equivalence:
<20120905143040.gz1...@stripey.com>

But it is not too late for me to be overruled since this is not in
blead yet.

The list is:

  RHS type
   1. undef
   2. ~~ overloading
   3. reftype eq CODE
   4. reftype eq REGEXP
   5. fall back to eq

One question still remains:  Should undef ~~ "string" give a warning?
Currently it doesn’t, but neither does it call eq overloading on the
RHS if we actually have undef ~~ $overloaded_object_without_smartmatch.

This cannot be merged until we solve the fact that smart match
is used in:

cpan/autodie/lib/Fatal.pm
cpan/autodie/t/exceptions.t

This does not deal with loop controls yet, just smartmatch and the
smartmatch aspects of of givwhen.

M   embed.fnc
M   embed.h
M   ext/XS-APItest/t/fetch_pad_names.t
M   op.c
M   opcode.h
M   perl.h
M   perly.act
M   perly.h
M   perly.tab
M   perly.y
M   pod/perldiag.pod
M   pp_ctl.c
M   proto.h
M   regen/opcodes
M   t/op/smartmatch.t
M   t/op/switch.t
M   t/op/taint.t
M   toke.c
---

--
Perl5 Master Repository


[perl.git] branch smartmatchtoo, updated. v5.23.0-113-g3775d43

2015-07-13 Thread Tony Cook
In perl.git, the branch smartmatchtoo has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/3775d436c2174ad4f638b142891de36b177b007d?hp=04eca4932e13bb4d6142487a84e96e6503d9d462>

- Log -
commit 3775d436c2174ad4f638b142891de36b177b007d
Author: Tony Cook 
Date:   Mon Jul 13 17:07:53 2015 +1000

add postfix when BLOCK
---

Summary of changes:
 perly.act   |  633 +-
 perly.h |2 +-
 perly.tab   | 1367 ---
 perly.y |4 +
 pod/perlsyn.pod |   26 ++
 t/op/switch.t   |   15 +
 6 files changed, 1051 insertions(+), 996 deletions(-)

diff --git a/perly.act b/perly.act
index cc80e69..c0d9eb8 100644
--- a/perly.act
+++ b/perly.act
@@ -590,26 +590,33 @@ case 2:
 
   case 68:
 #line 536 "perly.y"
+{ (yyval.opval) = newWHENOP(newUNOP(OP_NULL, OPf_SPECIAL, (ps[(3) - 
(3)].val.opval)),
+ op_scope((ps[(1) - (3)].val.opval)));
+   }
+break;
+
+  case 69:
+#line 540 "perly.y"
 { (ps[(3) - (3)].val.opval)->op_flags |= OPf_PARENS;
  (yyval.opval) = newWHENOP((ps[(3) - (3)].val.opval), 
op_scope((ps[(1) - (3)].val.opval)));
}
 break;
 
-  case 69:
-#line 543 "perly.y"
+  case 70:
+#line 547 "perly.y"
 { (yyval.opval) = (OP*)NULL; }
 break;
 
-  case 70:
-#line 545 "perly.y"
+  case 71:
+#line 549 "perly.y"
 {
  ((ps[(2) - (2)].val.opval))->op_flags |= OPf_PARENS;
  (yyval.opval) = op_scope((ps[(2) - (2)].val.opval));
}
 break;
 
-  case 71:
-#line 550 "perly.y"
+  case 72:
+#line 554 "perly.y"
 { parser->copline = (line_t)(ps[(1) - (6)].val.ival);
(yyval.opval) = newCONDOP(0,
newSTATEOP(OPf_SPECIAL,NULL,(ps[(3) - 
(6)].val.opval)),
@@ -618,43 +625,38 @@ case 2:
}
 break;
 
-  case 72:
-#line 560 "perly.y"
+  case 73:
+#line 564 "perly.y"
 { (yyval.opval) = (OP*)NULL; }
 break;
 
-  case 73:
-#line 562 "perly.y"
+  case 74:
+#line 566 "perly.y"
 { (yyval.opval) = op_scope((ps[(2) - (2)].val.opval)); }
 break;
 
-  case 74:
-#line 567 "perly.y"
+  case 75:
+#line 571 "perly.y"
 { (yyval.ival) = (PL_min_intro_pending &&
PL_max_intro_pending >=  PL_min_intro_pending);
  intro_my(); }
 break;
 
-  case 75:
-#line 573 "perly.y"
+  case 76:
+#line 577 "perly.y"
 { (yyval.opval) = (OP*)NULL; }
 break;
 
-  case 77:
-#line 579 "perly.y"
+  case 78:
+#line 583 "perly.y"
 { YYSTYPE tmplval;
  (void)scan_num("1", &tmplval);
  (yyval.opval) = tmplval.opval; }
 break;
 
-  case 79:
-#line 587 "perly.y"
-{ (yyval.opval) = invert(scalar((ps[(1) - (1)].val.opval))); }
-break;
-
   case 80:
-#line 592 "perly.y"
-{ (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); }
+#line 591 "perly.y"
+{ (yyval.opval) = invert(scalar((ps[(1) - (1)].val.opval))); }
 break;
 
   case 81:
@@ -668,65 +670,70 @@ case 2:
 break;
 
   case 83:
-#line 603 "perly.y"
-{ (yyval.opval) = (ps[(1) - (1)].val.opval); }
+#line 604 "perly.y"
+{ (yyval.opval) = (ps[(1) - (1)].val.opval); intro_my(); }
 break;
 
   case 84:
-#line 604 "perly.y"
-{ (yyval.opval) = (OP*)NULL; }
+#line 607 "perly.y"
+{ (yyval.opval) = (ps[(1) - (1)].val.opval); }
 break;
 
   case 85:
 #line 608 "perly.y"
+{ (yyval.opval) = (OP*)NULL; }
+break;
+
+  case 86:
+#line 612 "perly.y"
 { (yyval.ival) = start_subparse(FALSE, 0);
SAVEFREESV(PL_compcv); }
 break;
 
-  case 86:
-#line 614 "perly.y"
+  case 87:
+#line 618 "perly.y"
 { (yyval.ival) = start_subparse(FALSE, CVf_ANON);
SAVEFREESV(PL_compcv); }
 break;
 
-  case 87:
-#line 619 "perly.y"
+  case 88:
+#line 623 "perly.y"
 { (yyval.ival) = start_subparse(TRUE, 0);
SAVEFREESV(PL_compcv); }
 break;
 
-  case 90:
-#line 630 "perly.y"
+  case 91:
+#line 634 "perly.y"
 { (yyval.opval) = (OP*)NULL; }
 break;
 
-  case 92:
-#line 636 "perly.y"
+  case 93:
+#line 640 "perly.y"
 { (yyval.opval) = (OP*)NULL; }
 break;
 
-  case 93:
-#line 638 "perly.y"
+  case 94:
+#line 642 "perly.y"
  

[perl.git] branch blead, updated. v5.23.0-128-g3122135

2015-07-19 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 31221351abb3a508c369e8203d17da077adc667b
Author: Daniel Dragan 
Date:   Tue Jan 20 01:25:26 2015 -0500

factor out an %ENV assignment from make_ext.pl

nytprof using full (not mini) Win32 perl reported 44 calls on line
"$ENV{PERL_CORE} = 1;" at 623 us spent on line for make_ext.pl --dynamic

Move the env var setting out from build_extension() to before the foreach
loop starts.
---

Summary of changes:
 make_ext.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/make_ext.pl b/make_ext.pl
index 12926f8..1b055c3 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -220,6 +220,7 @@ if ($Config{osname} eq 'catamount' and @extspec) {
 # Snowball's chance of building extensions.
 die "This is $Config{osname}, not building $extspec[0], sorry.\n";
 }
+$ENV{PERL_CORE} = 1;
 
 foreach my $spec (@extspec)  {
 my $mname = $spec;
@@ -271,7 +272,6 @@ sub build_extension {
 $perl ||= "$up/miniperl";
 my $return_dir = $up;
 my $lib_dir = "$up/lib";
-$ENV{PERL_CORE} = 1;
 
 my ($makefile, $makefile_no_minus_f);
 if (IS_VMS) {

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.23.0-130-gad06c68

2015-07-19 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/ad06c68e1547b1a860919feac7df7c509e7efbaf?hp=31221351abb3a508c369e8203d17da077adc667b>

- Log -
commit ad06c68e1547b1a860919feac7df7c509e7efbaf
Author: Tony Cook 
Date:   Mon Jul 20 16:02:00 2015 +1000

bump $DynaLoader::VERSION to 1.33

M   ext/DynaLoader/DynaLoader_pm.PL

commit 6114e455f60b0de62a0b74edee3c9e1841d49c42
Author: Matthew Horsfall (alh) 
Date:   Thu Aug 29 08:41:06 2013 -0400

Replace reference to newXSUB with newXS.

newXSUB hasn't been around for a long time

M   ext/DynaLoader/DynaLoader_pm.PL
---

Summary of changes:
 ext/DynaLoader/DynaLoader_pm.PL | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index 45dd6d3..c7ae049 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -85,7 +85,7 @@ package DynaLoader;
 # tim.bu...@ig.co.uk, August 1994
 
 BEGIN {
-$VERSION = '1.32';
+$VERSION = '1.33';
 }
 
 use Config;
@@ -899,7 +899,7 @@ Syntax:
 
 Create a new Perl external subroutine named $perl_name using $symref as
 a pointer to the function which implements the routine.  This is simply
-a direct call to newXSUB().  Returns a reference to the installed
+a direct call to newXS()/newXS_flags().  Returns a reference to the installed
 function.
 
 The $filename parameter is used by Perl to identify the source file for

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.23.1-12-gc7a622b

2015-07-21 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit c7a622b32220ef59969124212598b6848bcaa247
Author: Daniel Dragan 
Date:   Wed Jul 15 21:59:58 2015 -0400

combine PERLDB_LINE and PERLDB_SAVESRC flag tests

On VC2003 32b -O1, the .text section of miniperl.exe decreased from
0xAEFCD bytes of machine code to 0xAEF9D after this patch.

see also
http://www.nntp.perl.org/group/perl.perl5.porters/2015/07/msg229308.html
---

Summary of changes:
 gv.c | 2 +-
 perl.h   | 2 ++
 pp_ctl.c | 6 +++---
 toke.c   | 8 
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/gv.c b/gv.c
index 242ea87..5d642af 100644
--- a/gv.c
+++ b/gv.c
@@ -129,7 +129,7 @@ Perl_gv_fetchfile_flags(pTHX_ const char *const name, const 
STRLEN namelen,
sv_setpvn(GvSV(gv), name, namelen);
 #endif
 }
-if ((PERLDB_LINE || PERLDB_SAVESRC) && !GvAV(gv))
+if (PERLDB_LINE_OR_SAVESRC && !GvAV(gv))
hv_magic(GvHVn(gv), GvAVn(gv), PERL_MAGIC_dbfile);
 if (tmpbuf != smallbuf)
Safefree(tmpbuf);
diff --git a/perl.h b/perl.h
index bcfeee9..9d57450 100644
--- a/perl.h
+++ b/perl.h
@@ -5767,6 +5767,8 @@ typedef struct am_table_short AMTS;
 #define PERLDB_SAVESRC_NOSUBS  (PL_perldb & PERLDBf_SAVESRC_NOSUBS)
 #define PERLDB_SAVESRC_INVALID (PL_perldb & PERLDBf_SAVESRC_INVALID)
 
+#define PERLDB_LINE_OR_SAVESRC (PL_perldb & (PERLDBf_LINE | PERLDBf_SAVESRC))
+
 #ifdef USE_LOCALE
 /* These locale things are all subject to change */
 /* Returns TRUE if the plain locale pragma without a parameter is in effect
diff --git a/pp_ctl.c b/pp_ctl.c
index e6fdcf4..ad6efc1 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4181,7 +4181,7 @@ PP(pp_entereval)
 
 /* prepare to compile string */
 
-if ((PERLDB_LINE || PERLDB_SAVESRC) && PL_curstash != PL_debstash)
+if (PERLDB_LINE_OR_SAVESRC && PL_curstash != PL_debstash)
save_lines(CopFILEAV(&PL_compiling), PL_parser->linestr);
 else {
/* XXX For Cs within BEGIN {} blocks, this ends up
@@ -4198,7 +4198,7 @@ PP(pp_entereval)
 
 if (doeval(gimme, runcv, seq, saved_hh)) {
if (was != PL_breakable_sub_gen /* Some subs defined here. */
-   ? (PERLDB_LINE || PERLDB_SAVESRC)
+   ?  PERLDB_LINE_OR_SAVESRC
:  PERLDB_SAVESRC_NOSUBS) {
/* Retain the filegv we created.  */
} else if (!saved_delete) {
@@ -4210,7 +4210,7 @@ PP(pp_entereval)
/* We have already left the scope set up earlier thanks to the LEAVE
   in doeval().  */
if (was != PL_breakable_sub_gen /* Some subs defined here. */
-   ? (PERLDB_LINE || PERLDB_SAVESRC)
+   ?  PERLDB_LINE_OR_SAVESRC
:  PERLDB_SAVESRC_INVALID) {
/* Retain the filegv we created.  */
} else if (!saved_delete) {
diff --git a/toke.c b/toke.c
index 9a94f91..db82129 100644
--- a/toke.c
+++ b/toke.c
@@ -1338,7 +1338,7 @@ Perl_lex_next_chunk(pTHX_ U32 flags)
CopLINE_set(PL_curcop, PL_parser->preambling + 1);
PL_parser->preambling = NOLINE;
 }
-if (got_some_for_debugger && (PERLDB_LINE || PERLDB_SAVESRC) &&
+if (got_some_for_debugger && PERLDB_LINE_OR_SAVESRC &&
PL_curstash != PL_debstash) {
/* debugger active and we're not compiling the debugger code,
 * so store the line into the debugger's array of lines
@@ -4735,7 +4735,7 @@ Perl_yylex(pTHX)
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = 
SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
PL_last_lop = PL_last_uni = NULL;
-   if ((PERLDB_LINE || PERLDB_SAVESRC) && PL_curstash != PL_debstash)
+   if (PERLDB_LINE_OR_SAVESRC && PL_curstash != PL_debstash)
update_debugger_info(PL_linestr, NULL, 0);
goto retry;
}
@@ -4969,7 +4969,7 @@ Perl_yylex(pTHX)
} while (argc && argv[0][0] == '-' && argv[0][1]);
init_argv_symbols(argc,argv);
}
-   if (((PERLDB_LINE || PERLDB_SAVESRC) && !oldpdb) ||
+   if ((PERLDB_LINE_OR_SAVESRC && !oldpdb) ||
((PL_minus_n || PL_minus_p) && !(oldn || oldp)))
  /* if we have already added "LINE: while (<>) {",
 we must not do it again */
@@ -4979,7 +4979,7 @@ Perl_yylex(pTHX)
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
PL_last_lop = PL_last_uni = NULL;
PL_preambled = FALSE;
-   if (PERLDB_LINE || PERLDB_SAVESRC)
+   if (PER

[perl.git] branch blead, updated. v5.23.1-13-g86f4502

2015-07-21 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 86f4502880c5cbc7a5ec1510ab05a413bfb40e03
Author: Dagfinn Ilmari Mannsåker 
Date:   Thu Jul 16 08:08:19 2015 +0100

Merge declaration and initialisation of local variable

Commit 2b32fed8 removed the PUTBACK/SPAGAIN around hv_iterval and
Perl_sv_setpvf, but didn't take the opportunity to merge the
initialisation with the declaration now that there's no code between
them.
---

Summary of changes:
 doop.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/doop.c b/doop.c
index 22e614a..19fe310 100644
--- a/doop.c
+++ b/doop.c
@@ -1263,8 +1263,7 @@ Perl_do_kv(pTHX)
XPUSHs(sv);
}
if (dovalues) {
-   SV *tmpstr;
-   tmpstr = hv_iterval(keys,entry);
+   SV *tmpstr = hv_iterval(keys,entry);
DEBUG_H(Perl_sv_setpvf(aTHX_ tmpstr, "%lu%%%d=%lu",
(unsigned long)HeHASH(entry),
(int)HvMAX(keys)+1,

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.23.1-28-g64821df

2015-07-22 Thread Tony Cook
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/64821df16a716bfc005acb06c7dc5b72afabe38d?hp=5cce15f303ed613cd36c5bc28b7c05aecb464300>

- Log -
commit 64821df16a716bfc005acb06c7dc5b72afabe38d
Author: Tony Cook 
Date:   Thu Jul 23 15:34:43 2015 +1000

[perl #123961] handle a missing closing ` for -DT output
---

Summary of changes:
 toke.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/toke.c b/toke.c
index 205b00b..4a53f2f 100644
--- a/toke.c
+++ b/toke.c
@@ -6310,7 +6310,13 @@ Perl_yylex(pTHX)
 
 case '`':
s = scan_str(s,FALSE,FALSE,FALSE,NULL);
-   DEBUG_T( { printbuf("### Saw backtick string before %s\n", s); } );
+   DEBUG_T( {
+if (s)
+printbuf("### Saw backtick string before %s\n", s);
+else
+   PerlIO_printf(Perl_debug_log,
+"### Saw unterminated backtick string\n");
+} );
if (PL_expect == XOPERATOR)
no_op("Backticks",s);
if (!s)

--
Perl5 Master Repository


[perl.git] branch maint-5.20-votes, updated. v5.20.1-124-gacff5ba

2015-07-26 Thread Tony Cook
In perl.git, the branch maint-5.20-votes has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/acff5baaca24247639df4bcbb02fbaa434936be4?hp=58fe1fb695137d38657c3138b757ec36f5688f10>

- Log -
commit acff5baaca24247639df4bcbb02fbaa434936be4
Author: Tony Cook 
Date:   Mon Jul 27 11:50:57 2015 +1000

easy votes and some comments
---

Summary of changes:
 Porting/cherry-pick-votes-maint-5.20.xml | 62 +---
 1 file changed, 33 insertions(+), 29 deletions(-)

diff --git a/Porting/cherry-pick-votes-maint-5.20.xml 
b/Porting/cherry-pick-votes-maint-5.20.xml
index 62d526b..87e435e 100644
--- a/Porting/cherry-pick-votes-maint-5.20.xml
+++ b/Porting/cherry-pick-votes-maint-5.20.xml
@@ -5,21 +5,21 @@
 Tickets Listed in #123921: 5.20.3 blockers
 
 The leak isn't in blead so there is no blead commit to cherry-pick. The voting 
here relates to the two patches by Tony C on the ticket. -- steveh
-
+
 
-
+
 
 
 
 
-
-
-
+
+
+
 
-
-
-
-
+
+
+
+
 
 
 
@@ -50,13 +50,17 @@ I feel a bit leery about this next one.  The code is a bit 
fragile, so I would f
 
 
 
-
-
 
-
-
-
-
+Both of the following should be applied, or neither -- tonyc.
+
+
+
+The second of the following 2 depends on the first being applied -- tonyc.
+
+
+
+
+
 
 
 This commit (d27f4)'s new test is failing in a dry-run of cherry-picking into 
maint -- steveh:
@@ -121,12 +125,12 @@ Does this need d9a13252ba5aad7b3eaaff069b56472cfb651a40 
too? -- steveh
 
 
 
-
-
+
+
 
-
-
-
+
+
+
 
 
 
@@ -146,7 +150,7 @@ Does this need d9a13252ba5aad7b3eaaff069b56472cfb651a40 
too? -- steveh
 
 
 
-
+
 
 
 
@@ -160,17 +164,17 @@ Does this need d9a13252ba5aad7b3eaaff069b56472cfb651a40 
too? -- steveh
 
 
 
-
-
+
+
 
-
-
+
+
 
-
-
+
+
 
-
-
+
+
 
 
 

--
Perl5 Master Repository


[perl.git] branch tonyc/utf8-UTF8-UTF-8, deleted. v5.22.0-RC1-5-g7e0603d

2015-07-27 Thread Tony Cook
In perl.git, the branch tonyc/utf8-UTF8-UTF-8 has been deleted



   was  7e0603d5d5ec616dae2c65984cd8114e53fdd35c

---
7e0603d5d5ec616dae2c65984cd8114e53fdd35c call UTF-8 "UTF-8" except when 
referring to the namespace
---

--
Perl5 Master Repository


[perl.git] branch maint-5.20-votes, updated. v5.20.1-125-g9154295

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20-votes has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/915429546b87b0e03a54b1952c0fcd9e6d1bcfc7?hp=acff5baaca24247639df4bcbb02fbaa434936be4>

- Log -
commit 915429546b87b0e03a54b1952c0fcd9e6d1bcfc7
Author: Tony Cook 
Date:   Tue Jul 28 11:46:50 2015 +1000

the hv_func.h change has a sort-of-dependent change
---

Summary of changes:
 Porting/cherry-pick-votes-maint-5.20.xml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Porting/cherry-pick-votes-maint-5.20.xml 
b/Porting/cherry-pick-votes-maint-5.20.xml
index 87e435e..b8f6f4e 100644
--- a/Porting/cherry-pick-votes-maint-5.20.xml
+++ b/Porting/cherry-pick-votes-maint-5.20.xml
@@ -136,7 +136,9 @@ Does this need d9a13252ba5aad7b3eaaff069b56472cfb651a40 
too? -- steveh
 
 Build and Installation Fixes
 
-
+The following allows the other hv_func.h patch below to apply cleanly and 
fixes a real bug. I've voted for the second, but the conflict resolution for 
that will effectively apply the first, so not ap ... [15 chars truncated]
+
+
 
 
 

--
Perl5 Master Repository


[perl.git] branch maint-5.20, updated. v5.20.2-5-gf8f1324

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20 has been updated



- Log -
commit f8f1324c494d7cf2c6e2c71df69504e665c90a86
Author: Andy Dougherty 
Date:   Wed Feb 27 09:12:13 2013 -0500

Change os390 custom cppstdin script to use fgrep.

Grep appears to be limited to 2048 characters, and truncates
the output for cppstin.  Fgrep apparently doesn't have that limit.
Thanks to John Goodyear  for reporting this.
(cherry picked from commit a4c2c75af551764534f9f8cb6afd4ef6ba514f45)
---

Summary of changes:
 hints/os390.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hints/os390.sh b/hints/os390.sh
index 5aafb4e..892d36d 100644
--- a/hints/os390.sh
+++ b/hints/os390.sh
@@ -158,10 +158,10 @@ esac
 # under a compiler other than c89.
 case "$usedl" in
 define)
-echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE 
-D_SHR_ENVIRON -E -Wc,"LANGLVL(DOLLARINNAMES)",NOLOC ${1+"$@"} .$$.c | grep -v 
"??="; rm .$$.c' > cppstdin
+echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE 
-D_SHR_ENVIRON -E -Wc,"LANGLVL(DOLLARINNAMES)",NOLOC ${1+"$@"} .$$.c | fgrep -v 
"??="; rm .$$.c' > cppstdin
 ;;
 *)
-echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE 
-E -Wc,"LANGLVL(DOLLARINNAMES)",NOLOC ${1+"$@"} .$$.c | grep -v "??="; rm 
.$$.c' > cppstdin
+echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE 
-E -Wc,"LANGLVL(DOLLARINNAMES)",NOLOC ${1+"$@"} .$$.c | fgrep -v "??="; rm 
.$$.c' > cppstdin
 ;;
 esac
 

--
Perl5 Master Repository


[perl.git] branch maint-5.20-votes, updated. v5.20.1-126-g57933fb

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20-votes has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/57933fbc75c464032bbee7d3030fdcfc235bcb2e?hp=915429546b87b0e03a54b1952c0fcd9e6d1bcfc7>

- Log -
commit 57933fbc75c464032bbee7d3030fdcfc235bcb2e
Author: Tony Cook 
Date:   Tue Jul 28 15:24:32 2015 +1000

voted and for applied a4c2c75af551764534f9f8cb6afd4ef6ba514f45
---

Summary of changes:
 Porting/cherry-pick-votes-maint-5.20.xml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/Porting/cherry-pick-votes-maint-5.20.xml 
b/Porting/cherry-pick-votes-maint-5.20.xml
index b8f6f4e..c9f54f5 100644
--- a/Porting/cherry-pick-votes-maint-5.20.xml
+++ b/Porting/cherry-pick-votes-maint-5.20.xml
@@ -147,8 +147,6 @@ The following allows the other hv_func.h patch below to 
apply cleanly and fixes
 
 Portability Fixes
 
-
-
 
 
 

--
Perl5 Master Repository


[perl.git] branch maint-5.20, updated. v5.20.2-6-g67d94e8

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20 has been updated



- Log -
commit 67d94e8eab564f018e700507e7ba0958eb43033b
Author: Karl Williamson 
Date:   Mon Dec 29 13:57:10 2014 -0700

perlpod: Latin1 pods need an =encoding
(cherry picked from commit a0879bf8a3066bd055931dcc51f2c4f80ec01ffb)
---

Summary of changes:
 pod/perlpod.pod | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/pod/perlpod.pod b/pod/perlpod.pod
index 2f531f9..12b156b 100644
--- a/pod/perlpod.pod
+++ b/pod/perlpod.pod
@@ -282,11 +282,15 @@ be for formatting as a footnote).
 X<=encoding> X
 
 This command is used for declaring the encoding of a document.  Most
-users won't need this; but if your encoding isn't US-ASCII or Latin-1,
-then put a C<=encoding I> command early in the document so
+users won't need this; but if your encoding isn't US-ASCII,
+then put a C<=encoding I> command very early in the document so
 that pod formatters will know how to decode the document.  For
 I, use a name recognized by the L
-module.  Examples:
+module.  Some pod formatters may try to guess between a Latin-1 versus
+UTF-8 encoding, but they may guess wrong.  It's best to be explicit if
+you use anything besides strict ASCII.  Examples:
+
+  =encoding latin1
 
   =encoding utf8
 

--
Perl5 Master Repository


[perl.git] branch maint-5.20-votes, updated. v5.20.1-127-g1881f3c

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20-votes has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/1881f3c8499b035a031a5adb6313cb4bb950e7ce?hp=57933fbc75c464032bbee7d3030fdcfc235bcb2e>

- Log -
commit 1881f3c8499b035a031a5adb6313cb4bb950e7ce
Author: Tony Cook 
Date:   Tue Jul 28 15:35:52 2015 +1000

voted for and applied a0879bf8a3066bd055931dcc51f2c4f80ec01ffb
---

Summary of changes:
 Porting/cherry-pick-votes-maint-5.20.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Porting/cherry-pick-votes-maint-5.20.xml 
b/Porting/cherry-pick-votes-maint-5.20.xml
index c9f54f5..c406079 100644
--- a/Porting/cherry-pick-votes-maint-5.20.xml
+++ b/Porting/cherry-pick-votes-maint-5.20.xml
@@ -160,7 +160,6 @@ The following allows the other hv_func.h patch below to 
apply cleanly and fixes
 
 Documentation Fixes
 
-
 
 
 

--
Perl5 Master Repository


[perl.git] branch maint-5.20, updated. v5.20.2-7-g3f48d41

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20 has been updated



- Log -
commit 3f48d410f19f301f9e0a9143b6c4763d583e67a9
Author: Matthew Horsfall (alh) 
Date:   Thu Jan 8 08:41:24 2015 -0500

Fix apidocs for OP_TYPE_IS(_OR_WAS) - arguments separated by |, not ,.

This was causing Devel::PPPort's tooling some grief.
(cherry picked from commit 5bfb0af0b8971c7f063804d149384ca17bfc0ae2)
---

Summary of changes:
 op.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/op.h b/op.h
index 9d9dd58..ff45354 100644
--- a/op.h
+++ b/op.h
@@ -1005,7 +1005,7 @@ For custom ops the type is returned from the 
registration, and it is up
 to the registree to ensure it is accurate.  The value returned will be
 one of the OA_* constants from op.h.
 
-=for apidoc Am|bool|OP_TYPE_IS|OP *o, Optype type
+=for apidoc Am|bool|OP_TYPE_IS|OP *o|Optype type
 Returns true if the given OP is not a NULL pointer
 and if it is of the given type.
 
@@ -1013,7 +1013,7 @@ The negation of this macro, C is also 
available
 as well as C and C which elide
 the NULL pointer check.
 
-=for apidoc Am|bool|OP_TYPE_IS_OR_WAS|OP *o, Optype type
+=for apidoc Am|bool|OP_TYPE_IS_OR_WAS|OP *o|Optype type
 Returns true if the given OP is not a NULL pointer and
 if it is of the given type or used to be before being
 replaced by an OP of type OP_NULL.

--
Perl5 Master Repository


[perl.git] branch maint-5.20-votes, updated. v5.20.1-128-g0a4712f

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20-votes has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/0a4712fb7cd0c06d35a8183dede23ecb2d7c33ef?hp=1881f3c8499b035a031a5adb6313cb4bb950e7ce>

- Log -
commit 0a4712fb7cd0c06d35a8183dede23ecb2d7c33ef
Author: Tony Cook 
Date:   Tue Jul 28 15:43:32 2015 +1000

voted for and cherry-picked 5bfb0af0b8971c7f063804d149384ca17bfc0ae2
---

Summary of changes:
 Porting/cherry-pick-votes-maint-5.20.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Porting/cherry-pick-votes-maint-5.20.xml 
b/Porting/cherry-pick-votes-maint-5.20.xml
index c406079..5e94908 100644
--- a/Porting/cherry-pick-votes-maint-5.20.xml
+++ b/Porting/cherry-pick-votes-maint-5.20.xml
@@ -160,7 +160,6 @@ The following allows the other hv_func.h patch below to 
apply cleanly and fixes
 
 Documentation Fixes
 
-
 
 
 

--
Perl5 Master Repository


[perl.git] branch maint-5.20, updated. v5.20.2-8-g7ee5afc

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20 has been updated



- Log -
commit 7ee5afc746607e1b7fce7934f2b9a27ce300ba4f
Author: Karl Williamson 
Date:   Thu Jan 8 12:22:21 2015 -0700

perlpodspec: Corrections/adds to detecting =encoding

C0 and C1 are not legal UTF-8 start bytes.  utf8::decode() is a more
accurate way of determining UTF-8.
(cherry picked from commit 9a5b9407081290adfb965563aed854ccd8560db6)
---

Summary of changes:
 pod/perlpodspec.pod | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/pod/perlpodspec.pod b/pod/perlpodspec.pod
index 67f74b6..f2af63e 100644
--- a/pod/perlpodspec.pod
+++ b/pod/perlpodspec.pod
@@ -633,15 +633,21 @@ UTF-16.  If the file begins with the three literal byte 
values
 
 =item *
 
-A naive but sufficient heuristic for testing the first highbit
+A naive but often sufficient heuristic for testing the first highbit
 byte-sequence in a BOM-less file (whether in code or in Pod!), to see
 whether that sequence is valid as UTF-8 (RFC 2279) is to check whether
-that the first byte in the sequence is in the range 0xC0 - 0xFD
+that the first byte in the sequence is in the range 0xC2 - 0xFD
 I whether the next byte is in the range
 0x80 - 0xBF.  If so, the parser may conclude that this file is in
 UTF-8, and all highbit sequences in the file should be assumed to
 be UTF-8.  Otherwise the parser should treat the file as being
-in Latin-1.  In the unlikely circumstance that the first highbit
+in Latin-1.  (A better check is to pass a copy of the sequence to
+L which performs a full validity check on the
+sequence and returns TRUE if it is valid UTF-8, FALSE otherwise.  This
+function is always pre-loaded, is fast because it is written in C, and
+will only get called at most once, so you don't need to avoid it out of
+performance concerns.)
+In the unlikely circumstance that the first highbit
 sequence in a truly non-UTF-8 file happens to appear to be UTF-8, one
 can cater to our heuristic (as well as any more intelligent heuristic)
 by prefacing that line with a comment line containing a highbit

--
Perl5 Master Repository


[perl.git] branch maint-5.20-votes, updated. v5.20.1-129-gc07886d

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20-votes has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/c07886d6af5747723d05cb6f42ca70e0ef962a25?hp=0a4712fb7cd0c06d35a8183dede23ecb2d7c33ef>

- Log -
commit c07886d6af5747723d05cb6f42ca70e0ef962a25
Author: Tony Cook 
Date:   Tue Jul 28 15:47:48 2015 +1000

voted for a cherry-picked 9a5b9407081290adfb965563aed854ccd8560db6
---

Summary of changes:
 Porting/cherry-pick-votes-maint-5.20.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Porting/cherry-pick-votes-maint-5.20.xml 
b/Porting/cherry-pick-votes-maint-5.20.xml
index 5e94908..45bcde1 100644
--- a/Porting/cherry-pick-votes-maint-5.20.xml
+++ b/Porting/cherry-pick-votes-maint-5.20.xml
@@ -160,7 +160,6 @@ The following allows the other hv_func.h patch below to 
apply cleanly and fixes
 
 Documentation Fixes
 
-
 
 
 

--
Perl5 Master Repository


[perl.git] branch maint-5.20, updated. v5.20.2-9-ga82de63

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20 has been updated



- Log -
commit a82de63beda206f04be7b7c8573c2cef05ea397d
Author: Daniel Dragan 
Date:   Thu Jan 15 22:30:25 2015 -0500

improve SvPV_set's docs, it really shouldn't be public API

Someone else in the perl community wrote XS code using SvPV_set instead
of sv_setpvn and couldn't figure out why he was getting
heap corruption/failed asserts/SEGVs/etc. Improve the docs to basically say
never use this.
(cherry picked from commit f2979eac0a03fcba1cd431ef3d46f697176ebcc8)
---

Summary of changes:
 sv.h | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/sv.h b/sv.h
index b129225..15163e4 100644
--- a/sv.h
+++ b/sv.h
@@ -792,13 +792,18 @@ C instead of the lvalue assignment to C.
 Set the value of the NV pointer in sv to val.  See C.
 
 =for apidoc Am|void|SvPV_set|SV* sv|char* val
-Set the value of the PV pointer in C to the C-terminated string
-C.  See also C.
+This is probably not what you want to use, you probably wanted
+L or L or L.
 
+Set the value of the PV pointer in C to the Perl allocated
+C-terminated string C.  See also C.
+
+Remember to free the previous PV buffer. There are many things to check.
 Beware that the existing pointer may be involved in copy-on-write or other
 mischief, so do C and use C or
 C (or check the SvIsCOW flag) first to make sure this
-modification is safe.
+modification is safe. Then finally, if it is not a COW, call C to
+free the previous PV buffer.
 
 =for apidoc Am|void|SvUV_set|SV* sv|UV val
 Set the value of the UV pointer in sv to val.  See C.

--
Perl5 Master Repository


[perl.git] branch maint-5.20-votes, updated. v5.20.1-130-g743c65f

2015-07-27 Thread Tony Cook
In perl.git, the branch maint-5.20-votes has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/743c65f5a4260710b56b5f85dc9de535a92aa5df?hp=c07886d6af5747723d05cb6f42ca70e0ef962a25>

- Log -
commit 743c65f5a4260710b56b5f85dc9de535a92aa5df
Author: Tony Cook 
Date:   Tue Jul 28 15:56:31 2015 +1000

vote for and cherry-pick f2979eac0a03fcba1cd431ef3d46f697176ebcc8
---

Summary of changes:
 Porting/cherry-pick-votes-maint-5.20.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Porting/cherry-pick-votes-maint-5.20.xml 
b/Porting/cherry-pick-votes-maint-5.20.xml
index 45bcde1..330aef9 100644
--- a/Porting/cherry-pick-votes-maint-5.20.xml
+++ b/Porting/cherry-pick-votes-maint-5.20.xml
@@ -160,7 +160,6 @@ The following allows the other hv_func.h patch below to 
apply cleanly and fixes
 
 Documentation Fixes
 
-
 
 
 

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.23.1-138-g3480fba

2015-07-29 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 3480fbaaaea849eca1f4747c4f85938960b20956
Author: Daniel Dragan 
Date:   Wed Jul 29 09:54:51 2015 -0400

Cwd.pm, dont repeatedly access magic %ENV vars

%ENV is magic/tied, a lexical is faster than calling out to magic APIs
with gets and sets (or checks for them). Less glob and hash lookups too.

Return the lexical instead of the magic var so there isn't a search for
magic from pp_leavesub's sv_mortalcopy. Even though env mg vtable doesn't
have a getter or GMAGIC, SvVSTRING_mg executes mg_find for random, get
and set magic inside Perl_sv_setsv_flags.
---

Summary of changes:
 dist/PathTools/Cwd.pm | 51 +--
 dist/PathTools/lib/File/Spec.pm   |  2 +-
 dist/PathTools/lib/File/Spec/Cygwin.pm|  2 +-
 dist/PathTools/lib/File/Spec/Epoc.pm  |  2 +-
 dist/PathTools/lib/File/Spec/Functions.pm |  2 +-
 dist/PathTools/lib/File/Spec/Mac.pm   |  2 +-
 dist/PathTools/lib/File/Spec/OS2.pm   |  2 +-
 dist/PathTools/lib/File/Spec/Unix.pm  |  2 +-
 dist/PathTools/lib/File/Spec/VMS.pm   |  2 +-
 dist/PathTools/lib/File/Spec/Win32.pm |  2 +-
 10 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm
index 49cc4c1..0765de4 100644
--- a/dist/PathTools/Cwd.pm
+++ b/dist/PathTools/Cwd.pm
@@ -3,7 +3,7 @@ use strict;
 use Exporter;
 use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
 
-$VERSION = '3.56';
+$VERSION = '3.57';
 my $xs_version = $VERSION;
 $VERSION =~ tr/_//;
 
@@ -600,20 +600,23 @@ sub _vms_abs_path {
 }
 
 sub _os2_cwd {
-$ENV{'PWD'} = `cmd /c cd`;
-chomp $ENV{'PWD'};
-$ENV{'PWD'} =~ s:\\:/:g ;
-return $ENV{'PWD'};
+my $pwd = `cmd /c cd`;
+chomp $pwd;
+$pwd =~ s:\\:/:g ;
+$ENV{'PWD'} = $pwd;
+return $pwd;
 }
 
 sub _win32_cwd_simple {
-$ENV{'PWD'} = `cd`;
-chomp $ENV{'PWD'};
-$ENV{'PWD'} =~ s:\\:/:g ;
-return $ENV{'PWD'};
+my $pwd = `cd`;
+chomp $pwd;
+$pwd =~ s:\\:/:g ;
+$ENV{'PWD'} = $pwd;
+return $pwd;
 }
 
 sub _win32_cwd {
+my $pwd;
 # Need to avoid taking any sort of reference to the typeglob or the code in
 # the optree, so that this tests the runtime state of things, as the
 # ExtUtils::MakeMaker tests for "miniperl" need to be able to fake things 
at
@@ -622,35 +625,38 @@ sub _win32_cwd {
 # problems (for reasons that we haven't been able to get to the bottom of -
 # rt.cpan.org #56225)
 if (*{$DynaLoader::{boot_DynaLoader}}{CODE}) {
-   $ENV{'PWD'} = Win32::GetCwd();
+   $pwd = Win32::GetCwd();
 }
 else { # miniperl
-   chomp($ENV{'PWD'} = `cd`);
+   chomp($pwd = `cd`);
 }
-$ENV{'PWD'} =~ s:\\:/:g ;
-return $ENV{'PWD'};
+$pwd =~ s:\\:/:g ;
+$ENV{'PWD'} = $pwd;
+return $pwd;
 }
 
 *_NT_cwd = defined &Win32::GetCwd ? \&_win32_cwd : \&_win32_cwd_simple;
 
 sub _dos_cwd {
+my $pwd;
 if (!defined &Dos::GetCwd) {
-$ENV{'PWD'} = `command /c cd`;
-chomp $ENV{'PWD'};
-$ENV{'PWD'} =~ s:\\:/:g ;
+chomp($pwd = `command /c cd`);
+$pwd =~ s:\\:/:g ;
 } else {
-$ENV{'PWD'} = Dos::GetCwd();
+$pwd = Dos::GetCwd();
 }
-return $ENV{'PWD'};
+$ENV{'PWD'} = $pwd;
+return $pwd;
 }
 
 sub _qnx_cwd {
local $ENV{PATH} = '';
local $ENV{CDPATH} = '';
local $ENV{ENV} = '';
-$ENV{'PWD'} = `/usr/bin/fullpath -t`;
-chomp $ENV{'PWD'};
-return $ENV{'PWD'};
+my $pwd = `/usr/bin/fullpath -t`;
+chomp $pwd;
+$ENV{'PWD'} = $pwd;
+return $pwd;
 }
 
 sub _qnx_abs_path {
@@ -669,8 +675,7 @@ sub _qnx_abs_path {
 }
 
 sub _epoc_cwd {
-$ENV{'PWD'} = EPOC::getcwd();
-return $ENV{'PWD'};
+return $ENV{'PWD'} = EPOC::getcwd();
 }
 
 
diff --git a/dist/PathTools/lib/File/Spec.pm b/dist/PathTools/lib/File/Spec.pm
index 8c77c98..2f35526 100644
--- a/dist/PathTools/lib/File/Spec.pm
+++ b/dist/PathTools/lib/File/Spec.pm
@@ -3,7 +3,7 @@ package File::Spec;
 use strict;
 use vars qw(@ISA $VERSION);
 
-$VERSION = '3.56';
+$VERSION = '3.57';
 $VERSION =~ tr/_//;
 
 my %module = (MacOS   => 'Mac',
diff --git a/dist/PathTools/lib/File/Spec/Cygwin.pm 
b/dist/PathTools/lib/File/Spec/Cygwin.pm
index 1b77e6a..e5839e9 100644
--- a/dist/PathTools/lib/File/Spec/Cygwin.pm
+++ b/dist/PathTools/lib/File/Spec/Cygwin.pm
@@ -4,7 +4,7 @@ use strict;
 use vars qw(@ISA $VERSION);
 require File::Spec::Unix;
 
-$VERSION = '3.56';
+$VERSION = '3.57';
 $VERSION =~ tr/_//;
 
 @ISA = qw(File::Spec::Unix);
diff --git a/dist/PathTools/lib/File/Spec/Epoc.pm 
b/dist/PathTools/lib/File/Spec/Epoc.pm
index 7bc3867..3

<    1   2   3   4   5   6   7   8   9   10   >