Actions
Bug #20228
closedMemory leak in Regexp timeout
Bug #20228:
Memory leak in Regexp timeout
Description
GitHub PR: https://github.com/ruby/ruby/pull/9765
If a Regexp::TimeoutError is raised, the stk_base and OnigRegion will leak.
For example:
Regexp.timeout = 0.001
regex = /^(a*)*$/
str = "a" * 1000000 + "x"
10.times do
100.times do
begin
regex =~ str
rescue
end
end
puts `ps -o rss= -p #{$$}`
end
Before:
After:
Actions