From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 5A81E1F453 for ; Mon, 29 Apr 2019 01:37:38 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 0FEBA120B18; Mon, 29 Apr 2019 10:37:33 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 56E0E1208A1 for ; Mon, 29 Apr 2019 10:37:30 +0900 (JST) Received: by filter0085p3las1.sendgrid.net with SMTP id filter0085p3las1-3293-5CC6555A-13 2019-04-29 01:37:30.611138298 +0000 UTC m=+277790.420359986 Received: from herokuapp.com (unknown [54.91.45.152]) by ismtpd0023p1mdw1.sendgrid.net (SG) with ESMTP id CJZDSDnzThmUDVdOw5C1xQ for ; Mon, 29 Apr 2019 01:37:30.438 +0000 (UTC) Date: Mon, 29 Apr 2019 01:37:30 +0000 (UTC) From: buzz.taiki@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 67955 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15779 X-Redmine-Issue-Author: buzztaiki X-Redmine-Sender: buzztaiki X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?dpOKcU6=2F2RbGuJESXLpbn4HQdUt2DSk5xWhjgb5xtijqy3LSRhricHtd7SnVcN?= =?us-ascii?Q?XTNDtxi=2FP6ryaGRciiUTkXtLX52gsIb=2F1qMs6hC?= =?us-ascii?Q?vfmTBq88We4VnX1jGDSJZzXkdlvUXryHD8b95xB?= =?us-ascii?Q?UGZjrw1EJ4Bz2W8qiljThD+zHM0h1v2CUp81nTr?= =?us-ascii?Q?fTjZ2hokwwgrlPfp7k25Ghw+cxSwEl4GGSA=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92472 Subject: [ruby-core:92472] [Ruby trunk Bug#15779] After NoMemoryError, ruby freezes and takes 100% CPU X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15779 has been updated by buzztaiki (Taiki Sugawara). I test this reproduction code at ruby 2.5.5 (ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]). In this version, this issue is not reproduced (ruby is not frozen). ``` ~/opt/ruby/2.5.5/bin/ruby a.rb #, @meta={"server"=>"Cowboy", "strict-transport-security"=>"max-age=31536000", "content-type"=>"text/html", "etag"=>"W/\"91e880089832f50e7e7bf1371600cc60\"", "x-frame-options"=>"SAMEORIGIN", "via"=>"1.1 vegur, 1.1 varnish", "content-length"=>"424", "accept-ranges"=>"bytes", "date"=>"Mon, 29 Apr 2019 01:11:21 GMT", "age"=>"1800", "connection"=>"keep-alive", "x-served-by"=>"cache-hnd18749-HND", "x-cache"=>"HIT", "x-cache-hits"=>"1", "x-timer"=>"S1556500281.267699,VS0,VE6", "vary"=>"Accept-Encoding"}, @metas={"server"=>["Cowboy"], "strict-transport-security"=>["max-age=31536000"], "content-type"=>["text/html"], "etag"=>["W/\"91e880089832f50e7e7bf1371600cc60\""], "x-frame-options"=>["SAMEORIGIN"], "via"=>["1.1 vegur", "1.1 varnish"], "content-length"=>["424"], "accept-ranges"=>["bytes"], "date"=>["Mon, 29 Apr 2019 01:11:21 GMT"], "age"=>["1800"], "connection"=>["keep-alive"], "x-served-by"=>["cache-hnd18749-HN D"], "x-cache"=>["HIT"], "x-cache-hits"=>["1"], "x-timer"=>["S1556500281.267699,VS0,VE6"], "vary"=>["Accept-Encoding"]}, @status=["200", "OK"]> Traceback (most recent call last): a.rb: failed to allocate memory (NoMemoryError) ``` ---------------------------------------- Bug #15779: After NoMemoryError, ruby freezes and takes 100% CPU https://bugs.ruby-lang.org/issues/15779#change-77820 * Author: buzztaiki (Taiki Sugawara) * Status: Open * Priority: Normal * Assignee: * Target version: * 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/