[GHC] #10633: GHCi segfaults on arm

GHC ghc-devs at haskell.org
Sun Jul 12 13:11:57 UTC 2015


#10633: GHCi segfaults on arm
---------------------------------+-------------------------------
              Reporter:  Thra11  |             Owner:
                  Type:  bug     |            Status:  new
              Priority:  normal  |         Milestone:
             Component:  GHCi    |           Version:  7.10.1
              Keywords:          |  Operating System:  Linux
          Architecture:  arm     |   Type of failure:  GHCi crash
             Test Case:          |        Blocked By:
              Blocking:          |   Related Tickets:
Differential Revisions:          |
---------------------------------+-------------------------------
 I define a data type:
 {{{#!hs
 data Tree a = Leaf a | Tree {  left :: Tree a
                             , right :: Tree a } deriving Show
 }}}

 Then I create a few named trees:
 {{{#!hs
 testTree0 = Leaf 0
 testTree1 = Tree (Leaf 0) (Leaf 0)
 testTree2 = Tree testTree0 testTree0
 testTree3 = Tree testTree1 testTree1
 testTree4 = Tree (Tree (Leaf 0) (Leaf 0)) (Tree (Leaf 0) (Leaf 0))
 }}}

 This segfaults in GHCi (works fine with non-interactive GHC):
 {{{#!hs
 main = print testTree3
 }}}

 == Notes ==
  * testTree3 and testTree4 represent the same tree, constructed in
 different ways. However, testTree3 segfaults when it tries to print the
 second testTree1; testTree4 does not.
  * entering 'print testTree1' twice segfaults, but only if it is twice in
 a row.
  * strangely enough, printing testTree4 repeatedly does not segfault.
  * printing testTree0 many times in a row doesn't segfault either.
  * printing testTree2 segfaults.

 It seems to be something to do with repetition or reevaluation of the same
 named structure. I haven't yet managed to determine whether the print is
 relevant or whether it's forcing the evaluation of the data structure that
 causes the segfault (Can't remember how to force a list but discard the
 result). I have attached the the output from running ghci with +RTS -Di.
 Let me know if there's anything else I should try.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10633>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list