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: Lennart Augustsson <lennart <at> augustsson.net>
To: Homo <gay <at> disroot.org>
Cc: 75745 <at> debbugs.gnu.org, Lars-Dominik Braun <lars <at> 6xq.net>
Subject: [bug#75745] [PATCH] gnu: hugs: Ignore integer overflow.
Date: Sat, 25 Jan 2025 00:14:46 +0100
[Message part 1 (text/plain, inline)]
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 <at> disroot.org> 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.
>
[Message part 2 (text/html, inline)]

This bug report was last modified 107 days ago.

Previous Next


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