GNU bug report logs - #79751
[PATCH] Fix fix_hash_table, empty_hash_index_vector

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Gerd Möllmann <gerd.moellmann@HIDDEN>; Keywords: patch; Done: Gerd Möllmann <gerd.moellmann@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 31.1, send any further explanations to 79751 <at> debbugs.gnu.org and Gerd Möllmann <gerd.moellmann@HIDDEN> Request was from Gerd Möllmann <gerd.moellmann@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Nov 2025 14:10:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 01 10:10:37 2025
Received: from localhost ([127.0.0.1]:50793 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vFCJQ-0007SH-OG
	for submit <at> debbugs.gnu.org; Sat, 01 Nov 2025 10:10:37 -0400
Received: from lists.gnu.org ([2001:470:142::17]:46438)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1vFCJL-0007S9-W1
 for submit <at> debbugs.gnu.org; Sat, 01 Nov 2025 10:10:32 -0400
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 <gerd.moellmann@HIDDEN>)
 id 1vFCJF-0001Em-LJ
 for bug-gnu-emacs@HIDDEN; Sat, 01 Nov 2025 10:10:25 -0400
Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1vFCJD-0003KD-9i
 for bug-gnu-emacs@HIDDEN; Sat, 01 Nov 2025 10:10:25 -0400
Received: by mail-wr1-x42d.google.com with SMTP id
 ffacd0b85a97d-429b7ba208eso1758499f8f.1
 for <bug-gnu-emacs@HIDDEN>; Sat, 01 Nov 2025 07:10:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1762006218; x=1762611018; darn=gnu.org;
 h=content-transfer-encoding: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=jbrBJhhOHxCtJOkWON+OZv8hXKzAbBNBjN4noJzBXto=;
 b=Is/PJqETOFi6KJoIRPbFaYrjm63U5F+pk7ynrf5vNtHYCmKfYroCOfbbiHOhcHBvpN
 evTSbPjFgxpXqYpPIIQwR+fD8yg9iQgmzAGOJccVfR2bdWxdbVpjns5OCDjIapw6rvfZ
 LpxxXvGPfdsp70Dnsgk7q7e13mDwwdPZdQuQRhGbUwBfDzNpMefbwemcRuKUQXLG6vjV
 J7dTTDtR8RotE7+uB6DbT8ixeystMLlhxnJaF3OF7iR4a0TtFmu0f+qE8nt4f59uUsDG
 HCVfGNudn87euM6hLuKojaf+WCVvHJCfL8U29rwh10X9QKE688oN3d/E8Uq5qOgrcqWr
 9EVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1762006218; x=1762611018;
 h=content-transfer-encoding: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=jbrBJhhOHxCtJOkWON+OZv8hXKzAbBNBjN4noJzBXto=;
 b=a3l2hk8xAVL6P9cu1aCKn7ryE/AFDf3Um5/I+jfKUY919ZCVcpOKfAlwrjp90F0HMb
 ubTpcJdlwVzVJE81JcpWis0ZNHmugIYR2gOv9Jmoi1RYQ2oi/QyhgDj7C2gcwRGf8jPR
 hQKKFXIGKVa/zNJihwqERqyPAWB+gHfF/BCcTUi90gHcdKH3Wn/1i+6io5n0BHNmXggG
 QFbRyCIz1K8XfISQ6NTgFyZoJ9tN8dek2Si465jpbxriISi/gHzhP7eu8xqnO9AIoewU
 7xqzwIfMyBjYip/MaVy0Tsle1p0SD5EYOHWg+5sD3Np1xA80vYEEKP5emUmeoLIzx4a0
 R1/Q==
X-Gm-Message-State: AOJu0YzRz1CYU9N13YnJYES7e9bcesuS3RvJHvHpfMj5+djEp/gklUHT
 dwrYtjV4oFa6h6efz16YPoRzlZHfEFxEix9yTiXd/lCMfVmtWHFtp+15
X-Gm-Gg: ASbGncszsuRM7T+yCRnHNgbopw7ehWWdA+Ai3MySZ3ySJioyWGOJu3yUO/YxeFW1hrD
 4+JjYBJO4PKKxXxKZjjqyc7hBfNP6ACXeYOXGRLZmS+0V7IbK4dIHmxPS2ffnnd1OYydXbU82co
 j7ziBSUcUvaTD0ffMMJwl34OCDyptcmJuWMQ5msOg4DdD8rEFlOfLaUEuBionLT8o94QoL7Pu0x
 k/J4fYf3kwsOTFE3CL7z2+9jLLZFqeOGj3CMSxOQEngVns70ZekIcuaP8LEHgHM5C8OhLRZZ8Kc
 H+t8mHYGoFyqN3UN7H6zgQ7KlUgp9zmSFSfJAly+mA9HTRkeqshPorPHquFB+asUZV0j2q1Czhy
 3Tcub1DFd1C6XuU+TaM5AkNxTDs23Tu3p33l6tuHGo9GuPMSr4p7SyctpOisxp7jeY0eNwJ2qi+
 px+w5RmOTryMa4nSMJqGXTZ7On2UphdjpLibX13x4ZgDwqA8o8TaZN1ZWnYE+FdDQwkIYTyzZNm
 XwGGStktYn+
X-Google-Smtp-Source: AGHT+IGIsTqL5wXk76/kcD1SU5F+XzN07b9xKaR7qvvDv06MlKcIAKKfUjXLC6dO2ltXCpRAUkRBDw==
X-Received: by 2002:a05:6000:25c2:b0:429:b751:7916 with SMTP id
 ffacd0b85a97d-429bd6ad961mr6553929f8f.45.1762006218041; 
 Sat, 01 Nov 2025 07:10:18 -0700 (PDT)
Received: from pro4 (p200300e0b73e860034627e7122d7e37e.dip0.t-ipconnect.de.
 [2003:e0:b73e:8600:3462:7e71:22d7:e37e])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-429c13eaee6sm9042304f8f.33.2025.11.01.07.10.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Nov 2025 07:10:17 -0700 (PDT)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Pip Cet <pipcet@HIDDEN>
Subject: Re: [PATCH] Fix fix_hash_table, empty_hash_index_vector
In-Reply-To: <87tszd6eld.fsf@HIDDEN>
References: <m21pmh3llz.fsf@HIDDEN> <87tszd6eld.fsf@HIDDEN>
Date: Sat, 01 Nov 2025 15:10:16 +0100
Message-ID: <m2wm49269j.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2a00:1450:4864:20::42d;
 envelope-from=gerd.moellmann@HIDDEN; helo=mail-wr1-x42d.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-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: bug-gnu-emacs@HIDDEN, Helmut Eller <eller.helmut@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Pip Cet <pipcet@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Tags: patch
>>
>> This is something I noticed when randomly reading the code. Alas it's
>> not fixing the build problems I have, it just changes where and how it
>> fails, please see below.
>>
>> Could you please check, Helmut and Pip? I have added it to my Emacs.
>
> I'm a bit confused. Fixing a non-MPS object is fine as long as it is
> known to be valid (i.e. definitely not in MPS memory), but I have no
> objections to avoiding it where we can (if the pointer points into
> random MPS memory, we will crash). However, shouldn't we avoid it for
> ->hash and and ->next, too? Only the Lisp objects are guaranteed to be
> valid for empty hash tables, right?

I'm not sure that fix_wrapped_bytes DTRT for empty_hash_index_vector. Is
is_aligned guaranteed?. I don't think it is on macOS.

hash and next are NULL which fix_wrapped_bytes it handles. I believe
index was also NULL before Matthias changed the hash table
implementation, but I'm not sure.

make_hash_table:

fns.c<cl-packages>:
 4875   if (size =3D=3D 0)
 4876     {
 4877       h->key =3D NULL;
 4878       h->value =3D NULL;
 4879       h->hash =3D NULL;
 4880       h->next =3D NULL;
 4881       h->index_bits =3D 0;
 4882       h->index =3D (hash_idx_t *)empty_hash_index_vector;
 4883       h->next_free =3D -1;
 4884     }




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#79751; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Nov 2025 13:59:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 01 09:59:01 2025
Received: from localhost ([127.0.0.1]:50719 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vFC8C-0006so-Td
	for submit <at> debbugs.gnu.org; Sat, 01 Nov 2025 09:59:01 -0400
Received: from lists.gnu.org ([2001:470:142::17]:45754)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>)
 id 1vFC8A-0006sc-3b
 for submit <at> debbugs.gnu.org; Sat, 01 Nov 2025 09:58:59 -0400
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 <pipcet@HIDDEN>)
 id 1vFC84-0007Ub-Na
 for bug-gnu-emacs@HIDDEN; Sat, 01 Nov 2025 09:58:52 -0400
Received: from mail-10628.protonmail.ch ([79.135.106.28])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <pipcet@HIDDEN>)
 id 1vFC7y-0001cH-EK
 for bug-gnu-emacs@HIDDEN; Sat, 01 Nov 2025 09:58:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1762005522; x=1762264722;
 bh=UYsAEmUf9EoXd6wyVKf7fzXnn9WfamG0uX818ASDzOs=;
 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=eJ+h6DuPWUlW7SUyaFuBfo/K4DyWnz1nto7XtKBcpVwqioHHARmTiDwrF8RMH7S+Z
 Ef6QutE8vYvgyEl4w8am197cVPLVpBO70Uev5CBrmWRqXRMfcPkFlH6QBbcK2YpYxJ
 NluOJqpjkyuHAcMKa4cxmj4Ev/wDIdZJ2qfR0X1SuQdPumMDgY96Jj9Fb7H42n96TX
 HXTQZCv3LbOMHHOoXAkGzRCNUb6PncfKyRg6EOfME61n4zIXGEvKpdAZxYAc9kifQy
 GV+N7bH72ygdq9sgVOp/W4J6anvmegYS3j6iJQo6unaH0UlfPBHlFnVuS8WlPBFA5y
 UmIP/HsFNXQ2A==
Date: Sat, 01 Nov 2025 13:58:38 +0000
To: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
From: Pip Cet <pipcet@HIDDEN>
Subject: Re: [PATCH] Fix fix_hash_table, empty_hash_index_vector
Message-ID: <87tszd6eld.fsf@HIDDEN>
In-Reply-To: <m21pmh3llz.fsf@HIDDEN>
References: <m21pmh3llz.fsf@HIDDEN>
Feedback-ID: 112775352:user:proton
X-Pm-Message-ID: 715b2c63f5902ede52ccb0e710b1c0c62be45863
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=79.135.106.28; envelope-from=pipcet@HIDDEN;
 helo=mail-10628.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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: bug-gnu-emacs@HIDDEN, Helmut Eller <eller.helmut@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Tags: patch
>
> This is something I noticed when randomly reading the code. Alas it's
> not fixing the build problems I have, it just changes where and how it
> fails, please see below.
>
> Could you please check, Helmut and Pip? I have added it to my Emacs.

I'm a bit confused. Fixing a non-MPS object is fine as long as it is
known to be valid (i.e. definitely not in MPS memory), but I have no
objections to avoiding it where we can (if the pointer points into
random MPS memory, we will crash). However, shouldn't we avoid it for
->hash and and ->next, too? Only the Lisp objects are guaranteed to be
valid for empty hash tables, right?

Pip





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#79751; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Nov 2025 13:53:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 01 09:53:46 2025
Received: from localhost ([127.0.0.1]:50692 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vFC37-0006gA-JX
	for submit <at> debbugs.gnu.org; Sat, 01 Nov 2025 09:53:46 -0400
Received: from lists.gnu.org ([2001:470:142::17]:55310)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1vFC33-0006fm-Ow
 for submit <at> debbugs.gnu.org; Sat, 01 Nov 2025 09:53:43 -0400
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 <gerd.moellmann@HIDDEN>)
 id 1vFC2y-0006eZ-1I
 for bug-gnu-emacs@HIDDEN; Sat, 01 Nov 2025 09:53:36 -0400
Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1vFC2u-0000pK-M6
 for bug-gnu-emacs@HIDDEN; Sat, 01 Nov 2025 09:53:35 -0400
Received: by mail-wm1-x329.google.com with SMTP id
 5b1f17b1804b1-47710acf715so15113255e9.1
 for <bug-gnu-emacs@HIDDEN>; Sat, 01 Nov 2025 06:53:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1762005210; x=1762610010; darn=gnu.org;
 h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=1vMU0ILIQ5oBsT/UD6t3bUlXm6Njl+EKMFpXAQ7UPbs=;
 b=QIEmKWIUvlbAEWWPH+j/NNULZdrzzKRpTmtNuiCZeNhkoPjcsqMQdue985cHwnDfKg
 sKercrDd4CH8GcUOpjBOSDDc2L6jeldBcgBlhs6DLLbr3szFxStvl3ppQ8TFCuKJAdit
 E1cR+mvLjnO45lscRSxgksdCAOaY1+r5G012CYiiR2qlWiqVdb+SUoQ1FRiokKyJlmj0
 xzbLCdfRMHqJEBDL+Pm5xl6GcBCEjf16vrZrzdGQAeffOQ2NzC4DBy6PbrKmiplW4uZT
 qGtz2CIpQUrNq79QsNgC4u++Z8QoVWLf/l8KWcdLkAjI5tZsTdvQhRBTrq6PT6vSa1kR
 /9EA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1762005210; x=1762610010;
 h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=1vMU0ILIQ5oBsT/UD6t3bUlXm6Njl+EKMFpXAQ7UPbs=;
 b=k++3HjoqeTuWeIX5qvD0az48QQPZn3c4c1NHDHLGy3Rm04c+ShTLUwDn+6iOOl0vlW
 7VvG+JtkpG+21AQPBMTLPyaKv2CbOnI9wCwJ1YXOEgmpoachlZlzb2lq9keQXxpCveLG
 Txp/Sop8P9JcgU1vAwaB22foTnwvfAjazku5e/4clJkBADt2rZ8uYXe1khdqnbxkm/NM
 hzxTUEU5e6VUfbwYO7NxrhPVuHG1pE8jGjmROkGw+SpUpy/MgYyclrTO8ARM/CWo5f1+
 oUke+7fILdsGuQ9GAmIQt6txUVMzCfVvBvgyQOdlzwbW4raVEh1oiadKJugrUlZUPg5T
 cGDw==
X-Gm-Message-State: AOJu0YwrUqE+4Szr7ng78HpVBKMuMCeGCFM6wZXYcyouxLBLGlidf9Ef
 ud4vGiBvMmrVhK7985fPOhzfmxO1n+6Hnn8UBhH/oujrPmN51V7pHBPB
X-Gm-Gg: ASbGncvt/KAHrksi9igR7TAcjSGkMg6nftVMj3rxbg7KmqpFxC28k/z5l7sKnBm2Guu
 x5CwsJWZgfny2RbWZnq950OWPC5ShhYH/RHIfkjHm76QsQn0QaKnFwDKrsQ3d0zIq8eBAS3LXAt
 3q0vA+2/4/9sCPi2qSkMpnjIAHfAcUDRGWLwzTBSId9lrv2cP90dlV7Z3B3y3LjOHBwCqXst1Xm
 9jP6j6SCDP6eCmlCM80Bu3VPtqZCFMvra/guPcMaiUNMcSHua3lJEK7R8iSwYjMbCGzq9R9P9Bp
 1QdswZT7HBYYZq3SZIG7Zy3z3Q+U0DpvyUAtc507RUQBGkQxAKI2RXkg3Lm4wehJhgPOvuVPGH4
 py3mOXJBw45r0viApjcUHKsHG1t7+9Hx9NirgcQHzK84RJXPuUolTzdr80GegFVE4nVDh8URWz0
 i5F/s4e0FfgnAwZbSVYHakn4ZmyA+XrSZ9JHUyM+pq7mHLvHu7/WDRB1P2ObIHFgidUVyE5aJPR
 nWNqcDohFDY
X-Google-Smtp-Source: AGHT+IGLGbTS1cIfFFVYdivFEqg4JC73FBYQAKJY46zV4gpOa/BVfLyp6pmXfwIfgKtwberr+/IDzw==
X-Received: by 2002:a05:600c:1d9d:b0:46f:b42e:e366 with SMTP id
 5b1f17b1804b1-477308cb9e0mr59622735e9.40.1762005209537; 
 Sat, 01 Nov 2025 06:53:29 -0700 (PDT)
Received: from pro4 (p200300e0b73e860034627e7122d7e37e.dip0.t-ipconnect.de.
 [2003:e0:b73e:8600:3462:7e71:22d7:e37e])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4772fabe2fbsm45280235e9.0.2025.11.01.06.53.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Nov 2025 06:53:28 -0700 (PDT)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Fix fix_hash_table, empty_hash_index_vector
X-Debbugs-Cc: 
Date: Sat, 01 Nov 2025 14:53:28 +0100
Message-ID: <m21pmh3llz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::329;
 envelope-from=gerd.moellmann@HIDDEN; helo=mail-wm1-x329.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-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Pip Cet <pipcet@HIDDEN>, Helmut Eller <eller.helmut@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=-=-=
Content-Type: text/plain

Tags: patch

This is something I noticed when randomly reading the code. Alas it's
not fixing the build problems I have, it just changes where and how it
fails, please see below.

Could you please check, Helmut and Pip? I have added it to my Emacs.

  ELC+ELN  ../lisp/emacs-lisp/cl-generic.elc
Backtrace:
0   bootstrap-emacs                     0x0000000102bb7514 emacs_backtrace + 180
1   bootstrap-emacs                     0x0000000102e8c124 terminate_due_to_signal + 352
2   bootstrap-emacs                     0x0000000102bba570 deliver_thread_signal + 0
3   bootstrap-emacs                     0x0000000102bba604 deliver_thread_signal + 148
4   bootstrap-emacs                     0x0000000102bb70dc deliver_fatal_thread_signal + 32
5   bootstrap-emacs                     0x0000000102bba6b8 handle_sigsegv + 148
6   libsystem_platform.dylib            0x000000019fc12744 _sigtramp + 56
7   bootstrap-emacs                     0x0000000102cc2ff4 SYMBOL_NAME + 24
8   bootstrap-emacs                     0x0000000102cc6e6c print_object + 2716
...
gmake[3]: *** [Makefile:286: ../lisp/emacs-lisp/cl-generic.elc] Segmentation fault: 11


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-src-igc.c-fix_hash_table-Don-t-fix-empty_hash_index_.patch

From a7e4133de8bc68770915e8a2fde993aacab8a419 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Date: Sat, 1 Nov 2025 14:42:04 +0100
Subject: [PATCH] * src/igc.c (fix_hash_table): Don't fix
 empty_hash_index_vector

---
 src/igc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/igc.c b/src/igc.c
index 5bfb8b2dc8c..c54732165ce 100644
--- a/src/igc.c
+++ b/src/igc.c
@@ -2463,7 +2463,10 @@ fix_hash_table (mps_ss_t ss, struct Lisp_Hash_Table *h)
     IGC_FIX12_PVEC (ss, &h->value);
     IGC_FIX12_WRAPPED_BYTES (ss, &h->hash);
     IGC_FIX12_WRAPPED_BYTES (ss, &h->next);
-    IGC_FIX12_WRAPPED_BYTES (ss, &h->index);
+    /* If h->table_size == 0, h->index is empty_hash_index_vector which
+       is not allocated from MPS.  */
+    if (h->table_size > 0)
+      IGC_FIX12_WRAPPED_BYTES (ss, &h->index);
   }
   MPS_SCAN_END (ss);
   return MPS_RES_OK;
-- 
2.51.2


--=-=-=--




Acknowledgement sent to Gerd Möllmann <gerd.moellmann@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#79751; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 5 Nov 2025 04:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.