ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: ko1@atdot.net
To: ruby-core@ruby-lang.org
Subject: [ruby-core:96815] [Ruby master Bug#16503] "ret: 2, hash modified during iteration" error in Ruby 2.7.0
Date: Sun, 12 Jan 2020 18:44:28 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-83810.20200112184428.fe384c6691c3d366@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-16503.20200111224456@ruby-lang.org

Issue #16503 has been updated by ko1 (Koichi Sasada).

Status changed from Open to Closed

350dafd56a9cff58d36303aeb7515ab41c5dbbb3

----------------------------------------
Bug #16503: "ret: 2, hash modified during iteration" error in Ruby 2.7.0
https://bugs.ruby-lang.org/issues/16503#change-83810

* Author: jnchito (Junichi Ito)
* Status: Closed
* 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/

  parent reply	other threads:[~2020-01-12 18:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-16503.20200111224456@ruby-lang.org>
2020-01-11 22:44 ` [ruby-core:96794] [Ruby master Bug#16503] "ret: 2, hash modified during iteration" error in Ruby 2.7.0 me
2020-01-12 18:19 ` [ruby-core:96810] " ko1
2020-01-12 18:36 ` [ruby-core:96811] " ko1
2020-01-12 18:40 ` [ruby-core:96813] " ko1
2020-01-12 18:44 ` ko1 [this message]
2020-01-12 23:34 ` [ruby-core:96819] " me

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-83810.20200112184428.fe384c6691c3d366@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).