bus error in Integer calculations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bus error in Integer calculations

Geraint Jones
I have this little demo which I use for sixth formers which includes
calculating in fairly rapid order the sum of the digits of the
10^9th Fibonacci number.  (I haven't got enough physical memory to
do the same for the 10^10th number without thrashing...)  It fell
over on a flashy new macbook I was going to use for the presentation
the other day; indeed I found I couldn't even calculate the sum of
the digits of the 10^6th number.  

I've reduced the problem to calculating numbers as large as 2^10000000
(as an Integer, of course), which works on all the ghci 7.8.4
implementations I can find on various machines around the department,
but which falls over on the 8.0.1 implementation on my macbook.

2^1000000 is fine, but 2^10000000 causes a bus error which may well
be a stack overflow in libHSinteger-gmp-1.0.0.1-ghc8.0.1.dylib

I don't seem to have easy access to 8.0.1 elsewhere or other
implementations on a mac.  Does anyone have a handle on whether this
is a problem with the sizing of the mac implementation or whether it
is a pervasive 8.0.1 problem?  Either way, it doesn't seem friendly
that it manifests as an uncaught bus error.
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: bus error in Integer calculations

Clinton Mead
I'm not a GHC developer but I think you should report a bug here: https://ghc.haskell.org/trac/ghc/wiki/ReportABug

I've done it a couple of times and if you provide a reproducible test case it will usually get looked at at some point. 

Managing all the bugs on a mailing list would be a nightmare. If you're worried it might not actually be a bug well they can always just close it. 

On Fri, Dec 9, 2016 at 10:43 AM, Geraint Jones <[hidden email]> wrote:
I have this little demo which I use for sixth formers which includes
calculating in fairly rapid order the sum of the digits of the
10^9th Fibonacci number.  (I haven't got enough physical memory to
do the same for the 10^10th number without thrashing...)  It fell
over on a flashy new macbook I was going to use for the presentation
the other day; indeed I found I couldn't even calculate the sum of
the digits of the 10^6th number.

I've reduced the problem to calculating numbers as large as 2^10000000
(as an Integer, of course), which works on all the ghci 7.8.4
implementations I can find on various machines around the department,
but which falls over on the 8.0.1 implementation on my macbook.

2^1000000 is fine, but 2^10000000 causes a bus error which may well
be a stack overflow in libHSinteger-gmp-1.0.0.1-ghc8.0.1.dylib

I don't seem to have easy access to 8.0.1 elsewhere or other
implementations on a mac.  Does anyone have a handle on whether this
is a problem with the sizing of the mac implementation or whether it
is a pervasive 8.0.1 problem?  Either way, it doesn't seem friendly
that it manifests as an uncaught bus error.
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: bus error in Integer calculations

Ben Gamari-2
In reply to this post by Geraint Jones
Geraint Jones <[hidden email]> writes:

> I have this little demo which I use for sixth formers which includes
> calculating in fairly rapid order the sum of the digits of the
> 10^9th Fibonacci number.  (I haven't got enough physical memory to
> do the same for the 10^10th number without thrashing...)  It fell
> over on a flashy new macbook I was going to use for the presentation
> the other day; indeed I found I couldn't even calculate the sum of
> the digits of the 10^6th number.  
>
For the record this was reported as GHC #12954.

Cheers,

- Ben


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users

signature.asc (463 bytes) Download Attachment