X-Envelope-From: notmuch-bounces@notmuchmail.org  Sun Jun 21 20:26:46 2026
Return-Path: <notmuch-bounces@notmuchmail.org>
X-Original-To: nmbug@yantan.tethera.net
Delivered-To: nmbug@yantan.tethera.net
Received: from yantan.tethera.net (localhost [127.0.0.1])
	by mail.notmuchmail.org (Postfix) with ESMTP id 630855DFAE;
	Sun, 21 Jun 2026 20:26:46 +0000 (UTC)
X-Greylist: delayed 126639 seconds by postgrey-1.36 at yantan; Sun, 21 Jun 2026 20:26:43 UTC
Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201])
	by mail.notmuchmail.org (Postfix) with ESMTPS id 12A195DF3A
	for <notmuch@notmuchmail.org>; Sun, 21 Jun 2026 20:26:43 +0000 (UTC)
Received: from c53 (gw1.nor.fi [185.218.193.67])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange secp256r1 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	(Authenticated sender: too)
	by meesny.iki.fi (Postfix) with ESMTPSA id 4gk2t95PWzzyRd;
	Sun, 21 Jun 2026 23:26:41 +0300 (EEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny;
	t=1782073602;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=ta+q60jSZ1Po+C1vfgcOBm3qkx3KttOBnSaxAqLwNlg=;
	b=S8l8tU3xwHx8E6q5xF3C745O9BfwCqJ88pjk1S4JIFCEvlRb8SECZq7NgMJBC/ZaiovfY6
	+i6moWkq2WwOQv0Y0sJiXge9WBaDsOOVLhd6l3Tc67Oqlokd6r5LF9gGZ0oWrH6O04L2p1
	ntCW+lmE3iSDguAWcQ9aXqXNurHLCYg=
ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1782073602;
	b=Ga/upwkXLWkB6GjEK35cnbt1xqYEUqADZAFkBSWRFxU1gI75MaXsN/tkHba3/SOj2pQe9i
	QafsZ1Bk6HzIUv+W4p37dGU+2pkPO75vNGaeb02j2mnIcNRoMx7YyCBjP/OzsSJW6dPSlD
	YPe+6QzvKgi8N3RCkpb4VKZuuYLhGGM=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi;
	s=meesny; t=1782073602;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=ta+q60jSZ1Po+C1vfgcOBm3qkx3KttOBnSaxAqLwNlg=;
	b=o29HwCFw1Qtf9QFjEm4WLkbcliC/Bm9i1oME4JWwGrTrBAo6/Yzx6CrRiD4nF+UA3JnStW
	iyNAXETXr1xYC+slzeHhlwrPMLzAStW0p+dwf6+BSeduMdv2q7HYf3usEzJRqrPid4h3sI
	rK55xM10atWP/XEbm3DNYdpYuLCazS4=
ARC-Authentication-Results: i=1;
	ORIGINATING;
	auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi
From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>, Dick Marinus <dick@mrns.nl>,
 notmuch@notmuchmail.org
Subject: Re: [PATCH 1/2] CLI/reply: use static const for reply_to_map
In-Reply-To: <875x3cwzwi.fsf@tethera.net>
References: <20260617192542.3516741-1-dick@mrns.nl>
 <20260617192542.3516741-2-dick@mrns.nl> <y12ijeo.9lm4qp-too@iki.fi>
 <875x3cwzwi.fsf@tethera.net>
User-Agent: Notmuch/0.40+24~gc45207d (https://notmuchmail.org) Emacs/27.1
X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
	$[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
	!)g;OY^,BjTbr)Np:%c_o'jj,Z
Date: Sun, 21 Jun 2026 23:26:40 +0300
Message-ID: <y12fl1e.i3l0ur-too@iki.fi>
MIME-Version: 1.0
Message-ID-Hash: 3LV5SQPABHASQ6LQXWCYDPFD5H5AOBNU
X-Message-ID-Hash: 3LV5SQPABHASQ6LQXWCYDPFD5H5AOBNU
X-MailFrom: tomi.ollila@iki.fi
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.3
Precedence: list
List-Id: "Use and development of the notmuch mail system." <notmuch.notmuchmail.org>
List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
List-Owner: <mailto:notmuch-owner@notmuchmail.org>
List-Post: <mailto:notmuch@notmuchmail.org>
List-Subscribe: <mailto:notmuch-join@notmuchmail.org>
List-Unsubscribe: <mailto:notmuch-leave@notmuchmail.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

On Sun, Jun 21 2026, David Bremner wrote:

> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
>> On Wed, Jun 17 2026, Dick Marinus wrote:
>>
>>> It's recommended to store these functions in a const struct, for some
>>> reason I even got a segmentation fault without this.
>>
>> The change looks sane (I also checked all references to reply_to_map in
>> code). With this the array does not need to create on-the-fly in that
>> function but can (even) be created to read-only location at compile-time
>> (barring binding to dynamic libs when program starts but still 
>> mpu-protected...)
>>
>> But about the commit message. Who recommends this thing? you? god?
>> deepseek? someone(tm)? Looks somewhat vague statement to me.
>>
>> Then the sigsegv - I don't see why the code before that change would
>> sigsegv. Without more details so that it could be reproduced such
>> a statement should not be mentioned in commit message.
>
> I think this is probably the bug discussed in
>
>   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125252
>   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1135526
>   https://nmbug.notmuchmail.org/nmweb/show/87pl3e2nvl.fsf%40tethera.net
>
> (more information in the first link).
>
> I did not see anywhere in the bug log (but maybe I missed it) that the
> code was actually wrong. If we do decide to make the change to work
> around a gcc bug, we should be clear about that.

Thanks for the links, by going through those I could see that is exactly
the bug there. I also could reproduce it with gcc 16.1, -std=gnu23 and -O2
(and then w/o that -gnu23 as it is now default -- with -gnu11 no crash).

IMO the commit message could first tell that it makes the structure 
compile-time constant and often stored in read-only location and then
mention it happens to work around bug in gcc 15.2 and 16.1, just for
historical reference (and since gcc bug was found out trying to run
notmuch test suite with notmuch compiled with gcc 15.2)

(at least gcc 15.4 and 16.2 will have this fixed)

Tomi
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org
