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.7 required=3.0 tests=AWL,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_HELO_NONE,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 BB1DA1F4C0 for ; Tue, 15 Oct 2019 04:28:18 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id B80C51209D4; Tue, 15 Oct 2019 13:28:09 +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 525EB1209D2 for ; Tue, 15 Oct 2019 13:28:07 +0900 (JST) Received: by filter0089p3las1.sendgrid.net with SMTP id filter0089p3las1-13108-5DA54AD9-61 2019-10-15 04:28:10.040475819 +0000 UTC m=+294861.060634252 Received: from herokuapp.com (unknown [52.91.31.13]) by ismtpd0074p1iad2.sendgrid.net (SG) with ESMTP id xgWSLjd1QV22--ZtUFDlXQ for ; Tue, 15 Oct 2019 04:28:09.784 +0000 (UTC) Date: Tue, 15 Oct 2019 04:28:10 +0000 (UTC) From: takashikkbn@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70912 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16250 X-Redmine-Issue-Author: the-asterite X-Redmine-Sender: k0kubun 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?9bN4wU0cxWeLAEOz6NELGbwCNAokUg6cnjH8nvx=2FqgYjSoSAx+qKHINO=2FnQhPb?= =?us-ascii?Q?6jveNPzoiC8+Roaus9HJHN20ldPEblO9IXz8V0E?= =?us-ascii?Q?mf2G1XlorPVXeKYydWGn5vELYgCNvVUidrcO7xC?= =?us-ascii?Q?maQjW5cx0njUoHcZuuovX74yPdSRUjO=2FCeZuAcE?= =?us-ascii?Q?=2FMSamtAUOm28onbRLwcSsgZg8L1lKXnst3w=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95324 Subject: [ruby-core:95324] [Ruby master Bug#16250] IRB can't print recursive Arrays or Hashes 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 #16250 has been updated by k0kubun (Takashi Kokubun). Great catch, thanks! > By the way, I had to create a new account to report this bug. I already tried to reset my password for account asterite@gmail.com but after I reset it if I try to login it always says the password is incorrect. Could you try verifying "reset password" works fine? I'm not familiar with it so much. Please file another ticket somewhere, maybe https://github.com/ruby/bugs.ruby-lang.org/issues? ---------------------------------------- Bug #16250: IRB can't print recursive Arrays or Hashes https://bugs.ruby-lang.org/issues/16250#change-82032 * Author: the-asterite (Ary Borenszweig) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.7.0dev (2019-06-04 trunk 4b7213a85a) [x86_64-darwin18] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- This is on Ruby 2.7.0dev but I'm almost sure it happens on master because this code has no check for recursion: https://github.com/ruby/ruby/blob/c3a626030235c0349e14c6bc07177810daee841c/lib/irb/color.rb#L73-L88 Code to reproduce: ~~~ $ irb irb(main):001:0> a = [] => [] irb(main):002:0> a << a Traceback (most recent call last): 16: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `all?' 15: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `block in inspect_colorable?' 14: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `inspect_colorable?' 13: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `all?' 12: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `block in inspect_colorable?' 11: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `inspect_colorable?' 10: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `all?' 9: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `block in inspect_colorable?' 8: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `inspect_colorable?' 7: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `all?' 6: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `block in inspect_colorable?' 5: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `inspect_colorable?' 4: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `all?' 3: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `block in inspect_colorable?' 2: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `inspect_colorable?' 1: from /Users/asterite/.rbenv/versions/2.7.0-dev/lib/ruby/2.7.0/irb/color.rb:80:in `all?' SystemStackError (stack level too deep) Maybe IRB bug! ~~~ Suggested fix: keep a list of visited arrays and hashes. I will try to submit a patch. -- https://bugs.ruby-lang.org/