From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: assertion failed: header_type (h) != IGC_OBJ_FWD Date: Tue, 16 Jul 2024 15:02:24 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35046"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Emacs Devel , Helmut Eller To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 16 15:03:20 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 1sThpw-0008sV-ND for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Jul 2024 15:03:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sThpA-0006XW-0G; Tue, 16 Jul 2024 09:02:32 -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 1sThp8-0006WS-IP for emacs-devel@gnu.org; Tue, 16 Jul 2024 09:02:30 -0400 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sThp6-00077Y-QD for emacs-devel@gnu.org; Tue, 16 Jul 2024 09:02:30 -0400 Original-Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42793fc0a6dso37150985e9.0 for ; Tue, 16 Jul 2024 06:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721134947; x=1721739747; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZOWqwToD2uHRK2+D2hlbp8fVx7/VDBFST/jR0o4OcN8=; b=GUoe18K+C+ZOlxRMDLHBmh0VTI/2k/pOCW8AcwLGGTFft1f67gwXTKsfdWJTLNHIZk vtUVFRD6R65oATFwLKXJl9Dc0xKeaVJXzjj0xY2AUUxEtEkrVfVZSmV3GGYK5WazqW+s vkoGhr87/5JUhdI0w+czauUsxUzsu+D+Xr5U4SnjsNfYdDIOCEBHb4Od2Zo7ACZisquc SWL4TnpXKYkmIX1HG1H+YzimNZuoin3hQHDqtfDI+JjE/q48meAebwcCmXZvEygnOyEx SWqWiL7f08vfb5PEQWSCllsp2km4zkhGFdID33mJEsScBP27TTMSWoHp5pxtKcquBgHN MbBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721134947; x=1721739747; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZOWqwToD2uHRK2+D2hlbp8fVx7/VDBFST/jR0o4OcN8=; b=RYwSISfAMEe+ZaItASExIs2pTC/y8G5xLoaajF6sYAIVmmOhbkekOMWO7R1OWuwDQA wEHrL5XTqOFSJuuO8DPKEUcUfoD1zfyBzO4RrqmAbkzdO/hfQGja2Pvlh3gSygSDqnQA lobzwB0JxbvtILV9zuwonwjc2J4ssutMgUq0D1mvYLcPUUHspjtuzjHKP9E6kcVBPgd0 k3NWClOQR7SmBPdqJIct8S6TcZeJO9aDDt9CnEsO6dgKvc2AV5y2Qk9vnlwyu+ykOLqk Ym3fylnfu0cfkmcg6+7CHSI1EZxvGmMWOPqk7jjxrHqPmo549pkpMG1kpZkWSD+/WsDU 09kA== X-Gm-Message-State: AOJu0YypEXX7sfaCazUkdZTdwUNNByjDY45OAWpGVdALPZFv2IWML5/h ch9z8aPQoJGub1iT52UV+cMPXsv9FXZkMaL0BQ/faFPlQuJErXpMSRLyzg== X-Google-Smtp-Source: AGHT+IGeOHU31ePLGjPbHb1/6xiEbOl2t5vH0yPyqLESDH/Riy4sdC/0oNiGiHyla1USR3e9YOKz/w== X-Received: by 2002:a5d:6a90:0:b0:366:ec2f:dbd3 with SMTP id ffacd0b85a97d-368261dee72mr1314949f8f.47.1721134946399; Tue, 16 Jul 2024 06:02:26 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3aae8.dip0.t-ipconnect.de. [79.227.170.232]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680db034efsm8955908f8f.91.2024.07.16.06.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 06:02:25 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Sun, 14 Jul 2024 09:00:08 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x334.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, 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.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:321699 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: >> Well, it's possible, but quite unlikely, that it is the >> handlerlist_sentinel thing or the Lisp_Mutex->name thing (both fixed). >> Much more likely it's another issue. > > Let's see, I've just transferred you latest commits. Like I mentioned, > it can take days for the thing to surface. The handlerlist_sentinel didn't help, BTW, but I had another idea today. The function scan_ambig assumes that that references are aligned on word boundaries (8 bytes here). I haven't checked (and I'm too lazy to check :-)), but that assumption doesn't have to be true. Or, to say the least, I didn't make sure the assumption holds. I'm running with this in my branch only, for now. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Possibly-wrong-alignment-assumption-of-8-in-scan_amb.patch Content-Description: scan_ambig >From b912464c360d0f66ab472f96521dfb4f48d904f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 16 Jul 2024 14:38:26 +0200 Subject: [PATCH] Possibly wrong alignment assumption of 8 in scan_ambig --- src/igc.c | 69 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/igc.c b/src/igc.c index 4d20529d7a8..725799bbce4 100644 --- a/src/igc.c +++ b/src/igc.c @@ -1311,46 +1311,47 @@ scan_ambig (mps_ss_t ss, void *start, void *end, void *closure) MPS_SCAN_BEGIN (ss) { for (mps_word_t *p = start; p < (mps_word_t *) end; ++p) - { - mps_word_t word = *p; - mps_word_t tag = word & IGC_TAG_MASK; - - /* If the references in the object being scanned are - ambiguous then MPS_FIX2() does not update the - reference (because it can't know if it's a - genuine reference). The MPS handles an ambiguous - reference by pinning the block pointed to so that - it cannot move. */ - mps_addr_t ref = (mps_addr_t) word; - mps_res_t res = MPS_FIX12 (ss, &ref); - if (res != MPS_RES_OK) - return res; - - switch (tag) - { - case Lisp_Int0: - case Lisp_Int1: - case Lisp_Type_Unused0: - break; + for (size_t off = 0; off <= 4; off += 4) + { + mps_word_t word = *(mps_word_t *) ((char *)p + off); + mps_word_t tag = word & IGC_TAG_MASK; + + /* If the references in the object being scanned are + ambiguous then MPS_FIX2() does not update the + reference (because it can't know if it's a + genuine reference). The MPS handles an ambiguous + reference by pinning the block pointed to so that + it cannot move. */ + mps_addr_t ref = (mps_addr_t) word; + mps_res_t res = MPS_FIX12 (ss, &ref); + if (res != MPS_RES_OK) + return res; - case Lisp_Symbol: + switch (tag) { - ptrdiff_t off = word ^ tag; - ref = (mps_addr_t) ((char *) lispsym + off); + case Lisp_Int0: + case Lisp_Int1: + case Lisp_Type_Unused0: + break; + + case Lisp_Symbol: + { + ptrdiff_t off = word ^ tag; + ref = (mps_addr_t) ((char *) lispsym + off); + res = MPS_FIX12 (ss, &ref); + if (res != MPS_RES_OK) + return res; + } + break; + + default: + ref = (mps_addr_t) (word ^ tag); res = MPS_FIX12 (ss, &ref); if (res != MPS_RES_OK) return res; + break; } - break; - - default: - ref = (mps_addr_t) (word ^ tag); - res = MPS_FIX12 (ss, &ref); - if (res != MPS_RES_OK) - return res; - break; - } - } + } } MPS_SCAN_END (ss); return MPS_RES_OK; -- 2.45.2 --=-=-=--