[ruby-core:114049] [Ruby master Bug#19750] Ruby hangs when parsing Regexp with unterminated unicode "/\u{"
From:
"tompng (tomoya ishida) via ruby-core" <ruby-core@...>
Date:
2023-06-29 12:24:20 UTC
List:
ruby-core #114049
Issue #19750 has been reported by tompng (tomoya ishida).
----------------------------------------
Bug #19750: Ruby hangs when parsing Regexp with unterminated unicode "/\u{"
https://bugs.ruby-lang.org/issues/19750
* Author: tompng (tomoya ishida)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
Ruby hangs up for a while and gets `failed to allocate memory (NoMemoryError)`
~~~shell
$ ruby -e "/\\u{"
ruby: failed to allocate memory (NoMemoryError)
~~~
~~~ruby
RubyVM::AbstractSyntaxTree.parse "/\\u{"
# => SyntaxError
RubyVM::AbstractSyntaxTree.parse "/\\u{\n"
# => failed to allocate memory (NoMemoryError)
~~~
Found in https://github.com/ruby/irb/issues/620
--
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/