was Re: [ID 19991102.003] perl on os390
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / regexec
index 158a753..b9ba790 100644 (file)
@@ -1,17 +1,51 @@
   regexec.c    
 
-  count exceeded %d
+  This test generates "bad free" warnings when run under
+  PERL_DESTRUCT_LEVEL.  This file merely serves as a placeholder
+  for investigation.
+
+  Complex regular subexpression recursion limit (%d) exceeded
 
         $_ = 'a' x (2**15+1); /^()(a\1)*$/ ;
-  count exceeded %d
+  Complex regular subexpression recursion limit (%d) exceeded
 
         $_ = 'a' x (2**15+1); /^()(a\1)*?$/ ;
 
+  (The actual value substituted for %d is masked in the tests so that
+  REG_INFTY configuration variable value does not affect outcome.)
 __END__
 # regexec.c
-use warning 'unsafe' ;
-print("SKIPPED\n# win32 can't increase stacksize in shell\n"),exit
-    if $^O eq 'MSWin32';
+print("SKIPPED\n# most systems run into stacksize limits\n"),exit;
+use warnings 'unsafe' ;
+$SIG{__WARN__} = sub{local ($m) = shift;
+                 $m =~ s/\(\d+\)/(*MASKED*)/;
+                 print STDERR $m};
+$_ = 'a' x (2**15+1); 
+/^()(a\1)*$/ ;
+#
+# If this test fails with a segmentation violation or similar,
+# you may have to increase the default stacksize limit in your
+# shell.  You may need superuser privileges.
+#
+# Under the sh, ksh, zsh:
+#    $ ulimit -s
+#    8192
+#    $ ulimit -s 16000
+#
+# Under the csh:
+#    % limit stacksize
+#    stacksize        8192 kbytes
+#    % limit stacksize 16000
+#
+EXPECT
+Complex regular subexpression recursion limit (*MASKED*) exceeded at - line 9.
+########
+# regexec.c
+print("SKIPPED\n# most systems run into stacksize limits\n"),exit;
+no warnings 'unsafe' ;
+$SIG{__WARN__} = sub{local ($m) = shift;
+                 $m =~ s/\(\d+\)/(*MASKED*)/;
+                 print STDERR $m};
 $_ = 'a' x (2**15+1); 
 /^()(a\1)*$/ ;
 #
@@ -30,12 +64,14 @@ $_ = 'a' x (2**15+1);
 #    % limit stacksize 16000
 #
 EXPECT
-Complex regular subexpression recursion limit (32766) exceeded at - line 6.
+
 ########
 # regexec.c
-use warning 'unsafe' ;
-print("SKIPPED\n# win32 can't increase stacksize in shell\n"),exit
-    if $^O eq 'MSWin32';
+print("SKIPPED\n# most systems run into stacksize limits\n"),exit;
+use warnings 'unsafe' ;
+$SIG{__WARN__} = sub{local ($m) = shift;
+                 $m =~ s/\(\d+\)/(*MASKED*)/;
+                 print STDERR $m};
 $_ = 'a' x (2**15+1);
 /^()(a\1)*?$/ ;
 #
@@ -54,4 +90,30 @@ $_ = 'a' x (2**15+1);
 #    % limit stacksize 16000
 #
 EXPECT
-Complex regular subexpression recursion limit (32766) exceeded at - line 6.
+Complex regular subexpression recursion limit (*MASKED*) exceeded at - line 9.
+########
+# regexec.c
+print("SKIPPED\n# most systems run into stacksize limits\n"),exit;
+no warnings 'unsafe' ;
+$SIG{__WARN__} = sub{local ($m) = shift;
+                 $m =~ s/\(\d+\)/(*MASKED*)/;
+                 print STDERR $m};
+$_ = 'a' x (2**15+1);
+/^()(a\1)*?$/ ;
+#
+# If this test fails with a segmentation violation or similar,
+# you may have to increase the default stacksize limit in your
+# shell.  You may need superuser privileges.
+#
+# Under the sh, ksh, zsh:
+#    $ ulimit -s
+#    8192
+#    $ ulimit -s 16000
+#
+# Under the csh:
+#    % limit stacksize
+#    stacksize        8192 kbytes
+#    % limit stacksize 16000
+#
+EXPECT
+