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=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham 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 75A291F46C for ; Sun, 12 Jan 2020 18:40:56 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 6D3E4120B62; Mon, 13 Jan 2020 03:40:43 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 91C86120B5F for ; Mon, 13 Jan 2020 03:40:41 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-cmkgv with SMTP id filterdrecv-p3mdw1-56c97568b5-cmkgv-18-5E1B6830-4C 2020-01-12 18:40:48.940441214 +0000 UTC m=+2311062.535187822 Received: from herokuapp.com (unknown [3.88.104.96]) by ismtpd0017p1iad2.sendgrid.net (SG) with ESMTP id UVo41BhNThC_pI3QuOF_fQ for ; Sun, 12 Jan 2020 18:40:48.904 +0000 (UTC) Date: Sun, 12 Jan 2020 18:40:48 +0000 (UTC) From: ko1@atdot.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72476 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 16503 X-Redmine-Issue-Author: jnchito X-Redmine-Sender: ko1 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?fVTMYOBjtdvXNcWwrscBhLsHItUXVK5L4mtnq0mdcRfxVwxRb1HoNeSrAhmNZ1?= =?us-ascii?Q?JGMcm+Tr0LRLReZGHYPyvtccyMARBJ2SMP5uLtr?= =?us-ascii?Q?M8Oq7gLZ4cTsHoFca9L6rAo0ihqlbJ=2FxiwMuIsR?= =?us-ascii?Q?0EhPeqYv=2F+NGXn2aj0bioUQP9mRSUPEMGGMXQtY?= =?us-ascii?Q?cyowcmUg0VqdIDvvV2ZB8WtKagrLA70xx1Q=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96813 Subject: [ruby-core:96813] [Ruby master Bug#16503] "ret: 2, hash modified during iteration" error in Ruby 2.7.0 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 #16503 has been updated by ko1 (Koichi Sasada). > This patch should be back-ported for Ruby 2.6. sorry I mean 2.7. 2.6 doesn't have this problem. ---------------------------------------- Bug #16503: "ret: 2, hash modified during iteration" error in Ruby 2.7.0 https://bugs.ruby-lang.org/issues/16503#change-83808 * Author: jnchito (Junichi Ito) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux] (heroku-18 stack) * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- I am running a Rails app on Heroku. After upgrading to Ruby 2.7, I sometimes get `ret: 2, hash modified during iteration` error. The same issue is reported here (I'm using meta-tags gem too): https://github.com/kpumuk/meta-tags/issues/209 This gem deletes elements while iterating hash (HashWithIndifferentAccess actually), so I guess it might involve this error: https://github.com/kpumuk/meta-tags/blob/v2.13.0/lib/meta_tags/renderer.rb#L168 https://github.com/kpumuk/meta-tags/blob/v2.13.0/lib/meta_tags/renderer.rb#L181 https://github.com/kpumuk/meta-tags/blob/v2.13.0/lib/meta_tags/meta_tags_collection.rb#L85 However, this error does not occur every time (sometimes works, sometimes fails), and it didn't occur in Ruby 2.6. So I'm wondering why. Do you have any idea on this? -- https://bugs.ruby-lang.org/