GNU bug report logs - #75745
[PATCH] gnu: hugs: Ignore integer overflow.

Previous Next

Package: guix-patches;

Reported by: Homo <gay <at> disroot.org>

Date: Wed, 22 Jan 2025 05:52:02 UTC

Severity: normal

Tags: moreinfo, patch

Full log


View this message in rfc822 format

From: gay <at> disroot.org
To: Lars-Dominik Braun <lars <at> 6xq.net>, 75745 <at> debbugs.gnu.org, Lennart Augustsson <lennart <at> augustsson.net>
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Date: Fri, 24 Jan 2025 21:45:38 +0200
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




This bug report was last modified 106 days ago.

Previous Next


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