GNU logs - #75745, boring messages


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Resent-From: Homo <gay@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Wed, 22 Jan 2025 05:52:02 +0000
Resent-Message-ID: <handler.75745.B.17375250827881 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 75745
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 75745 <at> debbugs.gnu.org
Cc: Homo <gay@HIDDEN>
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.17375250827881
          (code B ref -1); Wed, 22 Jan 2025 05:52:02 +0000
Received: (at submit) by debbugs.gnu.org; 22 Jan 2025 05:51:22 +0000
Received: from localhost ([127.0.0.1]:59210 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1taTe6-000232-2M
	for submit <at> debbugs.gnu.org; Wed, 22 Jan 2025 00:51:22 -0500
Received: from lists.gnu.org ([2001:470:142::17]:53362)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <gay@HIDDEN>) id 1taTe3-00022m-CD
 for submit <at> debbugs.gnu.org; Wed, 22 Jan 2025 00:51:19 -0500
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 <gay@HIDDEN>) id 1taTdx-0004me-7i
 for guix-patches@HIDDEN; Wed, 22 Jan 2025 00:51:13 -0500
Received: from layka.disroot.org ([178.21.23.139])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <gay@HIDDEN>) id 1taTdv-0003Aq-5G
 for guix-patches@HIDDEN; Wed, 22 Jan 2025 00:51:12 -0500
Received: from mail01.disroot.lan (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id C4C4925936;
 Wed, 22 Jan 2025 06:51:06 +0100 (CET)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP
 id blzFkPVokwlh; Wed, 22 Jan 2025 06:51:02 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1737525062; bh=AtBoPAx+1kYsuFezqdE3r833T1SbiTW6u/mYwjwWQDs=;
 h=From:To:Cc:Subject:Date;
 b=HS53aeg49HS3fojBjuopExD1ejyc4sXU11bqnaBYEBErwMpVRS6ky4yWULAPjpYLK
 eDcodO5BCyy8ZIJBs4KB1FhbRS4uCIQLQ5ABfknnmpieB2PWP80axt8s2Sf1bpaR0y
 iWj6jSAMSQszQPYBKtGXOKI7lHATTzfYQwyyyIkQZD4YAuC5Fr4o7XyT6Upc2eN0BM
 tVNs9piZ4g//H1GgmA2twS0q/K3YEXUWuSiDKM+0wPngRywG4Sb2rTKgW7imuqamC6
 +/GKtF9KulSSpTk1DeNVWqeT2tXs+smwZ+GxbSvaj8i5Kv5gjFQzaAqVBcc1UL7mnf
 xG37We2+JcqNQ==
From: Homo <gay@HIDDEN>
Date: Wed, 22 Jan 2025 07:42:17 +0200
Message-ID: <20250122054216.30430-2-gay@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=178.21.23.139; envelope-from=gay@HIDDEN;
 helo=layka.disroot.org
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,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
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.1 (/)

This is required to bootstrap MicroHs.

* gnu/packages/patches/hugs-ignore-integer-overflow.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hugs.scm (hugs)[source]: Use it.

Change-Id: Ie13085d356f98d4dbb0fd1108b7179ad5226720f
---
See https://github.com/augustss/MicroHs/tree/hugs

It's a strong requirement from Lennart to not remove usage of pattern guards in MicroHs's code, so need help from someone experienced with YACC to add pattern guards support to Hugs, a nice to have, but not required, cherry on top of that: adding bang patterns and "instance forall" support in Hugs.

 gnu/local.mk                                  |  1 +
 gnu/packages/hugs.scm                         |  2 +-
 .../hugs-ignore-integer-overflow.patch        | 55 +++++++++++++++++++
 3 files changed, 57 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/hugs-ignore-integer-overflow.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f118fe4442..ecea6ae9c7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1569,6 +1569,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/hubbub-sort-entities.patch		\
   %D%/packages/patches/hueplusplus-mbedtls.patch		\
   %D%/packages/patches/hugs-fix-build.patch			\
+  %D%/packages/patches/hugs-ignore-integer-overflow.patch	\
   %D%/packages/patches/hurd-64bit.patch				\
   %D%/packages/patches/hurd-refcounts-assert.patch		\
   %D%/packages/patches/hurd-rumpdisk-no-hd.patch		\
diff --git a/gnu/packages/hugs.scm b/gnu/packages/hugs.scm
index b6a97ea78c..ae7acbd511 100644
--- a/gnu/packages/hugs.scm
+++ b/gnu/packages/hugs.scm
@@ -37,7 +37,7 @@ (define-public hugs
       (sha256
        (base32
         "1mdy4aq4campgmnpc2qwq7bsbfhaxfsqdghbyyz2wms4lnfcmyma"))
-      (patches (search-patches "hugs-fix-build.patch"))))
+      (patches (search-patches "hugs-fix-build.patch" "hugs-ignore-integer-overflow.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
diff --git a/gnu/packages/patches/hugs-ignore-integer-overflow.patch b/gnu/packages/patches/hugs-ignore-integer-overflow.patch
new file mode 100644
index 0000000000..ef0b7de824
--- /dev/null
+++ b/gnu/packages/patches/hugs-ignore-integer-overflow.patch
@@ -0,0 +1,55 @@
+From a87d3a15194e4d7724627e43a94ac1d12ab78f9c Mon Sep 17 00:00:00 2001
+From: Lennart Augustsson <lennart@HIDDEN>
+Date: Tue, 21 Jan 2025 12:26:15 -0700
+Subject: [PATCH] Ignore overflow in conversion from Integer to Int.
+
+---
+ src/bignums.c | 24 ++++++++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/src/bignums.c b/src/bignums.c
+index 32ce528..38ec43f 100644
+--- a/src/bignums.c
++++ b/src/bignums.c
+@@ -196,10 +196,18 @@ Bignum n; {
+ 		while (nonNull(ds=tl(ds))) {
+ 		    Int d = digitOf(hd(ds));
+ 		    if (b > (Int)(MAXHUGSWORD/BIGBASE))
+-			return NIL;
++#if 0
++                      return NIL;
++#else
++                      fprintf(stderr, "Warning: bigToInt overflow ignored\n");
++#endif
+ 		    b *= BIGBASE;
+ 		    if (d > (Int)((MAXHUGSWORD - m)/b))
+-			return NIL;
++#if 0
++                      return NIL;
++#else
++                      fprintf(stderr, "Warning: bigToInt overflow ignored\n");
++#endif
+ 		    m += b*d;
+ 		}
+ 	    } else { /* fst(n)==NEGNUM */
+@@ -207,10 +215,18 @@ Bignum n; {
+ 		while (nonNull(ds=tl(ds))) {
+ 		    Int d = - digitOf(hd(ds));
+ 		    if (b > (MAXPOSINT/BIGBASE))
+-			return NIL;
++#if 0
++                      return NIL;
++#else
++                      fprintf(stderr, "Warning: bigToInt overflow ignored\n");
++#endif
+ 		    b *= BIGBASE;
+ 		    if (d < (MINNEGINT - m)/b)
+-			return NIL;
++#if 0
++                      return NIL;
++#else
++                      fprintf(stderr, "Warning: bigToInt overflow ignored\n");
++#endif
+ 		    m += b*d;
+ 		}
+ 	    }
-- 
2.47.1





Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Homo <gay@HIDDEN>
Subject: bug#75745: Acknowledgement ([PATCH] gnu: hugs: Ignore integer
 overflow.)
Message-ID: <handler.75745.B.17375250827881.ack <at> debbugs.gnu.org>
References: <20250122054216.30430-2-gay@HIDDEN>
X-Gnu-PR-Message: ack 75745
X-Gnu-PR-Package: guix-patches
X-Gnu-PR-Keywords: patch
Reply-To: 75745 <at> debbugs.gnu.org
Date: Wed, 22 Jan 2025 05:52:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 guix-patches@HIDDEN

If you wish to submit further information on this problem, please
send it to 75745 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
75745: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75745
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Resent-From: Lars-Dominik Braun <lars@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 24 Jan 2025 14:01:02 +0000
Resent-Message-ID: <handler.75745.B75745.17377272465533 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75745
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Homo <gay@HIDDEN>
Cc: 75745 <at> debbugs.gnu.org
Received: via spool by 75745-submit <at> debbugs.gnu.org id=B75745.17377272465533
          (code B ref 75745); Fri, 24 Jan 2025 14:01:02 +0000
Received: (at 75745) by debbugs.gnu.org; 24 Jan 2025 14:00:46 +0000
Received: from localhost ([127.0.0.1]:44242 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tbKEo-0001RA-Cu
	for submit <at> debbugs.gnu.org; Fri, 24 Jan 2025 09:00:46 -0500
Received: from mout-p-102.mailbox.org ([80.241.56.152]:53526)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <lars@HIDDEN>) id 1tbKEl-0001Qt-Mo
 for 75745 <at> debbugs.gnu.org; Fri, 24 Jan 2025 09:00:44 -0500
Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4YffbP5Ntdz9shn;
 Fri, 24 Jan 2025 15:00:33 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001;
 t=1737727233;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=BtqsoT2excwV9WnqI8zyYM1ZRj+NZ1a16OtU9GEVc9A=;
 b=Mtr758ysjlKG2gKpIzjhAnrWDOFiX0ogZl5FuErHcm7ydWjBelS3GMNP1CLQGB4ukGqQBr
 PynKhR/RYTDY8Rxh5E/aLpxPiW3Cno4ta/CvxhMULEAR4SCe/yrqQ0GuSsQgx80A8TvdyH
 KJEdazWKa4iMzMJy2gu2xb8jfPzFyJrwn03PepInshoqP5HIv+ivt44T9/45WJ794aBtUt
 k+CKXIaiMwv3Jaoal24kHxwyGSLv5bNgXvixZMzQ6oDWk/FLpzdAZEWFKGWEc0KJkzRcMo
 DYLq5vquC+gjW1N6wQ7QPV+/XQUxyc1sdLGYgsbe+TOvuKhFij1FzQ3NXp0e0A==
Date: Fri, 24 Jan 2025 15:00:31 +0100
From: Lars-Dominik Braun <lars@HIDDEN>
Message-ID: <Z5Oc_0VCpwMKfNRd@HIDDEN>
References: <20250122054216.30430-2-gay@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20250122054216.30430-2-gay@HIDDEN>
X-Spam-Score: -0.7 (/)
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: -1.7 (-)

Hi,

> This is required to bootstrap MicroHs.

at first glance and without much background knowledge this looks like
a really bad idea(tm). Do you know why this patch is required (i.e. why
MicroHs relies on this specific overflow behavior)?

Lars





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Resent-From: gay@HIDDEN
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 24 Jan 2025 19:46:01 +0000
Resent-Message-ID: <handler.75745.B75745.173774794818913 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75745
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Lars-Dominik Braun <lars@HIDDEN>, 75745 <at> debbugs.gnu.org, Lennart Augustsson <lennart@HIDDEN>
Received: via spool by 75745-submit <at> debbugs.gnu.org id=B75745.173774794818913
          (code B ref 75745); Fri, 24 Jan 2025 19:46:01 +0000
Received: (at 75745) by debbugs.gnu.org; 24 Jan 2025 19:45:48 +0000
Received: from localhost ([127.0.0.1]:47163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tbPch-0004uz-MF
	for submit <at> debbugs.gnu.org; Fri, 24 Jan 2025 14:45:48 -0500
Received: from layka.disroot.org ([178.21.23.139]:49984)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gay@HIDDEN>) id 1tbPce-0004um-Mk
 for 75745 <at> debbugs.gnu.org; Fri, 24 Jan 2025 14:45:45 -0500
Received: from mail01.disroot.lan (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id A17F025C79;
 Fri, 24 Jan 2025 20:45:42 +0100 (CET)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP
 id i35FPfHvgirT; Fri, 24 Jan 2025 20:45:38 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1737747938; bh=bgM3K3gorp+fiwoR5ShA1ghfWyWJZUwgT9EyGirQpas=;
 h=Date:From:To:Subject:In-Reply-To:References;
 b=Y49n3eEO6S8rzZnNUjwvcNmf2DyCJ2oxi6ZUQH9trWzlmllMI6nJ4E+rN4qhdWV/o
 yUEuPzo/He+6HT0Jbom5Dp2BL73q7lYTdzNSbx3V2wAZ5gFE0m5pdgSx4P9XrxcDUb
 8dAlTVej4UprbsCLglCiXZ5CZpN1lFGlJJVVq/j/Oh+Hxv7RaWVWQqx6fey4HwlS92
 MznU0jWr+S/ZGTPpn1QhIGUIKZmVvl4Lv4NVrwXOXjLFTTZ9htGuogMCqUT2ffSFJm
 xfacirtI54LnttKIzdzL7pwwVkwxPZsB3c+Qm+KuJRjpa+8yE6kH8u1rMs/IJs578y
 ZN7QGliolx1eQ==
MIME-Version: 1.0
Date: Fri, 24 Jan 2025 21:45:38 +0200
From: gay@HIDDEN
In-Reply-To: <Z5Oc_0VCpwMKfNRd@HIDDEN>
References: <20250122054216.30430-2-gay@HIDDEN>
 <Z5Oc_0VCpwMKfNRd@HIDDEN>
Message-ID: <0aecaf67eebfe070b9144e18860178c6@HIDDEN>
X-Sender: gay@HIDDEN
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
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: -1.0 (-)

Lars-Dominik Braun kirjoitti 2025-01-24 16:00:
> Hi,
> 
>> This is required to bootstrap MicroHs.
> 
> at first glance and without much background knowledge this looks like
> a really bad idea(tm). Do you know why this patch is required (i.e. why
> MicroHs relies on this specific overflow behavior)?
> 
> Lars

Hi,

No idea, I tried grepping both large numbers and fromInteger usage, as 
well as grep -i overflow, however not crashing in conversion from 
Integer to Int is consistent behavior and might be assumed by a lot of 
packages, like if you try:
ghci> fromInteger (9 ^ 100) :: Int
6627890308811632801

I remember several years ago seeing (unrelated to MicroHs) code that for 
performance reasons uses integer overflow with division by some power of 
2 (i++ / (1 << N)) for circular array (queue) to pass messages between 
threads, so having it overflow or underflow is not always a bug.

This message is sent to 75745 <at> debbugs.gnu.org and so is visible to 
public at https://issues.guix.gnu.org/75745 or if it doesn't work at 
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75745




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Resent-From: gay@HIDDEN
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 24 Jan 2025 21:07:02 +0000
Resent-Message-ID: <handler.75745.B75745.17377527851435 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75745
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Lars-Dominik Braun <lars@HIDDEN>, 75745 <at> debbugs.gnu.org, Lennart Augustsson <lennart@HIDDEN>
Received: via spool by 75745-submit <at> debbugs.gnu.org id=B75745.17377527851435
          (code B ref 75745); Fri, 24 Jan 2025 21:07:02 +0000
Received: (at 75745) by debbugs.gnu.org; 24 Jan 2025 21:06:25 +0000
Received: from localhost ([127.0.0.1]:47241 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tbQsj-0000N5-9R
	for submit <at> debbugs.gnu.org; Fri, 24 Jan 2025 16:06:25 -0500
Received: from layka.disroot.org ([178.21.23.139]:41890)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gay@HIDDEN>) id 1tbQsg-0000Mn-CJ
 for 75745 <at> debbugs.gnu.org; Fri, 24 Jan 2025 16:06:23 -0500
Received: from mail01.disroot.lan (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id E93F025B4D;
 Fri, 24 Jan 2025 22:06:18 +0100 (CET)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP
 id iXXgrcjbmoPJ; Fri, 24 Jan 2025 22:06:13 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1737752773; bh=Ys7Z1uJVmDto2CUPeGQAH+k6xwxbsKZtXnjmpC0RQEA=;
 h=Date:From:To:Subject:In-Reply-To:References;
 b=DEB5iVCxt5M1v2CYAUv2HuyBQOxyCUY6dh5gLuUIpO03F/TgVXIwVluX3xBRcc2/1
 jVjx5+5lt2FSggSWcN+Snj/UuGUJox2tg63CcB2qkrre0tgmN6Uc0Bo1Qy7SF/oU9n
 bLuePpDrybgmhUxsY9uXzNs+vLujPSlaFUY9O5agPyUHzmToLk2PgzOVIOxFSRF1Q3
 iVdkEWOTiY1q605RJLihL0GdevnTneXjVtpkZ+MjrofnhVqV5emEr4ygI30l48omPh
 qS1vtSvag1snbff+dwVtVZviktbin8upU6JGeFKe9414DIE8QyN1dRss4iNYz1zi6O
 DM3FH+/Q7IIqA==
MIME-Version: 1.0
Date: Fri, 24 Jan 2025 23:06:12 +0200
From: gay@HIDDEN
In-Reply-To: <0aecaf67eebfe070b9144e18860178c6@HIDDEN>
References: <20250122054216.30430-2-gay@HIDDEN>
 <Z5Oc_0VCpwMKfNRd@HIDDEN>
 <0aecaf67eebfe070b9144e18860178c6@HIDDEN>
Message-ID: <6b0d7e7991e366ee1a4d861c9775ebef@HIDDEN>
X-Sender: gay@HIDDEN
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
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: -1.0 (-)

> I remember several years ago seeing (unrelated to MicroHs) code that 
> for performance reasons uses integer overflow with division by some 
> power of 2 (i++ / (1 << N)) for circular array (queue) to pass messages 
> between threads, so having it overflow or underflow is not always a 
> bug.

Correction, it was: i++ & (1 << N)

But you get the idea.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Resent-From: Lars-Dominik Braun <lars@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 25 Jan 2025 14:29:01 +0000
Resent-Message-ID: <handler.75745.B75745.173781530810199 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75745
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Lennart Augustsson <lennart@HIDDEN>
Cc: 75745 <at> debbugs.gnu.org, Homo <gay@HIDDEN>
Received: via spool by 75745-submit <at> debbugs.gnu.org id=B75745.173781530810199
          (code B ref 75745); Sat, 25 Jan 2025 14:29:01 +0000
Received: (at 75745) by debbugs.gnu.org; 25 Jan 2025 14:28:28 +0000
Received: from localhost ([127.0.0.1]:49072 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tbh9A-0002eQ-5x
	for submit <at> debbugs.gnu.org; Sat, 25 Jan 2025 09:28:28 -0500
Received: from mout-p-101.mailbox.org ([80.241.56.151]:45224)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <lars@HIDDEN>) id 1tbh96-0002e2-V6
 for 75745 <at> debbugs.gnu.org; Sat, 25 Jan 2025 09:28:26 -0500
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4YgH8w1Ckvz9sc2;
 Sat, 25 Jan 2025 15:28:16 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001;
 t=1737815296;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=6/WSOqltuDszTpOfv1wICpQKhi2nl7KZeOsrjmx0XBY=;
 b=gkkWSzvNrc6Gfvu5BfwM3uW1RM30iQGkzaq8sC1FYDOCjI3teBIGaTck1yWPjOSsJeIFmd
 8ezIs94VLZbGRufzOF2sB/EXYriT0dysjQChi+PIuWWs/v2OS6XacbNuLe5f/jaUr3mBKO
 wVOxwrJiznI/zVQ3k+K5gNagSBJEWN1E/ehHU9fmxciercZsiL/xHopqNH2KZYTOo4NkEC
 Haki6ZUUGtdYk9xIsH/8vhGhYuYWPG5n5h7OeIO68lsLuoRDeEZHfh/p36pdsMb09+nPuh
 qHqgFBr9KlrS4Abvjv6kr4xStBFN1sYO/PNvveymElhjY9L3VL7FrRA1V0ku1Q==
Date: Sat, 25 Jan 2025 15:28:13 +0100
From: Lars-Dominik Braun <lars@HIDDEN>
Message-ID: <Z5T0_dkuStz2fGTg@HIDDEN>
References: <20250122054216.30430-2-gay@HIDDEN>
 <Z5Oc_0VCpwMKfNRd@HIDDEN>
 <0aecaf67eebfe070b9144e18860178c6@HIDDEN>
 <6b0d7e7991e366ee1a4d861c9775ebef@HIDDEN>
 <CAJogeqfAbW=OiHn_FZCpbPpsXFBFWOb_fyocebjamxhRne1BnQ@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAJogeqfAbW=OiHn_FZCpbPpsXFBFWOb_fyocebjamxhRne1BnQ@HIDDEN>
X-Rspamd-Queue-Id: 4YgH8w1Ckvz9sc2
X-Spam-Score: -0.7 (/)
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: -1.7 (-)

Hi Lennart,

> If someone fixes all the warnings when compiling Hugs, then I bet this
> problem goes away. But I am not going to do that. In its current state Hugs
> can compile a fully functional MicroHs, and that's enough for me.

actually, I can build the MicroHs package from
https://issues.guix.gnu.org/75778 just fine with our default, unpatched
Hugs. It can also compile/run the example from
https://github.com/augustss/MicroHs?tab=readme-ov-file#example.

Can we therefore just drop this patch? It causes Hugs to die with a
SIGFPE while evaluating the example expression `fromInteger (9 ^ 100)
:: Int` from above, which is rather ugly behavior.

And on an unrelated note: Would it be possible to bootstrap (a possibly
very, very old version of) GHC with MicroHs? (As far as I see our GHC
7 is currently bootstrapped via binaries.)

Lars





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Resent-From: Lennart Augustsson <lennart@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 25 Jan 2025 17:09:04 +0000
Resent-Message-ID: <handler.75745.B75745.173782493810592 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75745
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Homo <gay@HIDDEN>
Cc: 75745 <at> debbugs.gnu.org, Lars-Dominik Braun <lars@HIDDEN>
Received: via spool by 75745-submit <at> debbugs.gnu.org id=B75745.173782493810592
          (code B ref 75745); Sat, 25 Jan 2025 17:09:04 +0000
Received: (at 75745) by debbugs.gnu.org; 25 Jan 2025 17:08:58 +0000
Received: from localhost ([127.0.0.1]:52275 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tbjeT-0002kf-FX
	for submit <at> debbugs.gnu.org; Sat, 25 Jan 2025 12:08:58 -0500
Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:48352)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <lennart@HIDDEN>)
 id 1tbStD-00017X-P9
 for 75745 <at> debbugs.gnu.org; Fri, 24 Jan 2025 18:15:04 -0500
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-54024ecc33dso2691154e87.0
 for <75745 <at> debbugs.gnu.org>; Fri, 24 Jan 2025 15:15:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=augustsson-net.20230601.gappssmtp.com; s=20230601; t=1737760497; x=1738365297;
 darn=debbugs.gnu.org; 
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=jBi35Wey282XDYgK79PCyEo1Nn4LsMuVQy4tYcgkY0U=;
 b=20uU+L/1KKttMZElhITm73Jx4qLkosrNeLQrQLLPtq3AljAGI2M3Pq0LDg1q6JxISF
 KvW7Z86tIZ4jRE0IEPITZf2/QgR/MU2n0lTWvfc0y+SDswvn3QaU66S0j1uVFwPEqsvr
 AHv5ObR/fhsQR3cAx/eTUGK9HWS4HyfDLHiG2CgKDiWWVNaZI0yAwf62oAHkHwSx4brq
 WYbexV8l9H2DtFtZH6F8XtBvDOYEz42GE83AEWU2GyDjaPR7O/HlpE8Hsg+u5GjCxiUZ
 CrpFhANHoEl6LTpH10il/XKigH+RbpJ5pACX4prwKCeFBsrcZyekCMRHh9Z8mtpDLb3V
 SfzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737760497; x=1738365297;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=jBi35Wey282XDYgK79PCyEo1Nn4LsMuVQy4tYcgkY0U=;
 b=eYahNFV7MNlvnBZhB8++WPdfBd71ndbtxLyiLUzuJ1b23+4G7KtYDQS6UX2OzV0FK3
 VMxg7JeEiAExOci8I65wfyRjP8nJ78uhQIzjd3hR/JBoSc2cZJ80puiOdOOyApOzshyf
 40twlaIhlylVue66NfoIBOATOf1iVVyx1U/IUTGmNShlg2ieU2EQmGg0axV6LNOL9JN7
 y8GIyiOQ7G/82ydTHaYgVhPer6cY9647Ct1czlQ71Jx3sUgnxRM8KnZvhCzhE9lE7I/n
 9iaOBKnLh0OXxIoJ6s7MxD4c+JGej11fA81aIgB6T2EEidx8qnWtlOqbIKihXauWMdxt
 HecQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVz52X8M2CectX/E8dCNvGnlOEjkpNIbWlIW9yYD2rjRP2oQA2IjSGScb39w4f41jxa7LdCMw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwI8XVhg54dAunrQVmFEVleYPk0Ypk/FVeqA2Q8W48EYuloae/Z
 Tz/svbINZ1N1jn52cqBjYF8o3TvU7K1cEVOHNQxM+vYpH3e1NsszrKRW4aebQupHiQ8ohl/ebZ9
 DnR5o5IzRYYg9uY3kougu/7o7mg4rMFgoD9/D
X-Gm-Gg: ASbGncsRPXOo0VO1Het8OHbzi6G06xfJEaFeAFruAUEK82PS6xVbn3eOOCtCMRvqhCJ
 34AmlfsXruiAy5BfWP9+w4u7xKCMgnzg5G/WcCf6IqWJJNo795+essqySKv568Ik=
X-Google-Smtp-Source: AGHT+IH3RWOyIKgSC12SspfmsW80uGWifIrfZhNzubyM0ydsSYwaHBt1ZxbbrLZNNzTZ/4WWgs9OLqBfjQOvsvJYuls=
X-Received: by 2002:ac2:514f:0:b0:540:3571:f51a with SMTP id
 2adb3069b0e04-5439c249f54mr9256159e87.26.1737760497011; Fri, 24 Jan 2025
 15:14:57 -0800 (PST)
MIME-Version: 1.0
References: <20250122054216.30430-2-gay@HIDDEN>
 <Z5Oc_0VCpwMKfNRd@HIDDEN>
 <0aecaf67eebfe070b9144e18860178c6@HIDDEN>
 <6b0d7e7991e366ee1a4d861c9775ebef@HIDDEN>
In-Reply-To: <6b0d7e7991e366ee1a4d861c9775ebef@HIDDEN>
From: Lennart Augustsson <lennart@HIDDEN>
Date: Sat, 25 Jan 2025 00:14:46 +0100
X-Gm-Features: AWEUYZlbBER4pr-pgJahon5ON0gUq-MnV81oLImkxZdEnIS1jUF-jib0_C4mI0Y
Message-ID: <CAJogeqfAbW=OiHn_FZCpbPpsXFBFWOb_fyocebjamxhRne1BnQ@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000002125cb062c7be507"
X-Spam-Score: -0.0 (/)
X-Mailman-Approved-At: Sat, 25 Jan 2025 12:08:54 -0500
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: -1.0 (-)

--0000000000002125cb062c7be507
Content-Type: text/plain; charset="UTF-8"

I actually checked carefully. MicroHs does not rely on any overflow
behaviour. There are no large Integers being used.
I believe this is a Hugs bug caused by Hugs assuming that Int is 32 bits,
but being compiled on a 64 bit platform.

Another example of such a bug is that it looks like the StablePtr
implementation casts 64 bit pointers to and from 32 bit int.

If someone fixes all the warnings when compiling Hugs, then I bet this
problem goes away. But I am not going to do that. In its current state Hugs
can compile a fully functional MicroHs, and that's enough for me.

Lennart

On Fri, Jan 24, 2025, 22:06 <gay@HIDDEN> wrote:

> > I remember several years ago seeing (unrelated to MicroHs) code that
> > for performance reasons uses integer overflow with division by some
> > power of 2 (i++ / (1 << N)) for circular array (queue) to pass messages
> > between threads, so having it overflow or underflow is not always a
> > bug.
>
> Correction, it was: i++ & (1 << N)
>
> But you get the idea.
>

--0000000000002125cb062c7be507
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">I actually checked carefully. MicroHs does not rely on an=
y overflow behaviour. There are no large Integers being used.<div dir=3D"au=
to">I believe this is a Hugs bug caused by Hugs assuming that Int is 32 bit=
s, but being compiled on a 64 bit platform.</div><div dir=3D"auto"><br></di=
v><div dir=3D"auto">Another example of such a bug is that it looks like the=
 StablePtr implementation casts 64 bit pointers to and from 32 bit int.=C2=
=A0</div><div dir=3D"auto"><br></div><div dir=3D"auto">If someone fixes all=
 the warnings when compiling Hugs, then I bet this problem goes away. But I=
 am not going to do that. In its current=C2=A0state Hugs can compile a full=
y functional MicroHs, and that&#39;s enough for me.=C2=A0</div><div dir=3D"=
auto"><br></div><div dir=3D"auto">Lennart</div></div><br><div class=3D"gmai=
l_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri=
, Jan 24, 2025, 22:06  &lt;<a href=3D"mailto:gay@HIDDEN">gay@HIDDEN=
rg</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; I remember s=
everal years ago seeing (unrelated to MicroHs) code that <br>
&gt; for performance reasons uses integer overflow with division by some <b=
r>
&gt; power of 2 (i++ / (1 &lt;&lt; N)) for circular array (queue) to pass m=
essages <br>
&gt; between threads, so having it overflow or underflow is not always a <b=
r>
&gt; bug.<br>
<br>
Correction, it was: i++ &amp; (1 &lt;&lt; N)<br>
<br>
But you get the idea.<br>
</blockquote></div>

--0000000000002125cb062c7be507--




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Resent-From: Lennart Augustsson <lennart@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 25 Jan 2025 17:09:05 +0000
Resent-Message-ID: <handler.75745.B75745.173782494010606 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75745
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Lars-Dominik Braun <lars@HIDDEN>
Cc: 75745 <at> debbugs.gnu.org, Homo <gay@HIDDEN>
Received: via spool by 75745-submit <at> debbugs.gnu.org id=B75745.173782494010606
          (code B ref 75745); Sat, 25 Jan 2025 17:09:05 +0000
Received: (at 75745) by debbugs.gnu.org; 25 Jan 2025 17:09:00 +0000
Received: from localhost ([127.0.0.1]:52279 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tbjeU-0002kv-Qr
	for submit <at> debbugs.gnu.org; Sat, 25 Jan 2025 12:08:59 -0500
Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:53717)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <lennart@HIDDEN>)
 id 1tbhI3-00037O-IM
 for 75745 <at> debbugs.gnu.org; Sat, 25 Jan 2025 09:37:41 -0500
Received: by mail-lj1-x22f.google.com with SMTP id
 38308e7fff4ca-3076262bfc6so32021071fa.3
 for <75745 <at> debbugs.gnu.org>; Sat, 25 Jan 2025 06:37:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=augustsson-net.20230601.gappssmtp.com; s=20230601; t=1737815853; x=1738420653;
 darn=debbugs.gnu.org; 
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=U62FiIfwknssqmcXLyDz2QQtjWwzO6Zt7EYO8f5YjRk=;
 b=gq7s1oCwH42q2ZgAsBd6biO81o52IID99cuaFwNyteSjhRn/uIxeaBpzurOVsiHFbh
 gD3VSgk+EIIR08REv8Im5uFUs2NC/Q2hRH8NQHTeIZymvTodPa75ZZA8ItpRq7sb2fcP
 0J7JK7bcI0neBX6V8TPblYwdHEPpSF9qtDJfF19xjusPWUKaKlKk8oCCTRyAWg2QxxIK
 9aytW08nutT/WJdNT47N8qscv9nBBikfY4/yZ1TjiLDF1WfHLpaFsbRGWn0dcmR+NajH
 sKOYvxSOzyKPSmXx+EExYcUR3v3ORNLggZE5TM/9ymBfy8UnW0Q+GgamwzPpXbSZ2srH
 VK3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737815853; x=1738420653;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=U62FiIfwknssqmcXLyDz2QQtjWwzO6Zt7EYO8f5YjRk=;
 b=XvNnRuJvNDnKwvgMfcZMBb8lm5xUzElCGlZutGqfSanw1Tt+kZJL8akr8O+zxyhwIS
 CoLW4I8MWwurJ+z+6LbSxpvbylvFuSfmLdbRd9O6l+sZjVTg0shpJRRRoVZx8MV87TTu
 wqd9czMhOzqrPthvWz+Frx4AVCBMIXmjeUakQQ02gpHIZCxp/urhW4jhMOek2DYFd3ES
 lMcklC5HKwEcncXEcr/GP59XGxCFxmIytgCEmhQyiWdwyhtZrHUtFqnyEcyQnmWQBw/g
 hu4fE7tIUte/IGGJRRBNwoYLGSMEDitl4tYy22Xd8PlBfnDvLb2Ix/67hbt6r7+WrJuE
 kBww==
X-Forwarded-Encrypted: i=1;
 AJvYcCVAOErnxNJ07mTGj31kPQYSYHcbuZfZQBPN++BSk/mXo+PLEULoZoF/V8flQDNssIm+Av0nCw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yw07JW0oE190hq6D/z/PzpSSL/ui+r05ojlONekmQv4MCSeWxCo
 khNJ+YWv7OJQaR/5pfI/TIgQtCe5QDrZ/IpOMbWjfOaVVL00aW9H7T7+l2dhXnxS1NICkCzhVT0
 yggfr3v+Bu6oeV92keslB15zU+M2MjPc2ktFn
X-Gm-Gg: ASbGncszTw5OrdYeGlvKvCzG9wSwmFi37R9WfOx5qqpawzz+51KabcD/YGELOVNnt05
 pKGmuLaUR7liEpzjQNFiouAUH+1TgvcFhpQ2VUip0XUPqvQ7UGq/YpNus4pcK
X-Google-Smtp-Source: AGHT+IE/YfGg83GRXATxunP1YyU6P5LLLrwto5LoxhsGxlSZJF1+japJXX8DjjugNtMaC8o+yjrFhrEDtTRQqI5La5o=
X-Received: by 2002:a05:6512:e8d:b0:542:28b4:2732 with SMTP id
 2adb3069b0e04-5439c247811mr10799714e87.19.1737815852576; Sat, 25 Jan 2025
 06:37:32 -0800 (PST)
MIME-Version: 1.0
References: <20250122054216.30430-2-gay@HIDDEN>
 <Z5Oc_0VCpwMKfNRd@HIDDEN>
 <0aecaf67eebfe070b9144e18860178c6@HIDDEN>
 <6b0d7e7991e366ee1a4d861c9775ebef@HIDDEN>
 <CAJogeqfAbW=OiHn_FZCpbPpsXFBFWOb_fyocebjamxhRne1BnQ@HIDDEN>
 <Z5T0_dkuStz2fGTg@HIDDEN>
In-Reply-To: <Z5T0_dkuStz2fGTg@HIDDEN>
From: Lennart Augustsson <lennart@HIDDEN>
Date: Sat, 25 Jan 2025 15:37:21 +0100
X-Gm-Features: AWEUYZnUdKYCZY8AQ4cTRYG4ZJqNbOES_T0_JovNLB7OZ3Sccgo_s0gOZXEv_eU
Message-ID: <CAJogeqer01h+75EMD0Kh7O74m0_ir2o_SdkonUV1dduP59N8sA@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000940e1e062c88c8d4"
X-Spam-Score: -0.0 (/)
X-Mailman-Approved-At: Sat, 25 Jan 2025 12:08:54 -0500
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: -1.0 (-)

--000000000000940e1e062c88c8d4
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

So, it seems random if Hugs need the patch or not.  Which suggests some
undefined behaviour.
But if it works for you without the patch, so much the better.

I have no idea what it would take to compile GHC with MicroHs.  I've not
tried.
I think it might not be too far away.  MicroHs will probably need to get
unboxed types (or at least fake them).  GHC is written fairly
conservatively and is not using all the latest features.
If somebody wants to try, I'm willing to add needed features to MicroHs if
they are not too crazy.


On Sat, Jan 25, 2025 at 3:28=E2=80=AFPM Lars-Dominik Braun <lars@HIDDEN> w=
rote:

> Hi Lennart,
>
> > If someone fixes all the warnings when compiling Hugs, then I bet this
> > problem goes away. But I am not going to do that. In its current state
> Hugs
> > can compile a fully functional MicroHs, and that's enough for me.
>
> actually, I can build the MicroHs package from
> https://issues.guix.gnu.org/75778 just fine with our default, unpatched
> Hugs. It can also compile/run the example from
> https://github.com/augustss/MicroHs?tab=3Dreadme-ov-file#example.
>
> Can we therefore just drop this patch? It causes Hugs to die with a
> SIGFPE while evaluating the example expression `fromInteger (9 ^ 100)
> :: Int` from above, which is rather ugly behavior.
>
> And on an unrelated note: Would it be possible to bootstrap (a possibly
> very, very old version of) GHC with MicroHs? (As far as I see our GHC
> 7 is currently bootstrapped via binaries.)
>
> Lars
>
>

--000000000000940e1e062c88c8d4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">So, it seems random if Hugs need the patch or not.=C2=A0 W=
hich suggests some undefined behaviour.<div>But if it works for you without=
 the patch, so much the better.</div><div><br></div><div>I have no idea wha=
t it would take to compile GHC with MicroHs.=C2=A0 I&#39;ve not tried.</div=
><div>I think it might not be too far away.=C2=A0 MicroHs will probably nee=
d to get unboxed types (or at least fake them).=C2=A0 GHC is written fairly=
 conservatively and is not using all the latest features.</div><div>If some=
body wants to try, I&#39;m willing to add needed features to MicroHs if the=
y are not too crazy.</div><div><br></div></div><br><div class=3D"gmail_quot=
e gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Jan =
25, 2025 at 3:28=E2=80=AFPM Lars-Dominik Braun &lt;<a href=3D"mailto:lars@6=
xq.net">lars@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex">Hi Lennart,<br>
<br>
&gt; If someone fixes all the warnings when compiling Hugs, then I bet this=
<br>
&gt; problem goes away. But I am not going to do that. In its current state=
 Hugs<br>
&gt; can compile a fully functional MicroHs, and that&#39;s enough for me.<=
br>
<br>
actually, I can build the MicroHs package from<br>
<a href=3D"https://issues.guix.gnu.org/75778" rel=3D"noreferrer" target=3D"=
_blank">https://issues.guix.gnu.org/75778</a> just fine with our default, u=
npatched<br>
Hugs. It can also compile/run the example from<br>
<a href=3D"https://github.com/augustss/MicroHs?tab=3Dreadme-ov-file#example=
" rel=3D"noreferrer" target=3D"_blank">https://github.com/augustss/MicroHs?=
tab=3Dreadme-ov-file#example</a>.<br>
<br>
Can we therefore just drop this patch? It causes Hugs to die with a<br>
SIGFPE while evaluating the example expression `fromInteger (9 ^ 100)<br>
:: Int` from above, which is rather ugly behavior.<br>
<br>
And on an unrelated note: Would it be possible to bootstrap (a possibly<br>
very, very old version of) GHC with MicroHs? (As far as I see our GHC<br>
7 is currently bootstrapped via binaries.)<br>
<br>
Lars<br>
<br>
</blockquote></div>

--000000000000940e1e062c88c8d4--




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Resent-From: gay@HIDDEN
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 25 Jan 2025 19:46:02 +0000
Resent-Message-ID: <handler.75745.B75745.173783435429905 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75745
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Lennart Augustsson <lennart@HIDDEN>, 75745 <75745 <at> debbugs.gnu.org>, Lars-Dominik Braun <lars@HIDDEN>
Received: via spool by 75745-submit <at> debbugs.gnu.org id=B75745.173783435429905
          (code B ref 75745); Sat, 25 Jan 2025 19:46:02 +0000
Received: (at 75745) by debbugs.gnu.org; 25 Jan 2025 19:45:54 +0000
Received: from localhost ([127.0.0.1]:52769 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tbm6L-0007lb-Ne
	for submit <at> debbugs.gnu.org; Sat, 25 Jan 2025 14:45:54 -0500
Received: from layka.disroot.org ([178.21.23.139]:38494)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gay@HIDDEN>) id 1tbm6I-0007bC-M5
 for 75745 <at> debbugs.gnu.org; Sat, 25 Jan 2025 14:45:51 -0500
Received: from mail01.disroot.lan (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id BC40725C09;
 Sat, 25 Jan 2025 20:45:48 +0100 (CET)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP
 id WmASy0NO-6DV; Sat, 25 Jan 2025 20:45:48 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1737834348; bh=7qN7twJ/PfELX8bkt+TJuMBHjhQcQDfUfJg6aalb1DA=;
 h=Date:From:To:Subject:In-Reply-To:References;
 b=W7t1qXJx26GpPu6jQVn4XF0WGsG7KCLXD+xyE0tU4QMixT4y1asAen61iHRPIS1fW
 Zx1wCP//1grI5Dxx/AygJvRRJjryzu/jlT2vGAAGM5+L1/gqB2OrP810yoDQggFRrs
 SIPTEsJ0y/HDbOevWRNYoJIpQYRnT1eA5wbnu+3wjkmJ4hw/ipCQdBdYP/rn7usOEJ
 6Dfh91rco80MBF4YOoZgyMLr9RrXEIbQZfU4HyWgizVimdJWkQ3NkKSR54LxoJn3FD
 nXUBaLMaT0IilrRB2OCeFRvb8A6FYO4hOqRTVJYE6hB9jIwtlF/QY4LOEO+dQh/k/F
 ElxcvV2t3Ra5Q==
MIME-Version: 1.0
Date: Sat, 25 Jan 2025 21:45:47 +0200
From: gay@HIDDEN
In-Reply-To: <CAJogeqer01h+75EMD0Kh7O74m0_ir2o_SdkonUV1dduP59N8sA@HIDDEN>
References: <20250122054216.30430-2-gay@HIDDEN>
 <Z5Oc_0VCpwMKfNRd@HIDDEN>
 <0aecaf67eebfe070b9144e18860178c6@HIDDEN>
 <6b0d7e7991e366ee1a4d861c9775ebef@HIDDEN>
 <CAJogeqfAbW=OiHn_FZCpbPpsXFBFWOb_fyocebjamxhRne1BnQ@HIDDEN>
 <Z5T0_dkuStz2fGTg@HIDDEN>
 <CAJogeqer01h+75EMD0Kh7O74m0_ir2o_SdkonUV1dduP59N8sA@HIDDEN>
Message-ID: <f14a2461bc878b6a9274ebd7dfc150a1@HIDDEN>
X-Sender: gay@HIDDEN
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
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: -1.0 (-)

I wouldn't hurry to close this thread, as it seems to be 
architecture-specific problem as today macOS runs on ARM, so Guix on 
non-x86 architectures might also be affected.

By the way, I just tested that this code doesn't crash Hugs: fromInteger 
(9^20) :: Int

Honestly I am extremely surprised by your willingness to help to 
bootstrap GHC, as it's hard to find anyone interested in Haskell 
community, and it might be impossible to convince GHC developers to 
cooperate.

However I am content with what I already have as I only wanted minimal 
bootstrappable Haskell compiler which I can flexibly change to port to 
Plan 9 and all architectures it supports, and someone else already 
ported Hugs there.

Having GHC on that minimal and portable system is just too much work and 
once ported won't even be able to build 99% of packages on Stackage 
because Plan 9 is anti-ISO and anti-POSIX, Plan 9 is research OS that 
from the beginning opposes existing standards and so maintaining GHC 
there would make it harder for me to experiment.





Last modified: Sat, 25 Jan 2025 19:45:01 UTC

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