Project

General

Profile

Bug #15779

After NoMemoryError, ruby freezes and takes 100% CPU

Added by buzztaiki (Taiki Sugawara) about 1 year ago. Updated about 1 year ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
[ruby-core:92342]
Tags:

Description

Run following reproduce code, ruby freezes and takes 100% CPU.

require 'open-uri'

begin
  "a" * 10000000000
ensure
  p open('https://www.ruby-lang.org/')
end

But interestingly, the following code does not reproduce this issue.

require 'open-uri'

begin
  begin
    "a" * 10000000000
  rescue NoMemoryError
    raise
  end
ensure
  p open('https://www.ruby-lang.org/')
end

It was also reproduced when put sleep 100 in ensure clause, run it and hit Ctrl-C. But puts 'XXX' does not reproduce it.


Files

strace.txt (377 KB) strace.txt strace log buzztaiki (Taiki Sugawara), 04/29/2019 01:34 AM

Also available in: Atom PDF