Re: [Haskell-cafe] Diagnosing stack overflow

2007-08-20 Thread Justin Bailey
On 8/18/07, Matthew Brecknell [EMAIL PROTECTED] wrote: Justin Bailey: Would retainer profiling help me see what was building up this large thunk/closure? I'm not really familiar enough with GHC's profiling to answer that, but I'll take a guess. You're experimental programs have given me

Re: [Haskell-cafe] Diagnosing stack overflow

2007-08-18 Thread Matthew Brecknell
Justin Bailey: Would retainer profiling help me see what was building up this large thunk/closure? I'm not really familiar enough with GHC's profiling to answer that, but I'll take a guess. My guess is that profiling will only sometimes be useful in diagnosing stack overflows, because I

Re: [Haskell-cafe] Diagnosing stack overflow

2007-08-17 Thread Justin Bailey
On 8/16/07, Matthew Brecknell [EMAIL PROTECTED] wrote: However, it's possible that your use of this function is forcing evaluation of a deeply-nested thunk you've created somewhere else (as print does in the foldl example). Thank you for the detailed and helpful reply. I was led to this

[Haskell-cafe] Diagnosing stack overflow

2007-08-16 Thread Justin Bailey
I am trying to determine why my stack overflows in my medium sized program (it has several modules but maybe only 1000 LOC total). On Windows, at least, the ghcprof visualization tool doesn't work. Any suggestions besides an output trace? It may be the function below, which tries to determine if

Re: [Haskell-cafe] Diagnosing stack overflow

2007-08-16 Thread Matthew Brecknell
Justin Bailey: I am trying to determine why my stack overflows in my medium sized program [...snip...] prefixesAtLeast :: Int - [S.ByteString] - Int prefixesAtLeast !0 !ss | null ss = 0 | all S.null ss = 0 | otherwise = -1 prefixesAtLeast !n !ss = prefixesAtLeast' n ss where

Re: [Haskell-cafe] Diagnosing stack overflow

2007-08-16 Thread Bryan O'Sullivan
Justin Bailey wrote: I am trying to determine why my stack overflows in my medium sized program (it has several modules but maybe only 1000 LOC total). On Windows, at least, the ghcprof visualization tool doesn't work. Any suggestions besides an output trace? You shouldn't need ghcprof. Just