From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Fejfighter Newsgroups: gmane.emacs.devel Subject: Re: New GC concept Date: Sat, 24 Jul 2021 23:39:07 +1000 Message-ID: References: <1658db95-d513-7f21-8751-0e2ea38946cb@daniel-mendler.de> <06073468-e016-52af-9a84-99ef4cf00d78@dancol.org> <83r1hhvr7a.fsf@gnu.org> <5cfabdaa-5cff-cf94-5b4b-3a567ddb3a05@dancol.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000099a56e05c7dea511" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8132"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mail@daniel-mendler.de, Eli Zaretskii , emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 24 15:43:28 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m7Hw8-0001u5-AR for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Jul 2021 15:43:28 +0200 Original-Received: from localhost ([::1]:56582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7Hw7-0001TR-AZ for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Jul 2021 09:43:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7HsA-0002vA-K0 for emacs-devel@gnu.org; Sat, 24 Jul 2021 09:39:22 -0400 Original-Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]:34778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m7Hs8-0004Vu-P7; Sat, 24 Jul 2021 09:39:22 -0400 Original-Received: by mail-qk1-x730.google.com with SMTP id 184so4267811qkh.1; Sat, 24 Jul 2021 06:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=niLD+OyyRfEaVmh+eXM2G4w6u87s3GsvWk/yrPZt340=; b=SDWm402oEVBRppwJtE15Ws1pWO+lhZXu9l2ctM2uWeYgttEW7uv92SPcrKVatMopIC E9OdAgjZP8Ffy6+1/apv53W7YH9zBN/WPRANILDpdglzEffnwg4YX24B5UjpTe/A7GQM YpgVButafpcSJc1jbqv6wNgQGUPNwkaGGnNtqSS3wuq/PiehDlvK2tSOk/SLCn/2oFQ+ nZa1F9ITh9+nDyaC+54xH+Eazg+4vl5xQ9jxR8bpktoZljSp1AahevOTIfyf3TEI6b2f ZSleFelcvuOG3VWRLlAewWhhKXZGTgcgyB3g+N8ADQ+FitCRRwFfMvps5hU2Ow3FxgFn eCLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=niLD+OyyRfEaVmh+eXM2G4w6u87s3GsvWk/yrPZt340=; b=Dx4cQtC3nEVaJ3bUz+SNWqHdQLuJF2/gGUrzsdw4zgwh/ARJzT9pcM7DDfu2xTmXbq u1i9on5v+8YqS0F/uaM5bG0B6fCLxKCx3KkT8eT1UqvcgFE9XciWHl1iB0zjERQHS+oP 15HsVC5Rys+iQGwEqVyWkj2LvfG6mG3mQEek7Nzs9PRIr8blN26xTiY47CbG9kbbLm55 kWjGWn/AIceeNlZd9/V0pv89crULxgCvFhD4iBqxv3BZ2l9XFI8KMQrmhBvWuHl+hLiK NUT8H+KGTcbxaOGKDIW5SaVgaHEEUGQYv112DkcMBMoavn6/Z3BgV/y0fWUIg5f8bhBc VbtQ== X-Gm-Message-State: AOAM530PWStWsWxDt6fXviW/jLfpmgOyJPEOE6M6LoUIM5tHfZtyEK5j uSKN+/tfSQ0pv5Frf5vrYNGDNADryIqTOgsMpyAvt6HJVuQ= X-Google-Smtp-Source: ABdhPJyLV8s/HaqyS7Tf39Qsb81gR5x8xp4W6KtLg+8DFZDElo/Rd2mVIzHjbXOyT/PjEGM9eesWfU685VrMzsEytT8= X-Received: by 2002:a05:620a:c86:: with SMTP id q6mr9530577qki.278.1627133958529; Sat, 24 Jul 2021 06:39:18 -0700 (PDT) In-Reply-To: <5cfabdaa-5cff-cf94-5b4b-3a567ddb3a05@dancol.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::730; envelope-from=fejfighter@gmail.com; helo=mail-qk1-x730.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271540 Archived-At: --00000000000099a56e05c7dea511 Content-Type: text/plain; charset="UTF-8" On Tue, Jun 22, 2021 at 8:43 AM Daniel Colascione wrote: > On 6/21/21 6:00 AM, Fejfighter wrote: > > > > code is up here: > > https://github.com/fejfighter/emacs/tree/feature/newgc > > > > I'm hoping now that it's a little closer to master and compiling > > someone might have a little more luck with the segfault issue I have > > been facing but I will keep try in the mean time, > > FWIW, I find rr [1] to be exceptionally useful for diagnosing segfaults > like this. > > > [1] https://rr-project.org/ > While I had no luck with rr, I did trace that particular issue to not unprotecting memory, which got me through a little further to a point of a compacting sweep. This is where I have been spinning my wheels for the last few weeks in the short bursts of time I get to look at this codebase. The problem is highlighted by xxx_check_obarray, but will show up in future reads, where the ob array is not swept and does not get the updated references. I feel like it might be a special case where a global vector has references, because when marking we traverse the array as required, but this does not occur when sweeping, however, it does not affect other vector-like things. I think I will need to update the obarray, but simply calling `scan_vectorlike(XPNTR(Vobarray), GC_PHASE_SWEEP);` has bad values at that point. I'm hoping that this will either jog your memory and provide some background or get someone curious that might have a different understanding of how it all interacts and we can get over this particular hump, Thanks, Jeff W --00000000000099a56e05c7dea511 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tu= e, Jun 22, 2021 at 8:43 AM Daniel Colascione <dancol@dancol.org> wrote:
On 6/21/21 6:00 AM, Fejfighter wrote:


> code is up here:
> https://github.com/fejfighter/emacs/tree/= feature/newgc
> <https://github.com/fejfighter/emacs/t= ree/feature/newgc>
> I'm hoping now that it's a little closer to master and compili= ng
> someone might have a little more luck with the segfault issue I have <= br> > been facing but I will keep try in the mean time,

FWIW, I find rr [1] to be exceptionally useful for diagnosing segfaults like this.


[1] https://rr-project.org/

While I h= ad no luck with rr, I did trace that particular issue to not unprotecting m= emory, which got me through a little further to a point of a compacting swe= ep.
This is where I have been spinning my wheels for the last few= weeks in the short bursts of time I get to look at this codebase.

The problem is highlighted by xxx_check_obarray, but will = show up in future reads, where the ob array is not swept and does not get t= he updated references.
I feel like it might be a special case whe= re a global vector has references, because when marking we traverse the arr= ay as required, but this does not occur when sweeping, however, it does not= affect other vector-like things.

I think I will n= eed to update the obarray, but simply calling `scan_vectorlike(XPNTR(Vobarr= ay), GC_PHASE_SWEEP);`=C2=A0 has bad values at that point.

I'm hoping that this will either jog your memory and provide s= ome background or get someone curious that might have a different understan= ding of how it all interacts and we can get over this particular hump,

Thanks,
Jeff W
--00000000000099a56e05c7dea511--