summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/pragma/warn/regexec
blob: 73696dfb1d6a7d31228ce6714269358d7b627cef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
  regexec.c	

  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)*$/ ;
  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
print("SKIPPED\n# most systems run into stacksize limits\n"),exit;
use warnings 'regexp' ;
$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 'regexp' ;
$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

########
# regexec.c
print("SKIPPED\n# most systems run into stacksize limits\n"),exit;
use warnings 'regexp' ;
$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 'regexp' ;
$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

OpenPOWER on IntegriCloud