Arnaud Bailly | 15 Jan 00:40 2013
Picon

Cannot read a large integer on linux

Hello,
I am encountering a strange issue while trying to read a string into an integer.

On windows 7 64bit, I have:

> read "18780189038289e49" :: Integer
=187801890382890000000000000000000000000000000000000000000000000

On linux (64bit, libgmp.so.3.5.2) I have:

> read "18780189038289e49" :: Integer
*** Exception: Prelude.read: no parse

That's weird and I really have no clue what's going on. I use ghci 7.4.2 on linux and 7.4.1 on windows.

What am I doing wrong ?

Arnaud

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Artyom Kazak | 15 Jan 01:02 2013
Picon

Re: Cannot read a large integer on linux

Right, it was fixed in GHC 7.4.2.

hackage.haskell.org/trac/ghc/ticket/5688

The trouble with old behaviour was that it had been creating a security breach (anybody could pass "1e100000000000" where an Integer was expected and cause a segmentation fault).

15.01.2013 2:41 пользователь "Arnaud Bailly" <arnaud.oqube <at> gmail.com> написал:
Hello,
I am encountering a strange issue while trying to read a string into an integer.

On windows 7 64bit, I have:

> read "18780189038289e49" :: Integer
=187801890382890000000000000000000000000000000000000000000000000

On linux (64bit, libgmp.so.3.5.2) I have:

> read "18780189038289e49" :: Integer
*** Exception: Prelude.read: no parse

That's weird and I really have no clue what's going on. I use ghci 7.4.2 on linux and 7.4.1 on windows.

What am I doing wrong ?

Arnaud

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Johannes Waldmann | 15 Jan 01:12 2013
Picon

Re: Cannot read a large integer on linux

> read "18780189038289e49" :: Integer

this might be related:

http://hackage.haskell.org/trac/ghc/ticket/5688

Gmane