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=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 456591F461 for ; Fri, 6 Sep 2019 15:13:24 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 00030120ADC; Sat, 7 Sep 2019 00:13:13 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 48521120ABC for ; Sat, 7 Sep 2019 00:13:11 +0900 (JST) Received: by filter0029p3iad2.sendgrid.net with SMTP id filter0029p3iad2-12760-5D727787-5B 2019-09-06 15:13:11.961312034 +0000 UTC m=+254559.679392826 Received: from herokuapp.com (unknown [100.24.30.249]) by ismtpd0039p1iad2.sendgrid.net (SG) with ESMTP id zt5z7zMHSFGAo2rQ9momZw for ; Fri, 06 Sep 2019 15:13:11.905 +0000 (UTC) Date: Fri, 06 Sep 2019 15:13:11 +0000 (UTC) From: kevin@vcsjones.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70357 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16136 X-Redmine-Issue-Author: deivid X-Redmine-Sender: vcsjones 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?wvHzwynZJiwWwDN9JCeLUtbgfa=2FDmPDNgmweYP576een3vyroAweb0yQAGvhZg?= =?us-ascii?Q?=2FOoqfNIlmZtrAYD3RfV8D8cOTf2Ud+sfWhE3h0o?= =?us-ascii?Q?7ZmnpFtkc78KrOjsqW51vgQq+rlnkKt=2FKLiH2RB?= =?us-ascii?Q?7GbE4+DgRgPI1WpFl7Pn7GBy1=2Fgo9tygzd8L1U+?= =?us-ascii?Q?Asp3fZ9=2FQnQJDV0y3ppHa1B+NOsrDC2PZ6A=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 94802 Subject: [ruby-core:94802] [Ruby master Bug#16136] String corruption in 2.6.4 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #16136 has been updated by vcsjones (Kevin Jones). I applied the patch to ruby 2.6.4 and I cannot reproduce the issue any more= . This patch appears to resolve the issue for 2.6.4. Thank you very much fo= r taking the time to investigate the issue. ```diff diff --git a/symbol.c b/symbol.c index f3506a02dd..a408ee052e 100644 --- a/symbol.c +++ b/symbol.c @@ -743,7 +743,8 @@ rb_str_intern(VALUE str) enc =3D ascii; } else { - str =3D rb_str_new_frozen(str); + str =3D rb_str_dup(str); + OBJ_FREEZE(str); } str =3D rb_fstring(str); type =3D rb_str_symname_type(str, IDSET_ATTRSET_FOR_INTERN); ``` ---------------------------------------- Bug #16136: String corruption in 2.6.4 https://bugs.ruby-lang.org/issues/16136#change-81424 * Author: deivid (David Rodr=EDguez) * Status: Closed * Priority: Normal * Assignee: = * Target version: = * ruby -v: ruby 2.6.4p104 (2019-08-28 revision 67798) [x86_64-linux] * Backport: 2.5: DONTNEED, 2.6: REQUIRED ---------------------------------------- When trying to upgrade activeadmin's tests to use ruby 2.6.4, I got some ve= ry weird failures where some strings would end up containing random content= . See https://circleci.com/gh/activeadmin/activeadmin/20329 for an example = of those failures. Failures are somewhat random but the test suite seems to= consistently fail on 2.6.4 and pass on 2.6.3. I also managed to reproduce = the failures locally, sometimes very consistently, but now it's hardly ever= happening... :/ I looked at the changes in 2.6.4 and it looks like https://bugs.ruby-lang.o= rg/issues/16105 and/or https://bugs.ruby-lang.org/issues/15946 could be rel= ated, because the region of the Rails code where the corrupted string is cr= eated seems to be doing something similar to the reported issues: https://g= ithub.com/rails/rails/blob/b7e591a55f4de5f1511c3b9255b3b25159b8ba41/actionp= ack/lib/action_dispatch/routing/mapper.rb#L404-L412. Sorry I'm not really sure how to create a reproducible example, or how to d= ebug this issue. Just opening this in case it could help noticing something= obviously wrong with the mentioned patches. -- = https://bugs.ruby-lang.org/ Unsubscribe: