From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 3924319C01E9 for ; Wed, 18 Nov 2015 04:21:46 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id E331EB5D858 for ; Wed, 18 Nov 2015 04:52:19 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id D0E2918CC7EA for ; Wed, 18 Nov 2015 04:52:19 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id F40BF12045C; Wed, 18 Nov 2015 04:52:17 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 5E6B0120451 for ; Wed, 18 Nov 2015 04:52:14 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=8sM6+DQw6Ofcdi54BlYFT6ZOMII=; b=G++6H9zqRm8QahXzTv 0+Ui/UKgkoCxOTQK5GD+WT43Gjozvamhel0KUT7GnXq8pWasUnwkjZqsbEuyc2YX WBXd5GWvGgPwmKr1SyB3Bxg971XA64B6eBV9XZMCcZHK/z6YjHZmxM1B1r+f57X2 ZZ+zlcWCJ3hBLjlHe+6eIxC7Y= Received: by filter0515p1mdw1.sendgrid.net with SMTP id filter0515p1mdw1.29384.564B856928 2015-11-17 19:52:09.349506398 +0000 UTC Received: from herokuapp.com (ec2-54-224-7-132.compute-1.amazonaws.com [54.224.7.132]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id EO6rJ0IyR9-ES0CwqOP5EA for ; Tue, 17 Nov 2015 19:52:09.231 +0000 (UTC) Date: Tue, 17 Nov 2015 19:52:09 +0000 From: edgars.beigarts@makit.lv To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 46186 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11692 X-Redmine-Issue-Author: gazay X-Redmine-Sender: ebeigarts 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6i+pCr5BlsgPTTyPQZS/+PhVcIacMLX/cmqj jVZyGWlGCq5hR5Hr7s8Z3o0ZHFqRkA0R1afsRRJNlAc0qCNAgh2ovt2U2vBf8U0YxUVI2uUo8BQGqj sqmn704yJeo2A4+j5degnmFYjFsL0+VVK0Py X-ML-Name: ruby-core X-Mail-Count: 71525 Subject: [ruby-core:71525] [Ruby trunk - Bug #11692] [PATCH] Re-enable GC if stack overflow was caught from signal handler 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: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11692 has been updated by Edgars Beigarts. I'm having similia issue when running tests with capybara that starts additional server in a new thread. If I have some problems in my rails app that raises SystemStackError in the server thread then I am left without a GC and memory just keeps growing and growing, I have tried manually calling GC.start after that, but it doesn't help, GC.stat dislays the same number for major/minor. I was trying to create a simple example, but I run into other issues too. Here is the example: https://gist.github.com/ebeigarts/933f1601332609ed33a8 ---------------------------------------- Bug #11692: [PATCH] Re-enable GC if stack overflow was caught from signal handler https://bugs.ruby-lang.org/issues/11692#change-54905 * Author: Alex Gaziev * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- We got ruby application running on our production server and noticed that it regularly crashes with out of memory errors. After months of investigation, I narrowed the case to the examples (1/2). After digging ruby sources and running test code, I found out that GC stopped working after recovering from native stack overflow error. Probably the relevant code appeared in 2.2 https://github.com/ruby/ruby/commit/0c391a55d3ed4637e17462d9b9b8aa21e64e2340 where ruby_disable_gc_stress became ruby_disable_gc. Patches for trunk and 2.2 branches below. ---Files-------------------------------- example1.rb (311 Bytes) example2.rb (333 Bytes) re-enable-gc-after-stackoverflow-trunk.patch (985 Bytes) re-enable-gc-after-stackoverflow-ruby-2-2.patch (985 Bytes) -- https://bugs.ruby-lang.org/