[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1030231: marked as done (hugs: toInteger (minBound :: Int) incorrect on 64bit)



Your message dated Fri, 12 Dec 2025 12:40:00 +0000
with message-id <[🔎] E1vU2RE-000oP9-2M@fasolo.debian.org>
and subject line Bug#1121581: Removed package(s) from unstable
has caused the Debian Bug report #1030231,
regarding hugs: toInteger (minBound :: Int) incorrect on 64bit
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1030231: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1030231
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: hugs
Version: 98.200609.21-6
Severity: normal
Tags: patch
X-Debbugs-Cc: claude@mathr.co.uk

Dear Maintainer,

   * What led up to the situation?

I evaluated:

> (minBound :: Int, toInteger (minBound :: Int))

   * What was the outcome of this action?

Two different numbers were output.

   * What outcome did you expect instead?

Two identical numbers to be output.


The consequences of this bug include
broken bitwise operations for Integer
(arithmetic overflow exceptions).


The problem is in src/bignums.c, because -INT_MIN == INT_MIN.

Attached patch fixes the problem for me on aarch64 and x86_64.


Regards,


Claude

-- System Information:
Debian Release: 11.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-21-amd64 (SMP w/2 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages hugs depends on:
ii  libc6                                          2.31-13+deb11u5
ii  libhugs-base-bundled [libhugs-base]            98.200609.21-6
ii  libhugs-haskell98-bundled [libhugs-haskell98]  98.200609.21-6
ii  libreadline8                                   8.1-1

Versions of packages hugs recommends:
ii  libhugs-alut-bundled [libhugs-alut]                98.200609.21-6
ii  libhugs-cabal-bundled [libhugs-cabal]              98.200609.21-6
ii  libhugs-fgl-bundled [libhugs-fgl]                  98.200609.21-6
ii  libhugs-glut-bundled [libhugs-glut]                98.200609.21-6
ii  libhugs-haskell-src-bundled [libhugs-haskell-src]  98.200609.21-6
ii  libhugs-haxml-bundled [libhugs-haxml]              98.200609.21-6
ii  libhugs-hgl-bundled [libhugs-hgl]                  98.200609.21-6
ii  libhugs-hunit-bundled [libhugs-hunit]              98.200609.21-6
ii  libhugs-mtl-bundled [libhugs-mtl]                  98.200609.21-6
ii  libhugs-network-bundled [libhugs-network]          98.200609.21-6
ii  libhugs-openal-bundled [libhugs-openal]            98.200609.21-6
ii  libhugs-opengl-bundled [libhugs-opengl]            98.200609.21-6
ii  libhugs-parsec-bundled [libhugs-parsec]            98.200609.21-6
ii  libhugs-quickcheck-bundled [libhugs-quickcheck]    98.200609.21-6
ii  libhugs-stm-bundled [libhugs-stm]                  98.200609.21-6
ii  libhugs-time-bundled [libhugs-time]                98.200609.21-6
ii  libhugs-unix-bundled [libhugs-unix]                98.200609.21-6
ii  libhugs-x11-bundled [libhugs-x11]                  98.200609.21-6
ii  libhugs-xhtml-bundled [libhugs-xhtml]              98.200609.21-6

Versions of packages hugs suggests:
pn  cpphs         <none>
pn  haskell-doc   <none>
pn  haskell-mode  <none>

-- no debconf information
diff -wur old/hugs98-98.200609.21/src/bignums.c new/hugs98-98.200609.21/src/bignums.c
--- old/hugs98-98.200609.21/src/bignums.c	2004-10-29 13:43:09.000000000 +0100
+++ new/hugs98-98.200609.21/src/bignums.c	2023-02-01 11:15:18.575315477 +0000
@@ -117,7 +117,7 @@
 	unsigned long no;
 	Cell nx;
 	if (n<0) {
-	    no = (unsigned long)(-n);
+	    no = (unsigned long)(-(signed long)(n));
 	    bn = pair(NEGNUM,NIL);
 	}
 	else {

--- End Message ---
--- Begin Message ---
Version: 98.200609.21-7+rm

Dear submitter,

as the package hugs98 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1121581

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Thorsten Alteholz (the ftpmaster behind the curtain)

--- End Message ---

Reply to: