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.8 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_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 B86EF1F4C0 for ; Mon, 14 Oct 2019 20:40:46 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 536121209B5; Tue, 15 Oct 2019 05:40:38 +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 62E9D1209AD for ; Tue, 15 Oct 2019 05:40:36 +0900 (JST) Received: by filter0091p3las1.sendgrid.net with SMTP id filter0091p3las1-29457-5DA4DD45-E 2019-10-14 20:40:37.176430915 +0000 UTC m=+266808.159721665 Received: from herokuapp.com (unknown [54.146.158.196]) by ismtpd0058p1iad1.sendgrid.net (SG) with ESMTP id -yde2VztS2Ke_7CKzCRvtA for ; Mon, 14 Oct 2019 20:40:36.971 +0000 (UTC) Date: Mon, 14 Oct 2019 20:40:37 +0000 (UTC) From: asterite+rubybugs@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70907 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16250 X-Redmine-Issue-Author: the-asterite X-Redmine-Sender: the-asterite 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?ulfPXR7EK5jIENh6q6l1VuggAaUoOzd=2FXSpv+pRAa04e5vgI3Mp8fz4PQCaetU?= =?us-ascii?Q?ceEx1I81uIqlwWnkXaaniCtaex=2Fr6MHoFJvYFqb?= =?us-ascii?Q?3=2FAH3yaD8kDjd326BN+iheQS35HtH9=2FNVNwMYDG?= =?us-ascii?Q?J5odekBdKPPv1kjaleE6iu9U3oirdXG1zud79XU?= =?us-ascii?Q?Tf8wp1OixlW83AG1ATxcUAvpc4GTvSz+A+Q=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95319 Subject: [ruby-core:95319] [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 the-asterite (Ary Borenszweig). 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? ---------------------------------------- Bug #16250: IRB can't print recursive Arrays or Hashes https://bugs.ruby-lang.org/issues/16250#change-82024 * Author: the-asterite (Ary Borenszweig) * Status: Open * 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/