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_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 0C5BD1F45F for ; Fri, 10 May 2019 00:42:04 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id F21FE120B0D; Fri, 10 May 2019 09:41:57 +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 A1F21120ACF for ; Fri, 10 May 2019 09:41:50 +0900 (JST) Received: by filter0036p3las1.sendgrid.net with SMTP id filter0036p3las1-1462-5CD4C8CE-22 2019-05-10 00:41:50.911774916 +0000 UTC m=+23891.298463824 Received: from herokuapp.com (unknown [54.227.1.136]) by ismtpd0028p1iad2.sendgrid.net (SG) with ESMTP id byXkM_xnQt-2BQcLfwXNng for ; Fri, 10 May 2019 00:41:50.702 +0000 (UTC) Date: Fri, 10 May 2019 00:41:51 +0000 (UTC) From: s.wanabe@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68101 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15809 X-Redmine-Issue-Author: MSP-Greg X-Redmine-Issue-Assignee: tenderlovemaking X-Redmine-Sender: wanabe 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?FsuGSN1PD4adq4aDFRSSBF8ffe=2F4plpeX9T+dOtlSNZv7kXtdC97udnw7TL+oG?= =?us-ascii?Q?cYb6diZdnc9jWsVYLCITA4G5TnPjI+HXQLUH1Y1?= =?us-ascii?Q?KNXxnEA0GJKg0Hcnq8qerjDkbj+KA3Jk5dZv5GM?= =?us-ascii?Q?ye13pTgWACZlDSLw=2F4Ef0pFy7vNpRtEkocmgWOs?= =?us-ascii?Q?63RGJ6tQtx3SQPVxj290ed32rF371qrMLPA=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92618 Subject: [ruby-core:92618] [Ruby trunk Bug#15809] GC.verify_compaction_references - intermittent SEGV's on multiple platforms 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 #15809 has been updated by wanabe (_ wanabe). wanabe (_ wanabe) wrote: > How about delaying `gc_finalize_deferred()` phase after `gc_update_references()`? Like this: ``` diff --git a/gc.c b/gc.c index ea4f54ce0e..68d58fcb5e 100644 --- a/gc.c +++ b/gc.c @@ -8100,14 +8100,17 @@ static VALUE rb_gc_compact(VALUE mod) { rb_objspace_t *objspace = &rb_objspace; + int reason = GPR_FLAG_FULL_MARK | GPR_FLAG_IMMEDIATE_MARK | + GPR_FLAG_IMMEDIATE_SWEEP | GPR_FLAG_CAPI; /* Ensure objects are pinned */ - rb_gc(); + garbage_collect(objspace, reason); gc_compact_heap(objspace); heap_eden->freelist = NULL; gc_update_references(objspace); + gc_finalize_deferred(objspace); rb_clear_method_cache_by_class(rb_cObject); rb_clear_constant_cache(); @@ -8191,14 +8194,17 @@ static VALUE gc_verify_compaction_references(VALUE mod) { rb_objspace_t *objspace = &rb_objspace; + int reason = GPR_FLAG_FULL_MARK | GPR_FLAG_IMMEDIATE_MARK | + GPR_FLAG_IMMEDIATE_SWEEP | GPR_FLAG_CAPI; /* Ensure objects are pinned */ - rb_gc(); + garbage_collect(objspace, reason); gc_compact_heap(objspace); heap_eden->freelist = NULL; gc_update_references(objspace); + gc_finalize_deferred(objspace); gc_check_references_for_moved(mod); rb_clear_method_cache_by_class(rb_cObject); ``` But I think it needs a refactoring because of duplicated code. ---------------------------------------- Bug #15809: GC.verify_compaction_references - intermittent SEGV's on multiple platforms https://bugs.ruby-lang.org/issues/15809#change-77977 * Author: MSP-Greg (Greg L) * Status: Assigned * Priority: Normal * Assignee: tenderlovemaking (Aaron Patterson) * Target version: * ruby -v: ruby 2.7.0dev (2019-05-06 trunk c3cf1ef9bb) [x64-mingw32 * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- See https://travis-ci.org/ruby/ruby/jobs/525627187#L2684 https://ci.appveyor.com/project/ruby/ruby/builds/24138134/job/i7e441u7se11w7ey#L3402 Both have an error similar to: ``` /ruby/test/ruby/test_gc_compact.rb:128: [BUG] ROOT finalizers points to MOVED: 0x0000000004679c20 -> 0x00000000089367c0 [0 ] T_ARRAY [E ] len: 1 (embed) ``` ruby-loco has also failed with a similar error. Attached STDERR output. ---Files-------------------------------- test_all_err.log (42 KB) -- https://bugs.ruby-lang.org/