Ticket #1531 (closed bug: fixed)

Opened 6 years ago

Last modified 19 months ago

_result can get bound to the wrong value in a breakpoint

Reported by: mnislaih Owned by:
Priority: low Milestone: _|_
Component: GHCi Version: 6.7
Keywords: Cc: phercek@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: result001 Blocked By:
Blocking: Related Tickets:

Description

Using test result001 in the example below. :list shows that the tick is wrapping map id xs (it is not appreciated here, but the said subexpression is highlighted in ghci).

However _result seems to be bound to the value of f xs

*Main> :b 1 20
Breakpoint 1 activated at result001.hs:1:12-20
*Main> f "abc"
Stopped at result001.hs:1:12-20
_result :: Bool
xs :: [a]
... [result001.hs:1:12-20] *Main> :list
1  f xs = case map id xs of
2           [] -> True
... [result001.hs:1:12-20] *Main> :fo _result
*** Ignoring breakpoint
_result = False

Change History

Changed 6 years ago by mnislaih

  • version changed from 6.6.1 to 6.7

Changed 6 years ago by simonmar

  • owner simonmarhaskell@… deleted

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to _|_

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by phercek

  • cc phercek@… added

I think I hit the same problem (ghci 6.10.1).

Ok, modules loaded: Main.
*Main> :! cat b.hs
fn :: Int -> Int
fn x =
  if x > 10
    then 10
    else x
*Main> :break 3
Breakpoint 0 activated at b.hs:3:5-10
*Main> fn 5
Stopped at b.hs:3:5-10
_result :: Int = _
x :: Int = 5
2  fn x =
3    if x > 10
4      then 10
[b.hs:3:5-10] *Main> :force _result
*** Ignoring breakpoint
_result = 5
[b.hs:3:5-10] *Main> 

_result should have been False and not 5.
_result does not correspond to the selected expression (x > 10).

Changed 19 months ago by marlowsd@…

commit 7bb0447df9a783c222c2a077e35e5013c7c68d91

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Thu Oct 27 13:47:27 2011 +0100

    Overhaul of infrastructure for profiling, coverage (HPC) and breakpoints
    
    User visible changes
    ====================
    
    Profilng
    --------
    
    Flags renamed (the old ones are still accepted for now):
    
      OLD            NEW
      ---------      ------------
      -auto-all      -fprof-auto
      -auto          -fprof-exported
      -caf-all       -fprof-cafs
    
    New flags:
    
      -fprof-auto              Annotates all bindings (not just top-level
                               ones) with SCCs
    
      -fprof-top               Annotates just top-level bindings with SCCs
    
      -fprof-exported          Annotates just exported bindings with SCCs
    
      -fprof-no-count-entries  Do not maintain entry counts when profiling
                               (can make profiled code go faster; useful with
                               heap profiling where entry counts are not used)
    
    Cost-centre stacks have a new semantics, which should in most cases
    result in more useful and intuitive profiles.  If you find this not to
    be the case, please let me know.  This is the area where I have been
    experimenting most, and the current solution is probably not the
    final version, however it does address all the outstanding bugs and
    seems to be better than GHC 7.2.
    
    Stack traces
    ------------
    
    +RTS -xc now gives more information.  If the exception originates from
    a CAF (as is common, because GHC tends to lift exceptions out to the
    top-level), then the RTS walks up the stack and reports the stack in
    the enclosing update frame(s).
    
    Result: +RTS -xc is much more useful now - but you still have to
    compile for profiling to get it.  I've played around a little with
    adding 'head []' to GHC itself, and +RTS -xc does pinpoint the problem
    quite accurately.
    
    I plan to add more facilities for stack tracing (e.g. in GHCi) in the
    future.
    
    Coverage (HPC)
    --------------
    
     * derived instances are now coloured yellow if they weren't used
     * likewise record field names
     * entry counts are more accurate (hpc --fun-entry-count)
     * tab width is now correct (markup was previously off in source with
       tabs)
    
    Internal changes
    ================
    
    In Core, the Note constructor has been replaced by
    
            Tick (Tickish b) (Expr b)
    
    which is used to represent all the kinds of source annotation we
    support: profiling SCCs, HPC ticks, and GHCi breakpoints.
    
    Depending on the properties of the Tickish, different transformations
    apply to Tick.  See CoreUtils.mkTick for details.
    
    Tickets
    =======
    
    This commit closes the following tickets, test cases to follow:
    
      - Close #2552: not a bug, but the behaviour is now more intuitive
        (test is T2552)
    
      - Close #680 (test is T680)
    
      - Close #1531 (test is result001)
    
      - Close #949 (test is T949)
    
      - Close #2466: test case has bitrotted (doesn't compile against current
        version of vector-space package)

 compiler/basicTypes/Id.lhs           |   17 +-
 compiler/basicTypes/MkId.lhs         |   28 +-
 compiler/basicTypes/Name.lhs         |   20 +-
 compiler/cmm/CmmParse.y              |    1 -
 compiler/codeGen/CgCallConv.hs       |   15 +-
 compiler/codeGen/CgClosure.lhs       |   31 +-
 compiler/codeGen/CgCon.lhs           |    6 +-
 compiler/codeGen/CgExpr.lhs          |    2 +-
 compiler/codeGen/CgHeapery.lhs       |    8 +-
 compiler/codeGen/CgProf.hs           |  195 +-----
 compiler/codeGen/StgCmmBind.hs       |   23 +-
 compiler/codeGen/StgCmmCon.hs        |    4 +-
 compiler/codeGen/StgCmmExpr.hs       |    2 +-
 compiler/codeGen/StgCmmHeap.hs       |    5 -
 compiler/codeGen/StgCmmProf.hs       |  177 +-----
 compiler/coreSyn/CoreArity.lhs       |   20 +-
 compiler/coreSyn/CoreFVs.lhs         |   14 +-
 compiler/coreSyn/CoreLint.lhs        |    8 +-
 compiler/coreSyn/CorePrep.lhs        |   56 +-
 compiler/coreSyn/CoreSubst.lhs       |   35 +-
 compiler/coreSyn/CoreSyn.lhs         |  123 +++-
 compiler/coreSyn/CoreTidy.lhs        |    9 +-
 compiler/coreSyn/CoreUnfold.lhs      |    6 +-
 compiler/coreSyn/CoreUtils.lhs       |  187 ++++--
 compiler/coreSyn/ExternalCore.lhs    |    2 +-
 compiler/coreSyn/MkExternalCore.lhs  |    3 +-
 compiler/coreSyn/PprCore.lhs         |   35 +-
 compiler/coreSyn/PprExternalCore.lhs |    2 +-
 compiler/coreSyn/TrieMap.lhs         |   25 +-
 compiler/deSugar/Coverage.lhs        |  556 +++++++++++------
 compiler/deSugar/Desugar.lhs         |   35 +-
 compiler/deSugar/DsArrows.lhs        |    5 +-
 compiler/deSugar/DsBinds.lhs         |  146 ++---
 compiler/deSugar/DsExpr.lhs          |   13 +-
 compiler/deSugar/DsGRHSs.lhs         |   11 +-
 compiler/deSugar/DsUtils.lhs         |   71 +--
 compiler/deSugar/Match.lhs           |    2 +-
 compiler/ghci/ByteCodeGen.lhs        |  127 ++---
 compiler/hsSyn/Convert.lhs           |    3 +-
 compiler/hsSyn/HsBinds.lhs           |   15 +-
 compiler/hsSyn/HsExpr.lhs            |   14 +-
 compiler/iface/BinIface.hs           |   64 +--
 compiler/iface/IfaceEnv.lhs          |   18 -
 compiler/iface/IfaceSyn.lhs          |   33 +-
 compiler/iface/MkIface.lhs           |   12 +-
 compiler/iface/TcIface.lhs           |   15 +-
 compiler/main/DynFlags.hs            |   54 +-
 compiler/main/HscMain.hs             |   17 +-
 compiler/main/TidyPgm.lhs            |    5 +-
 compiler/parser/Parser.y.pp          |    2 +-
 compiler/parser/RdrHsSyn.lhs         |    3 +-
 compiler/profiling/CostCentre.lhs    |  407 ++++--------
 compiler/profiling/SCCfinal.lhs      |  285 ++------
 compiler/simplCore/CSE.lhs           |    2 +-
 compiler/simplCore/FloatIn.lhs       |   11 +-
 compiler/simplCore/FloatOut.lhs      |   25 +-
 compiler/simplCore/LiberateCase.lhs  |    2 +-
 compiler/simplCore/OccurAnal.lhs     |   28 +-
 compiler/simplCore/SAT.lhs           |    4 +-
 compiler/simplCore/SetLevels.lhs     |   10 +-
 compiler/simplCore/SimplCore.lhs     |    2 +-
 compiler/simplCore/SimplEnv.lhs      |   33 +-
 compiler/simplCore/SimplUtils.lhs    |   21 +-
 compiler/simplCore/Simplify.lhs      |  122 +++-
 compiler/simplStg/SRT.lhs            |    2 +-
 compiler/simplStg/StgStats.lhs       |    2 +-
 compiler/specialise/Rules.lhs        |   19 +-
 compiler/specialise/SpecConstr.lhs   |   14 +-
 compiler/specialise/Specialise.lhs   |   16 +-
 compiler/stgSyn/CoreToStg.lhs        |   27 +-
 compiler/stgSyn/StgLint.lhs          |    2 +-
 compiler/stgSyn/StgSyn.lhs           |   13 +-
 compiler/stranal/DmdAnal.lhs         |    4 +-
 compiler/stranal/WorkWrap.lhs        |    6 +-
 compiler/stranal/WwLib.lhs           |   14 +-
 compiler/typecheck/TcBinds.lhs       |    3 +-
 compiler/vectorise/Vectorise/Exp.hs  |   15 +-
 compiler/vectorise/Vectorise/Vect.hs |    6 +-
 docs/users_guide/flags.xml           |   47 +-
 docs/users_guide/profiling.xml       |  560 +++++++++-------
 docs/users_guide/runtime_control.xml |   56 ++-
 includes/rts/prof/CCS.h              |  190 +++---
 includes/stg/MiscClosures.h          |    1 +
 rts/Apply.cmm                        |   25 +-
 rts/AutoApply.h                      |   11 +
 rts/Exception.cmm                    |    4 +-
 rts/PrimOps.cmm                      |    4 +
 rts/ProfHeap.c                       |    4 +-
 rts/Profiling.c                      | 1200 ++++++++++++++++++----------------
 rts/Profiling.h                      |    3 +-
 rts/Proftimer.c                      |    2 +
 rts/RaiseAsync.c                     |    2 +-
 rts/RtsFlags.c                       |    7 +-
 rts/StgMiscClosures.cmm              |   16 +-
 rts/Updates.cmm                      |    2 +-
 rts/sm/Storage.c                     |    6 +-
 utils/genapply/GenApply.hs           |   65 ++-
 97 files changed, 2750 insertions(+), 2830 deletions(-)

Changed 19 months ago by simonmar

  • status changed from new to closed
  • failure set to None/Unknown
  • resolution set to fixed
Note: See TracTickets for help on using tickets.