Project

General

Profile

Actions

Bug #20212

closed

Regex match method is crashing - (irb):6: [BUG] Segmentation fault at 0x0000000000000000 ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22]

Added by rubanthilak (Ruban Thilak) 10 months ago. Updated 8 months ago.


Description

Tried this with ruby 3.3.0, both irb and rails console are crashing

DOMAIN_REGEX = Regexp.new(
  /\A((?=.*?[a-z])(?!.*--)[a-z\d]+[a-z\d-]*[a-z\d]+).((?=.*?[a-z])(?!.*--)[a-z\d]+[a-z\d-]*[a-z\d]+).((?=.*?[a-z])(?!.*--)[a-zd]+[a-zd-]*[a-zd]+).((?=.*?[a-z])(?!.*--)[a-zd]+[a-zd-]*[a-zd]+)\Z/x
)
full_domain = "www.google.com"
100.times.each { full_domain.match(DOMAIN_REGEX) }
-- Ruby level backtrace information ----------------------------------------
/Users/rthilak/.rvm/gems/ruby-3.3.0@ams/bin/ruby_executable_hooks:22:in `<main>'
/Users/rthilak/.rvm/gems/ruby-3.3.0@ams/bin/ruby_executable_hooks:22:in `eval'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/bin/bundle:25:in `<main>'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/bin/bundle:25:in `load'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/cli.rb:28:in `start'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/cli.rb:34:in `dispatch'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/cli.rb:451:in `exec'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/cli/exec.rb:23:in `run'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/cli/exec.rb:58:in `kernel_load'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundler/cli/exec.rb:58:in `load'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/bin/irb:25:in `<top (required)>'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/bin/irb:25:in `load'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/irb-1.11.0/exe/irb:9:in `<top (required)>'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/irb.rb:903:in `start'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/irb.rb:1001:in `run'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/irb.rb:1001:in `catch'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/irb.rb:1002:in `block in run'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/irb.rb:1015:in `eval_input'
/Users/rthilak/.rvm/rubies/ruby-3.3.0/lib/ruby/3.3.0/irb.rb:1093:in `each_top_level_statement'
<internal:kernel>:187:in `loop'

Files

trace.txt (61.7 KB) trace.txt rubanthilak (Ruban Thilak), 01/25/2024 05:46 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #20207: Segmentation fault for a regexp containing positive and negative lookaheadsClosedmake_now_just (Hiroya Fujinami)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0