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 BADDC17DC7C7 for ; Thu, 20 Nov 2014 06:24:20 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 4798BB5D8E1 for ; Thu, 20 Nov 2014 06:13:55 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id D39DC97A841 for ; Thu, 20 Nov 2014 06:13:55 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GZD23yIdPZpB for ; Thu, 20 Nov 2014 06:13:54 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id A923D97A834 for ; Thu, 20 Nov 2014 06:13:54 +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 54425952420 for ; Thu, 20 Nov 2014 06:13:53 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 142571204F5; Thu, 20 Nov 2014 06:13:48 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id AD0121204A3 for ; Thu, 20 Nov 2014 06:13:44 +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=9ISMParUxbafDfNRUVpDiJM9oGA=; b=oWVybogzP4xuonUNmr LXWInAULHEL073+LbAu0H0IxhP1lbXPiQhgKtoKAtxby7qyoaJaJ7+iQJnMX1LXz CP5ymZ1uxTiYgo/oDmrXdF9yDB1vqjbZdFjLl/vBqknUaGyuVcF/imIpjtc+w7KS 67lbzVdRe2hVPOxmLVulI8cC0= Received: by filter0168p1mdw1.sendgrid.net with SMTP id filter0168p1mdw1.31895.546D080118 2014-11-19 21:13:37.779971969 +0000 UTC Received: from herokuapp.com (ec2-184-73-5-250.compute-1.amazonaws.com [184.73.5.250]) by ismtpd-003 (SG) with ESMTP id 149c9e746a1.29a0.cbf34 Wed, 19 Nov 2014 21:13:37 +0000 (UTC) Date: Wed, 19 Nov 2014 21:13:37 +0000 From: arne@arnebrasseur.net 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: 40753 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 10460 X-Redmine-Issue-Author: plexus X-Redmine-Issue-Assignee: ko1 X-Redmine-Sender: plexus X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: OOF Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6v4LDUZ3+s6TSuMhhoqAANvmwJtiaIBkHkRO BnXCWz2ARArjTT3Sfy6VcNft8XgldfJ/KfeAIfzw9Mysq/v46I1wt/u1WB7yzZcwhO+30TIZQT6d6p HVMPta1QWDVtUAMl5ofPC9mOaxnvsDnnZuxX X-SendGrid-Contentd-ID: {"test_id":"1416431620"} X-ML-Name: ruby-core X-Mail-Count: 66365 Subject: [ruby-core:66365] [ruby-trunk - Bug #10460] Segfault instead of stack level too deep 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 #10460 has been updated by Arne Brasseur. That makes sense, I agree with your point. Having a nicer error message on broken code isn't a big deal. There is an actual use case beyond "a nicer error message" though. Me and others make heavy use of mutation testing with Mutant (https://github.com/mbj/mutant/). Mutant changes the ruby code in many different ways, and then checks if your tests fail. The result is you can have much more confidence in your code and your tests. Once you get used to mutation testing it's hard to go without. Mutant will often generate "broken" code, that's how it works, so endless recursion could be the result. It needs to be able to detect somehow that things go wrong. A segfault is actually not the biggest problem. Mutant forks off workers, so if the worker dies it can assume something went wrong. Sometimes the code in this ticket also causes Ruby to get stuck in a futex. In that case the worker is "stuck" and Mutant becomes unusable. Maybe not everybody agrees on the usefulness of mutation testing, or if that is a valid use case for MRI. I just wanted to clarify why I filed this ticket. Actually the locking up is more a problem than the segfault. > We may increase the size of the guard area; but that costs memory. > Right now, on (most) Linux systems, this guard costs 4K (one page) > per-thread. Could you tell me where in the code I can see this? I would love to investigate this more. Thanks! ---------------------------------------- Bug #10460: Segfault instead of stack level too deep https://bugs.ruby-lang.org/issues/10460#change-50017 * Author: Arne Brasseur * Status: Open * Priority: High * Assignee: Koichi Sasada * Category: YARV * Target version: current: 2.2.0 * ruby -v: ruby 2.2.0dev (2014-10-29 trunk 48188) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- The code to trigger this can be found here: https://gist.github.com/mbj/31163a8e712573877268 Also have a look at the comments there. A lot of different people tried it, in some cases it segfaults, in others it doesn't. It seems to have to do with version of gcc or specific CFLAGS. I can reproduce the problem for 2.1.3, 2.1.4, and trunk. -- https://bugs.ruby-lang.org/