Opened 10 years ago

Closed 3 years ago

#3397 closed bug (fixed)

:step hangs when -fbreak-on-exception is set

Reported by: hamish Owned by:
Priority: normal Milestone: 7.2.1
Component: GHCi Version: 7.10.1-rc2
Keywords: Cc: erik.flister@…, hvr
Operating System: Unknown/Multiple Architecture: x86
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Stepping through code (that I can step through fine when -fbreak-on-exception is no set) hangs at the same place each time. The function I started stepping was in one module and the hang was in another (not sure if this is significant).

Ctrl+C returns to the prompt (no other output) and a further :step at that point causes a "not at breakpoint".

I wonder if the flag is causing something to be evaluated a second time (I understand that can cause :step to hang).

Erik first noticed the problem in Leksah, but I can reproduce it in GHCi without using Leksah to control it.

I'll try to get a minimal test case together.

Change History (8)

comment:1 Changed 10 years ago by igloo

difficulty: Unknown
Milestone: 6.14 branch

A minimal test case would be great, thanks.

comment:2 Changed 10 years ago by igloo

Milestone: 6.14 branch6.14.1

comment:3 Changed 9 years ago by igloo


comment:4 Changed 9 years ago by igloo


comment:5 Changed 9 years ago by simonmar

Resolution: worksforme
Status: newclosed
Type of failure: None/Unknown

No test case for this 2-year old bug.

comment:6 Changed 5 years ago by gelisam

Cc: hvr added
Resolution: worksforme
Status: closednew

I have encountered this very old bug with GHC, here's a minimal test case:

mapLookup :: () -> ()
mapLookup = go
    go () = ()

withDummyLookup :: IO a -> IO a
withDummyLookup body = do
    mapLookup () `seq` return ()

main :: IO ()
main = withDummyLookup (return ())

To reproduce:

$ ghci Example.hs
*Main> :set -fbreak-on-exception
*Main> :steplocal main
Stopped at Example.hs:12:8-34
_result :: IO () = _
[Example.hs:12:8-34] *Main> :steplocal
(hangs forever)

comment:7 Changed 3 years ago by George

this seems to be fixed in 8.2.1-rc1:

ghci -ignore-dot-ghci bug3397.hs
GHCi, version  :? for help
[1 of 1] Compiling Main             ( bug3397.hs, interpreted ) [flags changed]
Ok, modules loaded: Main.
*Main> :set -fbreak-on-exception
*Main> :steplocal main
Stopped in Main.main, bug3397.hs:12:8-34
_result :: IO () = _
[bug3397.hs:12:8-34] [bug3397.hs:12:8-34] *Main> :steplocal
Stopped in Main.main, bug3397.hs:12:25-33
_result :: IO () = _

comment:8 Changed 3 years ago by George

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.