From: "jbeschi (jacopo beschi) via ruby-core" Date: 2024-02-20T09:35:57+00:00 Subject: [ruby-core:116871] [Ruby master Bug#20284] Regexp::TimeoutError is not triggered by a specific Regexp Issue #20284 has been reported by jbeschi (jacopo beschi). ---------------------------------------- Bug #20284: Regexp::TimeoutError is not triggered by a specific Regexp https://bugs.ruby-lang.org/issues/20284 * Author: jbeschi (jacopo beschi) * Status: Open * Priority: Normal * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I've noticed that the Regexp::TimeoutError is not triggered for this Regexp: ```ruby jacopo-37s-mb 3.3.0 ~ cat fail.rb require 'benchmark' p RUBY_DESCRIPTION Regexp.timeout = 0.1 puts "Regexp.timeout: #{Regexp.timeout}" re = /((a|aa)+)+b/ 10.times do p Benchmark.realtime { re.match?("a" * 900000000) } end ``` ``` jacopo-37s-mb 3.3.0 ~ ruby fail.rb "ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin22]" Regexp.timeout: 0.1 1.1425850000232458 1.0082139987498522 1.064377998933196 1.0745620001107454 1.0647990014404058 1.6172770000994205 1.396629998460412 1.2450549993664026 1.3292079996317625 1.5961690004915 ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/