Opened 5 years ago

Last modified 5 weeks ago

#7411 new bug

Exceptions are optimized away in certain situations

Reported by: SimonHengel Owned by:
Priority: high Milestone: 8.4.1
Component: Compiler Version: 7.6.1
Keywords: seq, deepseq, evaluate, exceptions Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Incorrect result at runtime Test Case: simplCore/should_fail/T7411
Blocked By: Blocking:
Related Tickets: #5129 Differential Rev(s):
Wiki Page:

Description (last modified by bgamari)

The issue came up in this thread on glasgow-haskell-users.

Steps to reproduce:

-- file Foo.hs
import Control.Exception
import Control.DeepSeq
main = evaluate (('a' : undefined) `deepseq` return () :: IO ())
$ ghc -fforce-recomp -fpedantic-bottoms -O Foo.hs

Expected result:

The program should fail with:

Foo: Prelude.undefined

Actual result:

The program succeeds.

Compiling the program with -fno-state-hack helps.

Change History (15)

comment:1 Changed 4 years ago by igloo

difficulty: Unknown
Milestone: 7.8.1
Priority: normalhigh

Thanks for the report.

comment:2 Changed 3 years ago by thoughtpolice

Milestone: 7.8.37.8.4

Moving to 7.8.4.

comment:3 Changed 3 years ago by thoughtpolice

Milestone: 7.8.47.10.1

Moving (in bulk) to 7.10.4

comment:4 Changed 2 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1

comment:5 Changed 21 months ago by thomie

comment:6 Changed 21 months ago by Ben Gamari <ben@…>

In 15cb83d4/ghc:

Add testcase for #7411

comment:7 Changed 21 months ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:8 Changed 20 months ago by bgamari

Test Case: simplCore/should_fail/T7411

comment:9 Changed 18 months ago by bgamari

Description: modified (diff)

comment:10 Changed 14 months ago by Ben Gamari <ben@…>

In aa61174/ghc:

users-guide: Add references to various issues in bugs section

Test Plan: Read it

Reviewers: austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2052

GHC Trac Issues: #7411, #11197, #11554, #11715

comment:11 Changed 14 months ago by bgamari

Milestone: 8.0.18.0.2

comment:12 Changed 9 months ago by bgamari

Milestone: 8.0.28.0.3

This won't be fixed for 8.0.2.

comment:13 Changed 3 months ago by bgamari

Milestone: 8.0.38.2.1

At this point it is rather unlikely that there will be an 8.0.3. Re-milestoning.

comment:14 Changed 3 months ago by ThreeFx

Even with fno-state-hack this program succeeds under GHC version 8.0.1.

comment:15 Changed 5 weeks ago by bgamari

Milestone: 8.2.18.4.1

This won't be fixed for 8.2.

Note: See TracTickets for help on using tickets.