[Haskell-cafe] how to debug stack overflow?

2013-06-22 Thread Johannes Waldmann
What is the recommended method to find the exact reason for a stack overflow (when running a Haskell program compiled with ghc)? When I compile with -prof -auto-all, and run with +RTS -xc, I see a very short call stack, which can't be right. But that's probably because I am calling some library

Re: [Haskell-cafe] how to debug stack overflow?

2013-06-22 Thread Aleksey Uymanov
On Sat, 22 Jun 2013 11:04:21 + (UTC) Johannes Waldmann waldm...@imn.htwk-leipzig.de wrote: What is the recommended method Try to use heap profiling. There is very high probability that the problem is because of space leak. -- Aleksey Uymanov s9gf4...@gmail.com

Re: [Haskell-cafe] how to debug stack overflow?

2013-06-22 Thread Johannes Waldmann
Aleksey Uymanov s9gf4ult at gmail.com writes: Try to use heap profiling. There is very high probability that the problem is because of space leak. Really? Would it help in the standard example: main = print $ foldr (+) 0 [1 .. 1::Int] this leaks space (that is, cannot run in small

RE: [Haskell-cafe] How to debug GHC

2005-09-19 Thread Simon Marlow
On 19 September 2005 03:57, Frederik Eaton wrote: It could be a bug - can you reduce the example and report it? GHC's profiler tries to overlay a lexical call graph on to the dynamic execution of the program. It does this more or less in the way you described before: every function gets an

Re: [Haskell-cafe] How to debug GHC

2005-09-19 Thread Frederik Eaton
On Mon, Sep 19, 2005 at 02:22:10PM +0100, Glynn Clements wrote: Frederik Eaton wrote: In addition to the stack trace problems, I found: (1) a problem where output freezes when it is being piped through 'tee' and the user presses ^S and then ^Q That's the terminal driver; use stty

Re: [Haskell-cafe] How to debug GHC

2005-09-18 Thread Frederik Eaton
It could be a bug - can you reduce the example and report it? GHC's profiler tries to overlay a lexical call graph on to the dynamic execution of the program. It does this more or less in the way you described before: every function gets an extra argument describing the call context.

RE: [Haskell-cafe] How to debug GHC

2005-09-14 Thread Simon Marlow
On 10 September 2005 21:15, Frederik Eaton wrote: On Fri, Sep 02, 2005 at 04:40:05PM +0400, Bulat Ziganshin wrote: Hello Nils, Friday, September 02, 2005, 10:47:05 AM, you wrote: Compile your program with -prof -auto-all (make sure you have the I tried this out under GHC

Re: [Haskell-cafe] How to debug GHC

2005-09-14 Thread Frederik Eaton
On Wed, Sep 14, 2005 at 02:44:11PM +0100, Simon Marlow wrote: On 10 September 2005 21:15, Frederik Eaton wrote: On Fri, Sep 02, 2005 at 04:40:05PM +0400, Bulat Ziganshin wrote: Hello Nils, Friday, September 02, 2005, 10:47:05 AM, you wrote: Compile your program with -prof

Re: [Haskell-cafe] How to debug GHC

2005-09-05 Thread Malcolm Wallace
Isaac Jones [EMAIL PROTECTED] writes: 1. Hat requires users to restrict themselves to a certain small subset of the standard libraries, and to use hmake Also the issue of how libraries are distributed in Haskell is a little bit in flux at the moment, since

[Haskell-cafe] hat support in Cabal (was: How to debug GHC)

2005-09-05 Thread Isaac Jones
Malcolm Wallace [EMAIL PROTECTED] writes: Isaac Jones [EMAIL PROTECTED] writes: 1. Hat requires users to restrict themselves to a certain small subset of the standard libraries, and to use hmake Also the issue of how libraries are distributed in Haskell

Re: [Haskell-cafe] How to debug GHC

2005-09-05 Thread Bernard Pope
On Mon, 2005-09-05 at 11:12 +0100, Malcolm Wallace wrote: Why is this a Cabal issue? Are you interested in adding Buddah support to Cabal? I think what Bernie is referring to is that ghc-pkg-6.4 uses an input file format very similar to Cabal's file format, for registering a new

Re: [Haskell-cafe] How to debug GHC

2005-09-03 Thread Isaac Jones
Bernard Pope [EMAIL PROTECTED] writes: On Thu, 2005-09-01 at 14:48 -0700, Frederik Eaton wrote: (snip) Are the following correct? 1. Hat requires users to restrict themselves to a certain small subset of the standard libraries, and to use hmake Depends what you mean by standard libraries.

Re: [Haskell-cafe] How to debug GHC

2005-09-02 Thread Bernard Pope
On Thu, 2005-09-01 at 14:48 -0700, Frederik Eaton wrote: Is it that backtraces are difficult, or just require a lot of overhead? It doesn't seem very hard to me, at least in principle. Add a stack trace argument to every function. Every time a function is called, the source location of the

Re: [Haskell-cafe] How to debug GHC

2005-09-02 Thread Nils Anders Danielsson
On Thu, 01 Sep 2005, Frederik Eaton [EMAIL PROTECTED] wrote: But getting a stack backtrace when there is an error should be a pretty basic feature. It's very hard to debug a large program when you can randomly get messages like *** Exception: Prelude.head: empty list and have no idea where

Re: [Haskell-cafe] How to debug GHC

2005-09-02 Thread Ben Lippmeier
... It's very hard to debug a large program when you can randomly get messages like *** Exception: Prelude.head: empty list and have no idea where they came from. As a purely pragmatic suggestion: don't use head, fromJust, last, or any other function that is likely to fail in

Re: [Haskell-cafe] How to debug GHC

2005-09-02 Thread David Roundy
On Fri, Sep 02, 2005 at 05:10:35PM +1000, Ben Lippmeier wrote: ... It's very hard to debug a large program when you can randomly get messages like *** Exception: Prelude.head: empty list and have no idea where they came from. As a purely pragmatic suggestion: don't use head, fromJust,

Re: [Haskell-cafe] How to debug GHC

2005-09-02 Thread Frederik Eaton
Just more or less as an aside, at its origin in April (!) this thread didn't mention any debugger - the question was just how to build ghc so that a stack trace would come out. A real debugger is no replacement for that (because you have to be on hand and know how to repeat the problem to

Re: [Haskell-cafe] How to debug GHC

2005-09-01 Thread Frederik Eaton
On Wed, Apr 27, 2005 at 05:15:30PM +1000, Bernard Pope wrote: On Wed, 2005-04-27 at 07:45 +0200, Ketil Malde wrote: [I want to know] who called who all the way from main to head, because the key function is going to be one somewhere in the middle. Perhaps. I am told stack backtraces

Re: [Haskell-cafe] How to debug GHC

2005-04-27 Thread Bernard Pope
On Wed, 2005-04-27 at 07:45 +0200, Ketil Malde wrote: [I want to know] who called who all the way from main to head, because the key function is going to be one somewhere in the middle. Perhaps. I am told stack backtraces are difficult with non-strict semantics. This is true, at least

[Haskell-cafe] How to debug GHC

2005-04-26 Thread Monique Louise
Hi, all, I'm developing a back end for GHC and I have the following problem: my program is throwing an empty list exception due to head [] and I need to compile GHC with -prof -auto-all in order to see the stack trace when running it with +RTS -xc -RTS. I changed the makefile but the option

Re: [Haskell-cafe] How to debug GHC

2005-04-26 Thread Donn Cave
On Tue, 26 Apr 2005, Ketil Malde wrote: Claus Reinke [EMAIL PROTECTED] writes: no direct answer to your question, but a general comment on the original problem (speaking from bad experience;-): things like head have no place in a Haskell program of any non-trivial size, because of their

Re: [Haskell-cafe] How to debug GHC

2005-04-26 Thread Monique Louise
Thanks, Ketil, your suggestion really helped me ! Thanks to Claus for the tips ! On 4/26/05, Ketil Malde [EMAIL PROTECTED] wrote: Claus Reinke [EMAIL PROTECTED] writes: no direct answer to your question, but a general comment on the original problem (speaking from bad experience;-):

Re: [Haskell-cafe] How to debug GHC

2005-04-26 Thread Ketil Malde
Donn Cave [EMAIL PROTECTED] writes: Ideally, I think something like this should be the default behavior for these functions. But something like this should happen for any function, shouldn't it? Any function where pattern match could fail, yes. (Or should that be any partial function?)

[Haskell-cafe] How to debug GHC

2005-04-25 Thread Monique Louise de Barros Monteiro
Hi, all, I'm developing a back end for GHC and I have the following problem: my program is throwing an empty list exception due to head [] and I need to compile GHC with -prof -auto-all in order to see the stack trace when running it with +RTS -xc -RTS. I changed the makefile but the option +RTS

Re: how to debug?

2002-10-07 Thread David Roundy
On Sun, Oct 06, 2002 at 12:16:50PM +0100, Jon Fairbairn wrote: I have already isolated my bug within one function, but that function has somewhat funky recursion, and uses an array (which I'm none too familiar with in haskell), and there aren't any smaller parts that I can see to test.

Re: how to debug?

2002-10-06 Thread D . Wakeling
David Roundy [EMAIL PROTECTED] writes: How does one debug in haskell? I have a function that I could swear should behave differently than it does, and after tracking down bugs for many hours, I'm wondering if there's any way to step through the evaluation of a haskell function? The best

Re: how to debug?

2002-10-06 Thread Jon Fairbairn
On 2002-10-05 at 18:41EDT David Roundy wrote: How does one debug in haskell? One doesn't. One writes correct code in Haskell ;-b I have already isolated my bug within one function, but that function has somewhat funky recursion, and uses an array (which I'm none too familiar with in haskell

Re: how to debug?

2002-10-06 Thread Zdenek Dvorak
Hello, How does one debug in haskell? I have a function that I could swear should behave differently than it does, and after tracking down bugs for many hours, I'm wondering if there's any way to step through the evaluation of a haskell function? The other way I would be debugging

Re: how to debug?

2002-10-06 Thread Remi Turk
On Sun, Oct 06, 2002 at 07:57:18PM +, Zdenek Dvorak wrote: Hello, How does one debug in haskell? I have a function that I could swear should behave differently than it does, and after tracking down bugs for many hours, I'm wondering if there's any way to step through the evaluation

how to debug?

2002-10-05 Thread David Roundy
How does one debug in haskell? I have a function that I could swear should behave differently than it does, and after tracking down bugs for many hours, I'm wondering if there's any way to step through the evaluation of a haskell function? The other way I would be debugging in an imperative

Re: how to debug?

2002-10-05 Thread Nick Name
On Sat, 5 Oct 2002 18:41:06 -0400 David Roundy [EMAIL PROTECTED] wrote: How does one debug in haskell? http://www.haskell.org/libraries/#tracing Vincenzo ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell