[#104307] Float truncate — Eustáquio Rangel <eustaquiorangel@...>
Hi!
4 messages
2021/06/16
[ruby-core:104321] [Ruby master Bug#15779] After NoMemoryError, ruby freezes and takes 100% CPU
From:
merch-redmine@...
Date:
2021-06-16 20:12:15 UTC
List:
ruby-core #104321
Issue #15779 has been updated by jeremyevans0 (Jeremy Evans).
This is still an issue in the master branch. I've submitted a pull request for it: https://github.com/ruby/ruby/pull/4577. The pull request uses @wanabe's fix and a test based on @buzztaiki's example.
----------------------------------------
Bug #15779: After NoMemoryError, ruby freezes and takes 100% CPU
https://bugs.ruby-lang.org/issues/15779#change-92544
* Author: buzztaiki (Taiki Sugawara)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
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)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>