From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: assertion failed: header_type (h) != IGC_OBJ_FWD Date: Sun, 14 Jul 2024 05:30:36 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21240"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel , Helmut Eller To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 14 08:29:27 2024 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 1sSsjf-0005IW-20 for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jul 2024 08:29:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSsjV-0003XD-2P; Sun, 14 Jul 2024 02:29:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSror-0005FY-Ra for emacs-devel@gnu.org; Sun, 14 Jul 2024 01:30:45 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSrop-0003u6-6c for emacs-devel@gnu.org; Sun, 14 Jul 2024 01:30:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1720935040; x=1721194240; bh=9K157goPunKXFIPiBgLcYuqwrRkTDAuYn/J1f3PyApY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=CdV9uZrdtB+FpUQHncqQomvCKfgIDDTx3fSI/lS3WOBu0nLN+HLxXelmxhrnU7Rzl KUlDJQ4IcnM8YukQVR6a/m/Cx2nrVDKHaVjrAOwTswYPwhwTyESp0F73pvmo1dK2By RPTEQR+2Cm8qn99KZ+h8PSeuS/ZQNMiehYKTwFu2PV/7JoKXSi236jIY0qdpN5ADjU ZN5isX1aiQfFN7+HPfkJxvKZFNKeMWQ79E4EpF7RtWTc4C4Dx0wrAG+Su374iyOWst F4uPbrCYTXK31OozUVOyVP3qqGnfCFC52KYzrOhI4kffCphwzp3sSqvZu+DV/03fN8 lROytk0z6T9wg== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 4040467e5ff74aa224c087ab4b8836509dad44f5 Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.protonmail.ch 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 14 Jul 2024 02:29:13 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321629 Archived-At: On Sunday, July 14th, 2024 at 04:12, Gerd M=C3=B6llmann wrote: > I'm seeing this assertion sometimes in an Emacs built with > --enable-checking=3Digc_debug,igc_check_fwd,w here sometines means it can > take days of using/running Emacs, or it can take a couple of hours. > This is macOS 14, arm64. I'm linking with -lmps-debug. That means lldb and no core dumps, right? (I've had to work with lldb to ma= ke the Android port work with mps, and it's decidedly Not My GDB). > The assertion means that we likely have a reference somewhere that > isn't traced. Because it isn't traced, the reference isn't changed to > point to the new location when the object being references is copied > to a new address in memory. Instead, it points to kind of a tombstone > that is left behind when the object is moved. My approach would be to try to capture it in a debugger, then follow the fo= rwarding pointer and find out what kind of object the pointer should be ref= erring to. I'm thinking, though, about how to increase pressure to flush out such bugs= . Here are some ideas: 1. scan xmalloc'd memory for pointers that refer to MPS-managed objects. 2. reduce generation sizes and increase the number of generations, making i= t more likely objects will be copied. 3. trigger GC regularly while allocating objects 4. Hack MPS to do something. 5. Keep a log of forwarded objects and their old/new pointers (1) seems the most complete approach but relies on unusual pointer represen= tations to reduce the number of false positives (and even then, they might = be pinned objects and then the pointer is okay...). (2) is easy to do, but impacts performance. (3) is easy to do, but impacts = performance a lot. I'd prefer avoiding (4), and while (5) is doable it's pr= obably unnecessary: you can just read the forwarding pointer if it's still = there. > Alas, I haven't been able to debug this. One problem is that I > can't reproduce it easily, the other is that is is either not > happening or happening much less often when building with -O0, and > without -O0 I can't see much here. I assume it's being accessed from Lisp or in an exception handler? Which op= timization options are you using? > This is just to let people know of the problem. If you find a recipe > how to reproduce this, please let me know. Or better yet, debug it :-). Well, it's possible, but quite unlikely, that it is the handlerlist_sentine= l thing or the Lisp_Mutex->name thing (both fixed). Much more likely it's a= nother issue. Pip