Sid
Sid

Reputation: 85

Segmentation fault when zip 2 self-defined type list

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

Upvotes: 6

Views: 198

Answers (1)

Ørjan Johansen
Ørjan Johansen

Reputation: 18189

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.

Upvotes: 3

Related Questions