Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Segmentation fault when zip 2 self-defined type list

Tags:

haskell

Under GHCi 7.10.2 on a Parallella, I defined a data type Peg which derives Show. I got a segmentation fault when I tried to zip two Peg lists. Does anyone have any clues?

sid@linaro-nano:~CIS192/hw_2$ ghci
GHCi, version 7.10.2: http://haskell.org/ghc/  :? for help
Prelude>
Prelude>
Prelude> data Peg = Red | Green deriving (Show)
Prelude> zip [Red, Red] [Green, Green]
[(Red,Green),(Segmentation fault
like image 335
Sid Avatar asked Oct 14 '15 17:10

Sid


1 Answers

Expanding on Reid Barton's comment:

There was a serious bug with GHC's support for ARM CPUs, related to ARM having two different instruction set modes (Arm and Thumb). The GCC-compiled runtime system and LLVM compiled library/user code used different default choices. GHCi's runtime linker didn't understand those properly, causing crashes when jumping from code written in one mode to code written in the other.

The bug has just been fixed (by essentially forcing Arm mode everywhere), and the fix should be in the upcoming GHC 7.10.3 and 8.0.1 releases.

like image 155
Ørjan Johansen Avatar answered Nov 15 '22 08:11

Ørjan Johansen