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 4C3A617CCDC8 for ; Thu, 13 Dec 2012 14:29:33 +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 DB437EA6BA5 for ; Thu, 13 Dec 2012 14:24:24 +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 AC5C997A82B for ; Thu, 13 Dec 2012 14:24:24 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp 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 7Jyt612f_41u for ; Thu, 13 Dec 2012 14:24:24 +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 8B81497A827 for ; Thu, 13 Dec 2012 14:24:24 +0900 (JST) Received: from carbon.ruby-lang.org (carbon.ruby-lang.org [221.186.184.68]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id B9E99952447 for ; Thu, 13 Dec 2012 14:24:22 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1]) by carbon.ruby-lang.org (Postfix) with ESMTP id 0522B3C0CBB27; Thu, 13 Dec 2012 14:24:22 +0900 (JST) Received: from fluorine.ruby-lang.org (www.rubyist.net [210.251.121.216]) by carbon.ruby-lang.org (Postfix) with ESMTP id AB58A3C224B8A for ; Thu, 13 Dec 2012 14:24:21 +0900 (JST) Received: from ruby-lang.org (localhost [127.0.0.1]) by fluorine.ruby-lang.org (Postfix) with ESMTP id 938693E003 for ; Thu, 13 Dec 2012 14:24:21 +0900 (JST) Delivered-To: ruby-core@ruby-lang.org Date: Thu, 13 Dec 2012 14:24:21 +0900 Posted: Thu, 13 Dec 2012 14:24:21 +0900 From: "shugo (Shugo Maeda)" Reply-To: ruby-core@ruby-lang.org Subject: [ruby-core:50857] [ruby-trunk - Bug #3351] stack overflow on super To: ruby-core@ruby-lang.org Message-Id: References: X-ML-Name: ruby-core X-Mail-Count: 50857 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-core-ctl@ruby-lang.org; help= X-Mailer: Redmine X-Redmine-Issue-Author: serge_balyuk X-Redmine-Issue-Assignee: matz X-Auto-Response-Suppress: OOF X-Redmine-Issue-Id: 3351 X-Redmine-Mailinglistintegration-Message-Ids: 23622 X-Redmine-Project: ruby-trunk Auto-Submitted: auto-generated X-Redmine-Site: Ruby Issue Tracking System X-Redmine-Host: bugs.ruby-lang.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Precedence: bulk List-Id: ruby-core.ruby-lang.org List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: Issue #3351 has been updated by shugo (Shugo Maeda). Assignee changed from shugo (Shugo Maeda) to matz (Yukihiro Matsumoto) mame (Yusuke Endoh) wrote: > Shugo-san, ko1, what's the status? Override#foo is called only once, because in the SVN trunk, if a method found by super is the current method, it's skipped to avoid an infinite loop. The check was introduced for super in a refinement. Without it, super in a refinement causes an infinite loop. > Do you think this issue important? I don't think so. Can I leave it as is, Matz? ---------------------------------------- Bug #3351: stack overflow on super https://bugs.ruby-lang.org/issues/3351#change-34690 Author: serge_balyuk (Serge Balyuk) Status: Assigned Priority: Low Assignee: matz (Yukihiro Matsumoto) Category: core Target version: 2.0.0 ruby -v: ruby 1.9.3dev (2010-05-26 trunk 28028) [i686-linux] =begin It looks like `super` behavior is a bit different in 1.8 and 1.9. Please find the example below: class Base def foo puts "bar" end end module Override def foo puts "override" super end end class A < Base end class B < A end B.send(:include, Override) A.send(:include, Override) B.new.foo ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux] output: override override bar and ruby 1.9.3dev (2010-05-26 trunk 28028) [i686-linux] output: .... override override override override override super.rb:9: stack level too deep (SystemStackError) Hope that helps. =end -- http://bugs.ruby-lang.org/