[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



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 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-g2b0e1a9e90

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



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 smoke-me/khw-locale created. v5.27.8-415-g258cbc01b0

2018-02-27 Thread Karl Williamson
In perl.git, the branch smoke-me/khw-locale has been created



at  258cbc01b08238128891378ab3b00ebc8b8bfabe (commit)

- Log -
commit 258cbc01b08238128891378ab3b00ebc8b8bfabe
Author: Karl Williamson 
Date:   Sun Feb 25 21:38:21 2018 -0700

Silence wrong clang warnings

Clang thread-safety analysis fails to correctly work in this situation
(and is documented as failing), so turn off that warning here.

commit 02dac30ce86ca155bb3ec95a4274e371ed1c5dca
Author: Karl Williamson 
Date:   Fri Feb 23 11:18:56 2018 -0700

XXX combine with something else pp.c: Add blank line

commit 7403c18ad8f54e9a4b51073e21942dceb1ea43c6
Author: Karl Williamson 
Date:   Wed Feb 14 21:25:41 2018 -0700

XXX don't push t/un/locale.t: Add debugging code

---

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/khw-locale deleted. v5.27.8-397-g5649686d87

2018-02-27 Thread Karl Williamson
In perl.git, the branch smoke-me/khw-locale has been deleted



   was  5649686d87184300f2e669304127284ea43d0fcb

- Log -
5649686d87184300f2e669304127284ea43d0fcb APItest/t/locale.t: Add detail to test 
names
---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-412-g7276ff5bb3

2018-02-27 Thread Father Chrysostomos
In perl.git, the branch blead has been updated



- Log -
commit 7276ff5bb307b4639027305f3db927826089f646
Author: Father Chrysostomos 
Date:   Tue Feb 27 11:24:09 2018 -0800

Carp: Speed up longmess some more

Commit 915a6810d added a UNIVERSAL::isa check to format_arg (used by
longmess, which generates stack traces) to see whether an argument is
blessed before trying CARP_TRACE, to speed things up when the argu-
ment is not blessed.

Because this would cause infinite recursion when the UNIVERSAL::isa
module is loaded, a check was put in place to avoid this problem.  But
the check was a run-time check, and so the speed-up was minimal.

If we move the check to compile time (and save the original
&UNIVERSAL::isa in case the module gets loaded later), then the speed-
up is signifant.  That is what this patch does.

Before this patch, the following one-liner runs on my machine in 6
seconds on average:

$ ./perl -MCarp -Ilib -e 'sub f { my $c = shift; if ($c == 100) { 
Carp::longmess() } else { f($c+1,{}) } } f(0,{}) for 1..500'

If I disable the isa check (just to see how much it was speeding
things up), it averages 6.5 seconds, not much of a difference.

If I move the $UNIVERSAL::isa::VERSION safety check to compile time
instead of run time, I can reduce the time to 4.9 seconds.

---

Summary of changes:
 dist/Carp/lib/Carp.pm | 33 -
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm
index 10509d4339..25ba942ad1 100644
--- a/dist/Carp/lib/Carp.pm
+++ b/dist/Carp/lib/Carp.pm
@@ -130,6 +130,22 @@ sub _univ_mod_loaded {
 }
 }
 
+# _maybe_isa() is usually the UNIVERSAL::isa function.  We have to avoid
+# the latter if the UNIVERSAL::isa module has been loaded, to avoid infi-
+# nite recursion; in that case _maybe_isa simply returns true.
+my $isa;
+BEGIN {
+if (_univ_mod_loaded('isa')) {
+*_maybe_isa = sub { 1 }
+}
+else {
+# Since we have already done the check, record $isa for use below
+# when defining _StrVal.
+*_maybe_isa = $isa = _fetch_sub(UNIVERSAL => "isa");
+}
+}
+
+
 # We need an overload::StrVal or equivalent function, but we must avoid
 # loading any modules on demand, as Carp is used from __DIE__ handlers and
 # may be invoked after a syntax error.
@@ -165,18 +181,15 @@ BEGIN {
 
 # _blessed is either UNIVERAL::isa(...), or, in the presence of an
 # override, a hideous, but fairly reliable, workaround.
-*_blessed = _univ_mod_loaded('isa')
-? sub {
+*_blessed = $isa
+? sub { &$isa($_[0], "UNIVERSAL") }
+: sub {
 my $probe = "UNIVERSAL::Carp_probe_" . rand;
 no strict 'refs';
 local *$probe = sub { "unlikely string" };
 local $@;
 local $SIG{__DIE__} = sub{};
 (eval { $_[0]->$probe } || '') eq 'unlikely string'
-  }
-: do {
-my $isa = _fetch_sub(qw/UNIVERSAL isa/);
-sub { &$isa($_[0], "UNIVERSAL") }
   };
 
 *_StrVal = sub {
@@ -387,14 +400,8 @@ sub format_arg {
 
 if ( my $pack= ref($arg) ) {
 
-# lazy check if the CPAN module UNIVERSAL::isa is used or not
-#   if we use a rogue version of UNIVERSAL this would lead to infinite 
loop
-my $isa = _univ_mod_loaded('isa')
-? sub { 1 }
-: _fetch_sub(UNIVERSAL => "isa");
-
  # legitimate, let's not leak it.
-if (!$in_recurse && $isa->( $arg, 'UNIVERSAL' ) &&
+if (!$in_recurse && _maybe_isa( $arg, 'UNIVERSAL' ) &&
do {
 local $@;
local $in_recurse = 1;

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-411-g52c17dc66e

2018-02-27 Thread Karl Williamson
In perl.git, the branch blead has been updated



- Log -
commit 52c17dc66edf9b267b592425fbd10e39c5606e26
Author: Karl Williamson 
Date:   Tue Feb 27 13:08:07 2018 -0700

t/re/regexp.t: Silence HP-UX warnings

The tests that use t/re/re_tests may use a locale.  It doesn't much
matter which locale, except we want one that isn't going to generate
warnings.

commit 69e2275ee45c7633c05736b212acc0cb7ca08a59
Author: Karl Williamson 
Date:   Tue Feb 27 11:27:46 2018 -0700

perlapi: Fix typo

---

Summary of changes:
 locale.c  | 2 +-
 t/re/regexp.t | 7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/locale.c b/locale.c
index d7fe766889..ead73e5554 100644
--- a/locale.c
+++ b/locale.c
@@ -2274,7 +2274,7 @@ rather than getting segfaults at runtime.
 
 =item *
 
-It delivers the correct results for the C and C items,
+It delivers the correct results for the C and C items,
 without you having to write extra code.  The reason for the extra code would be
 because these are from the C locale category, which is normally
 kept set to the C locale by Perl, no matter what the underlying locale is
diff --git a/t/re/regexp.t b/t/re/regexp.t
index 835cbdc668..037d7b7a48 100644
--- a/t/re/regexp.t
+++ b/t/re/regexp.t
@@ -71,6 +71,13 @@ BEGIN {
print("1..0 # Skip Unicode tables not built yet\n"), exit
unless eval 'require "unicore/Heavy.pl"';
 }
+
+# Some of the tests need a locale; which one doesn't much matter, except
+# that it be valid.  Make sure of that
+eval { require POSIX;
+POSIX->import(qw(LC_ALL setlocale));
+POSIX::setlocale(&LC_ALL, "C");
+};
 }
 
 sub _comment {

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-409-gf1bfbdda19

2018-02-27 Thread Karl Williamson
In perl.git, the branch blead has been updated



- Log -
commit f1bfbdda19c74059bee234561325e09c9d0a9708
Author: Daniel Dragan 
Date:   Sun Feb 25 21:31:26 2018 -0500

remove unreferenced copies of char * swash_property_names[]

Due to some MSVC bug or perl's not using MS specific CC options that I've
never figured out, MSVC does not remove unreferenced by a single .obj or
combine identical, static const data vars. MSVC funcs get removed &
combined correctly. Since for var swash_property_names removing it from
.objs that dont need it is very easy, do it. It saves some memory space.
Perhaps some other platforms/OSes/CCs have similar problems removing
unreferenced symbols from final binaries so this patch would help on those
CCs too.

regexec.c stopped using swash_property_names in commit 2a16ac9277 in 5.19.8
"regexec.c: Use compiled-in POSIX definitions"

regcomp.c stopped using swash_property_names in commit bcb875216f in 5.19.8
"regcomp.c: Rmv code for delayed 'til runtime POSIX defns"

with MSVC 2008 64, before

miniperl.exe disk file size 1761KB .rdata virtual size 0xBC354 bytes
perl527.dll disk file size 2040KB .rdata virtual size 0xC9421 bytes

after this commit

miniperl.exe disk file size 1761KB .rdata virtual size 0xBC2C4 bytes
perl527.dll disk file size 2040KB .rdata virtual size 0xC9381 bytes

~144 bytes saved by removing unused copies of swash_property_names array.

There are other cases of large duplicate static const data vars still in
the perl527.dll binary but this patch covers a very simple case.

---

Summary of changes:
 handy.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/handy.h b/handy.h
index 12d73b9087..7fe1cf6caa 100644
--- a/handy.h
+++ b/handy.h
@@ -1216,9 +1216,7 @@ typedef enum {
 #define POSIX_SWASH_COUNT _FIRST_NON_SWASH_CC
 #define POSIX_CC_COUNT(_HIGHEST_REGCOMP_DOT_H_SYNC + 1)
 
-#if defined(PERL_IN_UTF8_C) \
- || defined(PERL_IN_REGCOMP_C)  \
- || defined(PERL_IN_REGEXEC_C)
+#if defined(PERL_IN_UTF8_C)
 #   if _CC_WORDCHAR != 0 || _CC_DIGIT != 1 || _CC_ALPHA != 2 || _CC_LOWER != 3 
\
|| _CC_UPPER != 4 || _CC_PUNCT != 5 || _CC_PRINT != 6   
\
|| _CC_ALPHANUMERIC != 7 || _CC_GRAPH != 8 || _CC_CASED != 9

-- 
Perl5 Master Repository


[perl.git] branch sprout/carp-strval deleted. v5.27.8-399-gce79635448

2018-02-27 Thread Father Chrysostomos
In perl.git, the branch sprout/carp-strval has been deleted



   was  ce796354483847023b2bf19c360d1d5e4aeff094

- Log -
ce796354483847023b2bf19c360d1d5e4aeff094 Carp: Avoid run-time mods; StrVal 
workarounds
---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-408-ga0da1e165c

2018-02-27 Thread Father Chrysostomos
In perl.git, the branch blead has been updated



- Log -
commit a0da1e165c011c775b9f39a37ab6d3dd6a1c0969
Author: Father Chrysostomos 
Date:   Mon Feb 26 09:23:28 2018 -0800

warnings.pm: _at_level functions and chunky handles

The _at_level functions, which have to bypass Carp, were not
reporting non-line-based filehandles correctly.  The perl core
does:

...,  chunk 7.

if $/ is not "\n".  warnings.pm should do the same.  It was using
‘line’.

commit 5c8d1071aaf72214e66b1a224890384ab6ca5153
Author: Father Chrysostomos 
Date:   Mon Feb 26 01:23:53 2018 -0800

Carp: Avoid run-time mods; StrVal workarounds

Carp needs to avoid loading modules while reporting errors, because
it may be invoked via $SIG{__DIE__} after a syntax error, when BEGIN
blocks are forbidden.

Before this commit (as of v5.27.8-360-gc99363a) it was doing just that
for reference arguments within stack traces.

That means we either need to load overload.pm at start-up so that
overload::StrVal is already available, or avoid overload::StrVal
altogether.

It turns out that various versions of overload::StrVal have
their own problems that prevent Carp from using them (out-
lined in the comments added to Carp.pm and also described at
).

So we now follow two approaches:  If overloading.pm is available, use
that; otherwise, use a hideous workaround inspired by ancient imple-
entations of overload::StrVal and Scalar::Util::blessed, while avoid-
ing the bugs in those old versions.

---

Summary of changes:
 MANIFEST  |  1 +
 dist/Carp/lib/Carp.pm | 91 ---
 dist/Carp/t/stack_after_err.t | 73 ++
 dist/Carp/t/vivify_stash.t| 12 +++---
 lib/warnings.pm   |  5 ++-
 regen/warnings.pl |  5 ++-
 t/lib/warnings/9enabled   | 19 +
 7 files changed, 175 insertions(+), 31 deletions(-)
 create mode 100644 dist/Carp/t/stack_after_err.t

diff --git a/MANIFEST b/MANIFEST
index acc1bcba7f..b054110b65 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -2975,6 +2975,7 @@ dist/Carp/t/errno.t   See if Carp preserves 
$! and $^E
 dist/Carp/t/heavy.tSee if Carp::Heavy works
 dist/Carp/t/heavy_mismatch.t   See if Carp::Heavy catches version 
mismatch
 dist/Carp/t/rt52610_crash.tTest that we can gracefully handle 
serializing the stack with stack-refcounting bugs
+dist/Carp/t/stack_after_err.t  Test stack traces after syntax errors
 dist/Carp/t/stash_deletion.t   See if Carp handles stash deletion
 dist/Carp/t/swash.tSee if Carp avoids breaking swash loading
 dist/Carp/t/vivify_gv.tSee if Carp leaves utf8:: stuff alone
diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm
index d5443ba676..10509d4339 100644
--- a/dist/Carp/lib/Carp.pm
+++ b/dist/Carp/lib/Carp.pm
@@ -130,12 +130,71 @@ sub _univ_mod_loaded {
 }
 }
 
-# _mycan is either UNIVERSAL::can, or, in the presence of an override,
-# overload::mycan.
+# We need an overload::StrVal or equivalent function, but we must avoid
+# loading any modules on demand, as Carp is used from __DIE__ handlers and
+# may be invoked after a syntax error.
+# We can copy recent implementations of overload::StrVal and use
+# overloading.pm, which is the fastest implementation, so long as
+# overloading is available.  If it is not available, we use our own pure-
+# Perl StrVal.  We never actually use overload::StrVal, for various rea-
+# sons described below.
+# overload versions are as follows:
+# undef-1.00 (up to perl 5.8.0)   uses bless (avoid!)
+# 1.01-1.17  (perl 5.8.1 to 5.14) uses Scalar::Util
+# 1.18+  (perl 5.16+) uses overloading
+# The ancient 'bless' implementation (that inspires our pure-Perl version)
+# blesses unblessed references and must be avoided.  Those using
+# Scalar::Util use refaddr, possibly the pure-Perl implementation, which
+# has the same blessing bug, and must be avoided.  Also, Scalar::Util is
+# loaded on demand.  Since we avoid the Scalar::Util implementations, we
+# end up having to implement our own overloading.pm-based version for perl
+# 5.10.1 to 5.14.  Since it also works just as well in more recent ver-
+# sions, we use it there, too.
 BEGIN {
-*_mycan = _univ_mod_loaded('can')
-? do { require "overload.pm"; _fetch_sub overload => 'mycan' }
-: \&UNIVERSAL::can
+if (eval { require "overloading.pm" }) {
+*_StrVal = eval 'sub { no overloading; "$_[0]" }'
+}
+else {
+# 

[perl.git] branch blead updated. v5.27.8-406-gf88ca576ba

2018-02-27 Thread Dave Mitchell
In perl.git, the branch blead has been updated



- Log -
commit f88ca576baabd4517ec5766efa11b1e1fc8109af
Author: David Mitchell 
Date:   Tue Feb 27 15:32:25 2018 +

op.h: remove spurious #  define indent

whitespace-only change

---

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

diff --git a/op.h b/op.h
index 64668dcf0a..fc66e14a76 100644
--- a/op.h
+++ b/op.h
@@ -522,7 +522,7 @@ typedef enum {
 #  define  cMETHOPx_rclass(v) (cMETHOPx(v)->op_rclass_sv)
 #endif
 
-#  define  cMETHOPx_meth(v)cSVOPx_sv(v)
+#definecMETHOPx_meth(v)cSVOPx_sv(v)
 
 #definecGVOP_gvcGVOPx_gv(PL_op)
 #definecGVOPo_gv   cGVOPx_gv(o)

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-405-gf548aeca98

2018-02-27 Thread Dave Mitchell
In perl.git, the branch blead has been updated



- Log -
commit f548aeca987d23cf2002370a3bb78973830ff800
Author: David Mitchell 
Date:   Tue Feb 27 14:58:18 2018 +

ext/File-Glob/t/rt131211.t: fix timing issues

This test file occasionally fails test numbers 1 and/or 2 on smokes.
These two tests measure how long it takes to do a matching and
non-matching glob() with a lot of "a*a*a*" and fail if the
match and non-matching times differ too much (the original bug was that
non-match went exponential on number of "a*"'s).

However, on good systems, the timings returned are typically
sub-millisecond, so I'm guessing the occasional failures are due to

(small measured noise) * 100  > (another small measured noise).

So this commit avoids tests 1&2 failing unless the values measured
are large enough not to be merely noise.

This is just speculation on my part though - I couldn't reproduce a
failure myself.

---

Summary of changes:
 ext/File-Glob/t/rt131211.t | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/ext/File-Glob/t/rt131211.t b/ext/File-Glob/t/rt131211.t
index ed1b321f1d..4ac0d8729d 100644
--- a/ext/File-Glob/t/rt131211.t
+++ b/ext/File-Glob/t/rt131211.t
@@ -1,3 +1,8 @@
+# tests for RT 131211
+#
+# non-matching glob("a*a*a*...") went exponential time on number of a*'s
+
+
 use strict;
 use warnings;
 use v5.16.0;
@@ -49,14 +54,16 @@ while (++$count < 10) {
 $elapsed_fail -= time;
 @no_files= glob catfile $path, "x".("a*" x $count) . "c";
 $elapsed_fail += time;
-last if $elapsed_fail > $elapsed_match * 100;
+last if $elapsed_fail > ($elapsed_match < 0.2 ? 0.2 : $elapsed_match) * 
100;
 }
 
 is $count,10,
-"tried all the patterns without bailing out";
+"tried all the patterns without bailing out"
+or diag("elapsed_match=$elapsed_match elapsed_fail=$elapsed_fail");
 
 SKIP: {
-skip "unstable timing", 1 unless $elapsed_match && $elapsed_fail;
+skip "unstable  or too small timing", 1 unless
+$elapsed_match >= 0.001 && $elapsed_fail >= 0.001;
 ok $elapsed_fail <= 10 * $elapsed_match,
 "time to fail less than 10x the time to match"
 or diag("elapsed_match=$elapsed_match elapsed_fail=$elapsed_fail");

-- 
Perl5 Master Repository