#680: SCC mis-accounting
-----------------------------------+----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Profiling | Version: 6.4.1
Severity: normal | Keywords:
Os: Unknown | Difficulty: Unknown
Architecture: Unknown |
-----------------------------------+----------------------------------------
The profiles sometimes charges to the wrong account. In this example:
{{{
foo :: (() -> () -> [()] -> [()]) -> () -> [()] -> [()]
foo k =
\_ xs -> concatMap ($ [head xs]) [bar]
where
bar =
let k' = k undefined undefined
in \xs ->
let k'' = [k' xs]
in (() : (foldr1 (>>) k''))
k = foo (\_ -> k)
--k a = foo (\_ -> k) a
r = k undefined [] !! 4000
main = print r
}}}
almost all of the time, allocations, and heap retention are charged
to k. However, if you use the commented definition of k, the changes
switch to foo, as expected. This can be tested by running
{{{
ghc --make -prof -auto-all Logic.hs && ./a.out +RTS -hc && hp2ps -c
a.out.hp
}}}
and watching the pretty graph change.
This is using ghc 6.4.1 from Debian unstable. More background at
http://haskell.org/pipermail/haskell-cafe/2006-February/014139.html
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/680>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs