a lot of group operators may cause segmentation fault
Opened this issue · 2 comments
Deleted user commented
% mruby -e 'Regexp.new("()" * 4000) =~ ""'
% mruby -e 'Regexp.new("()" * 8191) =~ ""'
zsh: segmentation fault (core dumped) mruby -e 'Regexp.new("()" * 8191) =~ ""'
% mruby -e 'Regexp.new("()" * 8192) =~ ""'
trace:
[0] -e:1
-e:1: invalid regular expression (ArgumentError)
count | result |
---|---|
4000 | ok (30 tries without crash) |
5450 | ok (30 tries without crash) |
5460 | crash 1 out of 30+ tries |
5470 | crash 1 out of 10 tries |
5480 | crash 1 out of 7,8 tries |
5666 | crash 1 out of 2 tries |
5721 | crash 4 out of 5 tries |
8191 | crash 20 out of 20 tries |
8192 | error (ArgumentError) |
(on OpenBSD5.3/amd64)
Deleted user commented
Related issue: https://bugs.ruby-lang.org/issues/8716 (CRuby)
Deleted user commented
To define NO_RECURSE in config.h eliminates the issue but it makes pcre_exec() 4 times slower...