GNU bug report logs - #15842
Integer overflow on Mac OS X 64-bit

Previous Next

Package: guile;

Reported by: Geert Janssens <geert <at> kobaltwit.be>

Date: Sat, 9 Nov 2013 18:30:03 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15842 in the body.
You can then email your comments to 15842 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#15842; Package guile. (Sat, 09 Nov 2013 18:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Geert Janssens <geert <at> kobaltwit.be>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sat, 09 Nov 2013 18:30:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Geert Janssens <geert <at> kobaltwit.be>
To: bug-guile <at> gnu.org
Subject: Integer overflow on Mac OS X 64-bit
Date: Sat, 09 Nov 2013 17:39:10 +0100
[Message part 1 (text/plain, inline)]
Hi,

I am experimenting with swig bindings for guile on Mac OS X. One of the 
swig tests (the integer test) is failing. I am aware that swig is not 
guile, but the bug seems to be reproducible in pure guile as well.

When I calculate (2^64) -1 on the Mac OS X platform, it returns -1. On 
my fedora system, the same calculation returns
18446744073709551615

The scheme command used for this is
(display (- (expt 2 64) 1))(newline)

Note that I don't have direct access to a 64-bit Mac OS X system. I have 
run into this bug via that travis CI service.

Here's a link to one of the test runs for swig on that platform:
https://travis-ci.org/gjanssens/swig/jobs/13730706
The output of the calculation as given above is on line 2161.
(The test is missing the (newline) part, so some additional output is 
appended on the same line. This comes from another display command 
though).

I'm not sure what additional information I can provide. If you need, I 
can run more tests indirectly on the travis platform, but other than 
that, my options are fairly limited.

Geert
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#15842; Package guile. (Thu, 14 Nov 2013 07:36:02 GMT) Full text and rfc822 format available.

Message #8 received at 15842 <at> debbugs.gnu.org (full text, mbox):

From: William S Fulton <wsf <at> fultondesigns.co.uk>
To: 15842 <at> debbugs.gnu.org
Subject: Integer overflow on Mac OS X 64-bit
Date: Thu, 14 Nov 2013 07:22:32 +0000
I verified the output of:

(display (- (expt 2 64) 1))(newline)

gives -1 using 1.8.8 on OSX Mountain Lion. I then installed Guile 2.0.9 
and the output is 18446744073709551615, so this looks fixed to me. The 
SWIG tests mentioned also pass now.

William




Reply sent to Mark H Weaver <mhw <at> netris.org>:
You have taken responsibility. (Fri, 15 Nov 2013 00:27:01 GMT) Full text and rfc822 format available.

Notification sent to Geert Janssens <geert <at> kobaltwit.be>:
bug acknowledged by developer. (Fri, 15 Nov 2013 00:27:03 GMT) Full text and rfc822 format available.

Message #13 received at 15842-done <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Geert Janssens <geert <at> kobaltwit.be>
Cc: 15842-done <at> debbugs.gnu.org
Subject: Re: bug#15842: Integer overflow on Mac OS X 64-bit
Date: Thu, 14 Nov 2013 19:25:25 -0500
Geert Janssens <geert <at> kobaltwit.be> writes:
> I am experimenting with swig bindings for guile on Mac OS X. One of the 
> swig tests (the integer test) is failing. I am aware that swig is not 
> guile, but the bug seems to be reproducible in pure guile as well.
>
> When I calculate (2^64) -1 on the Mac OS X platform, it returns -1. On 
> my fedora system, the same calculation returns
> 18446744073709551615

When reporting bugs, please tell us what version of Guile you're using.

This is fixed in Guile 2.0.9.  The bug came into existence when clang
started optimizing out overflow checks, on the theory that if a signed
integer overflow occurs then the behavior is unspecified and thus the
compiler can do whatever it likes.

http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commit;h=2355f01709eadfd5350c510cdb095b4e3f71f17c
http://stackoverflow.com/questions/14495636/strange-multiplication-behavior-in-guile-scheme-interpreter

I'm closing this bug, on the assumption that you're using an old Guile
release.  Please reopen it if the problem still exists in 2.0.9.

    Thanks!
      Mark




Information forwarded to bug-guile <at> gnu.org:
bug#15842; Package guile. (Fri, 15 Nov 2013 08:26:02 GMT) Full text and rfc822 format available.

Message #16 received at 15842-done <at> debbugs.gnu.org (full text, mbox):

From: Geert Janssens <geert <at> kobaltwit.be>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 15842-done <at> debbugs.gnu.org
Subject: Re: bug#15842: Integer overflow on Mac OS X 64-bit
Date: Fri, 15 Nov 2013 09:24:55 +0100
[Message part 1 (text/plain, inline)]
On Thursday 14 November 2013 19:25:25 Mark H Weaver wrote:
> When reporting bugs, please tell us what version of Guile you're
> using.
> 
Oops, I should have known better. William S. Fulton (from the Swig project), filled 
in the details in message #8.

> This is fixed in Guile 2.0.9.  The bug came into existence when clang
> started optimizing out overflow checks, on the theory that if a signed
> integer overflow occurs then the behavior is unspecified and thus the
> compiler can do whatever it likes.
> 
As noted by William, the bug appears in 1.8. Is there any chance to get this fix 
backported to that branch ? Or has support for 1.8 stopped completely in the 
meantime ?

Thanks,

Geert
[Message part 2 (text/html, inline)]
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Dec 2013 12:24:15 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 233 days ago.

Previous Next


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