@@ -40,9 +40,9 @@ if ($^O eq "MSWin32") {
4040 SetErrorMode(SEM_NOGPFAULTERRORBOX() | SEM_FAILCRITICALERRORS());
4141}
4242# the ; here is to ensure system() passes this to the shell
43- elsif (system (" ulimit -c 0 ;" ) == 0) {
43+ elsif (system (" ulimit -c 0;" ) == 0) {
4444 # try to prevent core dumps
45- $prefix = " ulimit -c 0 ; " ;
45+ $prefix = " ulimit -c 0; " ;
4646}
4747if (@ARGV and $ARGV [0] eq ' --core' ) {
4848 $ENV {PERL_CORE } = 1;
@@ -77,7 +77,7 @@ if ($^O eq "MSWin32") {
7777 my ($str , $major , $minor ) = Win32::GetOSVersion();
7878 if ($major < 6 || $major == 6 && $minor < 1) {
7979 print " Using defaults for older Win32\n " ;
80- write_limits(500, 256 );
80+ write_limits(500, 250 );
8181 exit ;
8282 }
8383}
@@ -114,29 +114,19 @@ if (PARALLEL) {
114114 sleep (2.0);
115115}
116116
117- my $use_W32J = 0;
118- if ($^O eq ' MSWin32' && $^V ge v5.18.0) {
119- eval { require Win32::Job;$use_W32J =1;}
120- }
121117sub runcmd {
122118 my $cmd = shift ;
123- unless ($use_W32J ) {
124- return ` $cmd ` =~ / \b ok\b / ? 0 : 1;
125- }
126- my $job = Win32::Job-> new;
127- my $pid = $job -> spawn(q{ perl} , $cmd );
128- $job -> run(5);
129- my $status = $job -> status;
130- return $job -> status-> {$pid }{exitcode };
119+ return ` $cmd ` =~ / \b ok\b / ? 0 : 1;
131120}
132121
133122sub cmd {
134123 my ($i , $try , $limit_name ) = @_ ;
135124 die unless $i ;
136- my $code = " my \$ t; \$ Storable::$limit_name = -1; $try for 1..$i ;dclone(\$ t); print qq/ok\n /" ;
125+ my $code = " my \$ t; \$ Storable::$limit_name = -1; " .
126+ " $try for 1..$i ; dclone(\$ t); print qq/ok\n /" ;
137127 my $q = ($^O eq ' MSWin32' ) ? ' "' : " '" ;
138128
139- " $prefix $PERL $mblib -MStorable=dclone -e$q$code$q "
129+ " $prefix$PERL $mblib -MStorable=dclone -e$q$code$q "
140130}
141131# try more
142132sub good {
@@ -187,11 +177,15 @@ while (!$found) {
187177 $n = bad($n );
188178 }
189179}
180+ if ($n == 100) {
181+ $n = 500;
182+ }
190183print " MAX_DEPTH = $n \n " unless QUIET;
191184my $max_depth = $n ;
192185
193186($n , $good , $bad , $found ) =
194- (int ($n /2), 50, $n , undef );
187+ (int ($n /2), $^O eq ' MSWin32' ? 32 : 50, $n , undef );
188+ my $good_orig = $good ;
195189# pack j only since 5.8
196190my $max = ($] > 5.007 and length (pack " j" , 0) < 8)
197191 ? ($^O eq ' MSWin32' ? 3000 : 8000)
@@ -207,8 +201,8 @@ while (!$found) {
207201 $n = bad($n );
208202 }
209203}
210- if ($max_depth == $bad1 -1
211- and $n == $bad2 -1 )
204+ if (( $max_depth == $bad1 -1 and $n == $bad2 -1)
205+ or ( $n == $good_orig ) )
212206{
213207 # more likely the shell. travis docker ubuntu, mingw e.g.
214208 print " Error: Apparently your system(SHELLSTRING) cannot catch stack overflows\n "
0 commit comments