Skip to content

Compiler nontermination on UNPACK pragmas

Feeding GHC 7.6.1 (from git) ill-advised UNPACK pragmas like

data T1 = T1 {-# UNPACK #-} !T1

results in GHC going into infinite wait; gdb reports

#1  0x0000000001f7f979 in waitCondition ()
#2  0x0000000001f68c3b in yieldCapability ()
#3  0x0000000001f712d2 in schedule ()
#4  0x0000000001f727b5 in scheduleWaitThread ()
#5  0x0000000001f6f40e in real_main ()
#6  0x0000000001f6f50a in hs_main ()
#7  0x0000000000495763 in main ()

This happens, apparently, whenever there's possible recursion through an UNPACK pragma, even in the (I think) well-formed

data T0 = T0 T1
data T1 = T1 {-# UNPACK #-} !T0
Trac metadata
Trac field Value
Version 7.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information