Subject: bug#15842: closed (Re: bug#15842: Integer overflow on Mac OS X 64-bit)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 15 Nov 2013 00:27:03 +0000

Your bug report

#15842: Integer overflow on Mac OS X 64-bit

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
15842: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15842
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#15842: Integer overflow on Mac OS X 64-bit
From: Mark H Weaver <[email-masked]>
To: Geert Janssens <[email-masked]>
Cc: [email-masked]
Date: Thu, 14 Nov 2013 19:25:25 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Geert Janssens <[email-masked]> 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

Subject: Integer overflow on Mac OS X 64-bit
From: Geert Janssens <[email-masked]>
To: [email-masked]
Date: Sat, 09 Nov 2013 17:39:10 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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