Opened 8 years ago

Closed 7 months 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:

Description

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 8 years ago by igloo

difficulty: Unknown
Milestone: 6.14 branch

A minimal test case would be great, thanks.

comment:2 Changed 8 years ago by igloo

Milestone: 6.14 branch6.14.1

comment:3 Changed 7 years ago by igloo

Milestone: 7.0.17.0.2

comment:4 Changed 7 years ago by igloo

Milestone: 7.0.27.2.1

comment:5 Changed 7 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 3 years ago by gelisam

Cc: hvr added
Resolution: worksforme
Status: closednew
Version: 6.10.37.10.1-rc2

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

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

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

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 7 months ago by George

this seems to be fixed in 8.2.1-rc1:

ghci -ignore-dot-ghci bug3397.hs
GHCi, version 8.2.0.20170404: http://www.haskell.org/ghc/  :? 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 7 months ago by George

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