[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



- 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 blead updated. v5.27.8-249-g48151d4db9

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



- Log -
commit 48151d4db91e290cc3646c7116cd1be14316a2de
Author: Karl Williamson 
Date:   Sun Feb 11 17:39:29 2018 -0700

podcheck.t: Recognize more forms of core files

This extends 199fc8cde4ec30a56626c0765b3b0efacb327664 to include more
common forms of core files.

.*\.core.*
core
core\..*

should all now be ignored.

---

Summary of changes:
 t/porting/podcheck.t | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/porting/podcheck.t b/t/porting/podcheck.t
index c34641679e..da52e26f5d 100644
--- a/t/porting/podcheck.t
+++ b/t/porting/podcheck.t
@@ -432,14 +432,14 @@ my $non_pods = qr/ (?: \.
| $dl_ext  # dynamic libraries
| gif  # GIF images (example files from CGI.pm)
| eg   # examples from libnet
-   | core
+   | core .*
)
$
 ) | ~$ | \ \(Autosaved\)\.txt$ # Other editor droppings
| ^cxx\$demangler_db\.$ # VMS name mangler database
| ^typemap\.?$  # typemap files
| ^(?i:Makefile\.PL)$
-   | ^core$
+   | ^core (?: $ | \. .* )
 /x;
 
 # Matches something that looks like a file name, but is enclosed in C<...>

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



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-248-g95634b11ca

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



- 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 blead updated. v5.27.8-247-ga7caeb5ea5

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



- Log -
commit a7caeb5ea5f808dade098c97e87d3354b994f68f
Author: Father Chrysostomos 
Date:   Sun Feb 11 12:40:09 2018 -0800

Test for _at_level functions with fh

commit 25ebbc22701a587d60124611ae3b072d2d47883a
Author: Slaven Rezić 
Date:   Sun Feb 11 12:36:07 2018 -0800

warnings: Omit handle when $. is 0

otherwise the new _at_level functions end up including
‘at  line 0’.

[Commit message by the committer.]

---

Summary of changes:
 lib/warnings.pm |  2 +-
 regen/warnings.pl   |  2 +-
 t/lib/warnings/9enabled | 18 ++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/lib/warnings.pm b/lib/warnings.pm
index ea88daf891..911c5aad5a 100644
--- a/lib/warnings.pm
+++ b/lib/warnings.pm
@@ -448,7 +448,7 @@ sub __chk
 # If we have an explicit level, bypass Carp.
 if ($has_level and @callers_bitmask) {
my $stuff = " at " . join " line ", (caller $i)[1,2];
-   $stuff .= ", <" . *${^LAST_FH}{NAME} . "> line $." if ${^LAST_FH};
+   $stuff .= ", <" . *${^LAST_FH}{NAME} . "> line $." if $. && ${^LAST_FH};
die "$message$stuff.\n" if $results[0];
return warn "$message$stuff.\n";
 }
diff --git a/regen/warnings.pl b/regen/warnings.pl
index a94a7522e8..ef2d16999b 100644
--- a/regen/warnings.pl
+++ b/regen/warnings.pl
@@ -765,7 +765,7 @@ sub __chk
 # If we have an explicit level, bypass Carp.
 if ($has_level and @callers_bitmask) {
my $stuff = " at " . join " line ", (caller $i)[1,2];
-   $stuff .= ", <" . *${^LAST_FH}{NAME} . "> line $." if ${^LAST_FH};
+   $stuff .= ", <" . *${^LAST_FH}{NAME} . "> line $." if $. && ${^LAST_FH};
die "$message$stuff.\n" if $results[0];
return warn "$message$stuff.\n";
 }
diff --git a/t/lib/warnings/9enabled b/t/lib/warnings/9enabled
index bbef5e8d41..7a9acd4bb8 100644
--- a/t/lib/warnings/9enabled
+++ b/t/lib/warnings/9enabled
@@ -1436,3 +1436,21 @@ Died: A fatal syntax warning at - line 25.
 A syntax warning at - line 23.
 A utf8 warning at - line 25.
 Died: A fatal utf8 warning at - line 23.
+
+# NAME _at_level with filehandle
+use warnings;
+# Create temp file for testing handles.
+open oUt, ">tmp" or die $!;
+print oUt "foo\nbar\n";
+close oUt;
+sub bimp {
+ open FH, "tmp";
+ ; ;
+ warnings::warn_at_level("syntax", 0, "Foo warning");
+ close FH;
+ warnings::warn_at_level("syntax", 0, "Bar warning");
+};
+bimp;
+EXPECT
+Foo warning at - line 13,  line 2.
+Bar warning at - line 13.

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/khw-locale updated. v5.27.8-275-g5c275c5dac

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



- Log -
commit 5c275c5dac08448fe9f6f5bd3e4a6286b8276b98
Author: Karl Williamson 
Date:   Sun Feb 11 12:35:19 2018 -0700

more 10

---

Summary of changes:
 perl.h | 5 -
 1 file changed, 5 deletions(-)

diff --git a/perl.h b/perl.h
index b6ce5f1baa..f46c541fb4 100644
--- a/perl.h
+++ b/perl.h
@@ -5642,11 +5642,6 @@ typedef struct am_table_short AMTS;
  * mutexes could be combined */
 #define LOCALE_LOCK \
 STMT_START {\
-if (PL_lc_numeric_mutex_depth > 0) {\
-Perl_croak_nocontext("panic: %s: %d: Can't call LOCAL_LOCK" \
- " from when LC_NUMERIC is locked", \
- __FILE__, __LINE__);   \
-}   \
 DEBUG_Lv(PerlIO_printf(Perl_debug_log,  \
 "%s: %d: locking locale\n", __FILE__, __LINE__));   \
 MUTEX_LOCK(&PL_locale_mutex);   \

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/khw-locale updated. v5.27.8-274-g93c93b7b53

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



- Log -
commit 93c93b7b533c66e9f6658ccc2c1c28e35d54acf7
Author: Karl Williamson 
Date:   Sun Feb 11 11:53:18 2018 -0700

more9

---

Summary of changes:
 perl.h | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/perl.h b/perl.h
index aeee1883cb..b6ce5f1baa 100644
--- a/perl.h
+++ b/perl.h
@@ -5600,15 +5600,14 @@ typedef struct am_table_short AMTS;
 }   \
 else {  \
 PL_lc_numeric_mutex_depth++;\
+DEBUG_Lv(PerlIO_printf(Perl_debug_log,  \
+"%s: %d: avoided lc_numeric_lock; depth=%d\n",  \
+__FILE__, __LINE__, PL_lc_numeric_mutex_depth));\
 if (cond_to_panic_if_already_locked) {  \
 Perl_croak_nocontext("panic: %s: %d: Trying to change"  \
  " LC_NUMERIC incompatibly",\
  __FILE__, __LINE__);   \
 }   \
-\
-DEBUG_Lv(PerlIO_printf(Perl_debug_log,  \
-"%s: %d: avoided lc_numeric_lock; depth=%d\n",  \
-__FILE__, __LINE__));   \
 }   \
 } STMT_END
 
@@ -5622,10 +5621,10 @@ typedef struct am_table_short AMTS;
  __FILE__, __LINE__));  \
 }   \
 else {  \
-PL_lc_numeric_mutex_depth++;\
+PL_lc_numeric_mutex_depth--;\
 DEBUG_Lv(PerlIO_printf(Perl_debug_log,  \
 "%s: %d: avoided lc_numeric_unlock; depth=%d\n",\
-__FILE__, __LINE__));   \
+__FILE__, __LINE__, PL_lc_numeric_mutex_depth));\
 }   \
 } STMT_END
 
@@ -5643,6 +5642,11 @@ typedef struct am_table_short AMTS;
  * mutexes could be combined */
 #define LOCALE_LOCK \
 STMT_START {\
+if (PL_lc_numeric_mutex_depth > 0) {\
+Perl_croak_nocontext("panic: %s: %d: Can't call LOCAL_LOCK" \
+ " from when LC_NUMERIC is locked", \
+ __FILE__, __LINE__);   \
+}   \
 DEBUG_Lv(PerlIO_printf(Perl_debug_log,  \
 "%s: %d: locking locale\n", __FILE__, __LINE__));   \
 MUTEX_LOCK(&PL_locale_mutex);   \

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/jkeenan/pathtools-20180211 created. v5.27.8-248-g9c5d14be6d

2018-02-11 Thread James Keenan
In perl.git, the branch smoke-me/jkeenan/pathtools-20180211 has been created

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

at  9c5d14be6d25b04fac0a946edd23f70ee8b6f563 (commit)

- Log -
commit 9c5d14be6d25b04fac0a946edd23f70ee8b6f563
Author: James E Keenan 
Date:   Sun Feb 11 11:49:19 2018 -0500

Add ABSTRACT, LICENSE, AUTHOR, etc. elements.

Add them conditionally so that CPAN PathTools can accommodate different
versions of ExtUtils::MakeMaker and CPAN metadata protocols.

Styled after Module-CoreList's Makefile.PL for better readability.

commit 346aca5cf3d5ac5b7829bba94ba0ce5cbd1d3626
Author: James E Keenan 
Date:   Sun Feb 11 11:44:21 2018 -0500

Ensure that all tests in t/cwd.t have descriptions.

commit 01fdf3bd78f424bd4622ad0f77dc30bcbcafa53e
Author: James E Keenan 
Date:   Sun Feb 11 11:36:45 2018 -0500

Provide .gitignore for PathTools distribution.

---

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/khw-locale updated. v5.27.8-273-g8b9fd226e8

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



- Log -
commit 8b9fd226e8182db31e23a5599ff9bb9a02f710a3
Author: Karl Williamson 
Date:   Sun Feb 11 09:56:38 2018 -0700

more8

---

Summary of changes:
 embedvar.h |   2 +-
 intrpvar.h |   2 +-
 locale.c   |   6 +--
 perl.h | 165 +
 sv.c   |   2 +-
 vutil.c|   4 +-
 6 files changed, 85 insertions(+), 96 deletions(-)

diff --git a/embedvar.h b/embedvar.h
index 1bd88097c5..2d71e88dd6 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -188,7 +188,7 @@
 #define PL_lastgotoprobe   (vTHX->Ilastgotoprobe)
 #define PL_laststatval (vTHX->Ilaststatval)
 #define PL_laststype   (vTHX->Ilaststype)
-#define PL_lc_numeric_recurse  (vTHX->Ilc_numeric_recurse)
+#define PL_lc_numeric_mutex_depth  (vTHX->Ilc_numeric_mutex_depth)
 #define PL_locale_utf8ness (vTHX->Ilocale_utf8ness)
 #define PL_localizing  (vTHX->Ilocalizing)
 #define PL_localpatches(vTHX->Ilocalpatches)
diff --git a/intrpvar.h b/intrpvar.h
index 7b3b191096..da35aaeb55 100644
--- a/intrpvar.h
+++ b/intrpvar.h
@@ -262,7 +262,7 @@ PERLVAR(I, exit_flags,  U8) /* was exit() 
unexpected, etc. */
 PERLVAR(I, utf8locale, bool)   /* utf8 locale detected */
 PERLVAR(I, in_utf8_CTYPE_locale, bool)
 PERLVAR(I, in_utf8_COLLATE_locale, bool)
-PERLVARI(I, lc_numeric_recurse, int, 0)   /* Emulate general semaphore */
+PERLVARI(I, lc_numeric_mutex_depth, int, 0)   /* Emulate general semaphore */
 PERLVARA(I, locale_utf8ness, 256, char)
 
 #ifdef USE_LOCALE_CTYPE
diff --git a/locale.c b/locale.c
index d36a9af6d3..0db6fe9d33 100644
--- a/locale.c
+++ b/locale.c
@@ -921,7 +921,7 @@ S_emulate_setlocale(const int category,
 if (*p++ != '=') {
 Perl_croak(aTHX_
 "panic: %s: %d: Unexpected character in locale name '%02X",
-*(p-1));
+__FILE__, __LINE__, *(p-1));
 }
 
 /* Parse through the locale name */
@@ -934,7 +934,7 @@ S_emulate_setlocale(const int category,
 if (*p++ != ';') {
 Perl_croak(aTHX_
 "panic: %s: %d: Unexpected character in locale name '%02X",
-*(p-1));
+__FILE__, __LINE__, *(p-1));
 }
 
 /* Find the index of the category name in our lists */
@@ -4747,7 +4747,7 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category)
"panic: %s: %d: Corrupt utf8ness_cache: missing"
" separator %.*s<-- HERE %s\n",
__FILE__, __LINE__,
-   s - PL_locale_utf8ness, PL_locale_utf8ness,
+   (int) (s - PL_locale_utf8ness), PL_locale_utf8ness,
s);
 }
 s++;
diff --git a/perl.h b/perl.h
index b8e6e68c2d..aeee1883cb 100644
--- a/perl.h
+++ b/perl.h
@@ -5564,7 +5564,7 @@ typedef struct am_table_short AMTS;
 #define LOCALE_INIT
 #define LOCALE_LOCK
 #define LOCALE_UNLOCK
-#define LC_NUMERIC_LOCK
+#define LC_NUMERIC_LOCK(cond)
 #define LC_NUMERIC_UNLOCK
 #define LOCALE_TERM  STMT_START { _LOCALE_TERM_POSIX_2008; } STMT_END
 #  else
@@ -5578,18 +5578,55 @@ typedef struct am_table_short AMTS;
  * locale, so that other threads interrupting this one don't change it to the
  * wrong state before we've had a chance to complete our operation.  It can
  * stay locked over an entire printf operation, for example.  And so is made
- * distinct from the LOCALE_LOCK mutex */
-#define LC_NUMERIC_LOCK \
+ * distinct from the LOCALE_LOCK mutex.
+ *
+ * This simulates kind of a general semaphore.  The current thread will lock
+ * the mutex if the per-thread variable is zero, and then increments that
+ * variable.  Each corresponding UNLOCK decrements the variable until it is 0,
+ * at which point it actually unlocks the mutex.  Since the variable is
+ * per-thread, there is no race with other threads.  
+ *
+ * The single argument is a condition to test for, and if true, to panic, as
+ * this would be an attempt to complement the LC_NUMERIC state, and we're not
+ * supposed to because it's locked */
+#define LC_NUMERIC_LOCK(cond_to_panic_if_already_locked)\
 STMT_START {\
-DEBUG_Lv(PerlIO_printf(Perl_debug_log,  \
-"%s: %d: locking lc_numeric\n", __FILE__, __LINE__));   \
-MUTEX_LOCK(&PL_lc_numeric_mutex);