Code using seq has wrong strictness (too lazy) when optimised
|Reported by:||michal.palka||Owned by:||simonpj|
|Keywords:||seq strictness strict lazy||Cc:||michal.palka@…|
|Type of failure:||Incorrect result at runtime||Test Case:||simplCore/should_run/T5587|
|Related Tickets:||Differential Rev(s):|
Following program prints  instead of crashing when compiled with -O -fno-full-laziness. Note that it's neccessary to use the extra definition hiddenError instead of calling error directly. The problem might be related to #5557, which, however, has already been fixed and optimisation is needed to trigger the current bug.
hiddenError = error "hidden error" main = do print $ seq (head (map (\a -> \b -> hiddenError) (hiddenError:: Bool))) id 
I used GHC 7.3.20111022 for triggering this problem.
Change History (5)
comment:1 Changed 4 years ago by igloo
- Milestone set to 7.4.1
- Owner set to simonpj
- Priority changed from normal to high