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 <t...@develop-help.com> 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 <t...@develop-help.com> 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/stacksize compute stack sizes -dist/Storable/stacksize_in.h computed stack sizes dist/Storable/Storable.xs Storable extension dist/Storable/Storable.pm.PL perl script to generate Storable.pm from template dist/Storable/t/attach.t Check STORABLE_attach doesn't create objects unnecessarily 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..0000000000 --- a/dist/Storable/stacksize_in.h +++ /dev/null @@ -1,2 +0,0 @@ -/* initially empty */ -#undef PST_STACK_MAX_DEPTH -- Perl5 Master Repository