Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#10633 closed bug (duplicate)

GHCi segfaults on arm

Reported by: Thra11 Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.10.1
Keywords: Cc: hvr
Operating System: Linux Architecture: arm
Type of failure: GHCi crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

I define a data type:

data Tree a = Leaf a | Tree {  left :: Tree a 
                            , right :: Tree a } deriving Show

Then I create a few named trees:

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):

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.

Attachments (2)

err (196.9 KB) - added by Thra11 2 years ago.
Debug info from ghci +RTS -Di
out (209 bytes) - added by Thra11 2 years ago.
output from ghci +RTS -Di

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by Thra11

Attachment: err added

Debug info from ghci +RTS -Di

Changed 2 years ago by Thra11

Attachment: out added

output from ghci +RTS -Di

comment:1 Changed 2 years ago by erikd

This is probably a dupe of #10375.

comment:2 Changed 2 years ago by erikd

Resolution: duplicate
Status: newclosed

This is *definitely* a dupe of #10375 which has been fixed in git HEAD and will almost certainly be in any 7.10.3 release.

Closing this.

comment:3 Changed 2 years ago by Thra11

Confirmed fixed in 7.10.3-rc1

Note: See TracTickets for help on using tickets.