[Haskell-cafe] Debugging ByteString and Data.Binary.Get memory usage

2013-08-29 Thread Kyle Hanson
help me understand this. I have read some posts about Temporary ByteStrings causing memory issues but I don't know how to get started debugging. -- Kyle Hanson ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] Debugging ByteString and Data.Binary.Get memory usage

2013-08-29 Thread Johan Tibell
stable (90mb). I am hoping someone can help me understand this. I have read some posts about Temporary ByteStrings causing memory issues but I don't know how to get started debugging. -- Kyle Hanson ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Debugging ByteString and Data.Binary.Get memory usage

2013-08-29 Thread Bob Ippolito
(90mb). I am hoping someone can help me understand this. I have read some posts about Temporary ByteStrings causing memory issues but I don't know how to get started debugging. -- Kyle Hanson ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Debugging ByteString and Data.Binary.Get memory usage

2013-08-29 Thread Kyle Hanson
BS keeps the memory usage stable (90mb). I am hoping someone can help me understand this. I have read some posts about Temporary ByteStrings causing memory issues but I don't know how to get started debugging. -- Kyle Hanson ___ Haskell-Cafe

Re: [Haskell-cafe] Debugging ByteString and Data.Binary.Get memory usage

2013-08-29 Thread Bob Ippolito
me understand this. I have read some posts about Temporary ByteStrings causing memory issues but I don't know how to get started debugging. -- Kyle Hanson ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] Debugging embedded ruby interpreter

2013-05-23 Thread Simon Marechal
On 05/22/2013 11:36 PM, Simon Marechal wrote: Anyone has an idea on how I should approach this problem ? For future reference : I believe I have found the problem, and it was quite obvious ... When generating Ruby objects from Haskell, they are not referenced by anything in the interpreter.

[Haskell-cafe] Debugging embedded ruby interpreter

2013-05-22 Thread Simon Marechal
Hello, I am trying to embed a ruby interpreter into my Haskell library. It didn't seem complicated, and went flawlessly until I tried using it a lot. Then I got segfaults. Here is a test program that corrupts the Array object that is being created :

Re: [Haskell-cafe] debugging memory corruption

2012-12-02 Thread Evan Laforge
that consistent. Or can you? 3. Upload to Hackage. Is the suggestion that people who love debugging hard problems will swarm out of the woodwork and help me find the problem? I should be so lucky :) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

[Haskell-cafe] debugging memory corruption

2012-12-01 Thread Evan Laforge
Ever since upgrading to 7.6.1 I regularly get panics like this: seq: internal error: evacuate: strange closure type -1958168540 (GHC version 7.6.1 for x86_64_apple_darwin) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug I've seen some variations, but basically I

Re: [Haskell-cafe] debugging memory corruption

2012-12-01 Thread Alexander Kjeldaas
What I've mostly done in similar circumstances (jni) 1. Create an interface (virtual functions or template) for the FFI in C++ that covers everything you use. Then create one test implementation and one real implementation. The test implementation must allocate resources whenever the real FFI

[Haskell-cafe] Is there a GHC flag that will allow mutable top level state while you are debugging and then ...

2012-07-05 Thread KC
you can turn the flag off when you are ready to do the computational heavy lifting so that you don't have to modify your code base? That is, GHC can then apply its algebraic transformation optimizations to the code algebra of the pure functions. -- -- Regards, KC

Re: [Haskell-cafe] Is there a GHC flag that will allow mutable top level state while you are debugging and then ...

2012-07-05 Thread Francesco Mazzoli
- that is, that values don't change. An Haskell compiler will rely on this assumption quite heavily, so changes to that are likely to disrupt things seriously. Also, I don't see how destructive updates help debugging. -- Francesco * Often in error, never in doubt

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-26 Thread Yves Parès
One day, I _really_ should learn all GHCI commands... Thanks, Felipe ^^ 2012/1/25 Felipe Almeida Lessa felipe.le...@gmail.com On Wed, Jan 25, 2012 at 7:38 PM, Yves Parès yves.pa...@gmail.com wrote: But I haven't found a way to tell GHCI to fully evaluate 'x' but _not_ print its value.

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-25 Thread Eugene Kirpichov
Thanks! I released it: http://hackage.haskell.org/package/htrace http://github.com/jkff/htrace On Wed, Jan 25, 2012 at 4:18 AM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: Really nice! Looks like it could be a useful mini-package on Hackage. -- Felipe. -- Eugene Kirpichov

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-25 Thread Claus Reinke
Look how one can watch the evaluation tree of a computation, to debug laziness-related problems. You might like the old Hood/GHood: http://hackage.haskell.org/package/hood http://hackage.haskell.org/package/GHood Background info/papers: http://www.ittc.ku.edu/csdl/fpg/Tools/Hood

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-25 Thread Yves Parès
Hi, nice little package! I just made a fork and added a new function makeHTrace to be able to have separate variables 'level'. I also add the htrace type signature (or else haddock won't generate documentation for this module): https://github.com/YwenP/htrace I was also investigating in a way to

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-25 Thread Felipe Almeida Lessa
On Wed, Jan 25, 2012 at 7:38 PM, Yves Parès yves.pa...@gmail.com wrote: But I haven't found a way to tell GHCI to fully evaluate 'x' but _not_ print its value. Use the :force, Yves! let {a = htrace a 12; b = htrace b 29; c = htrace c 10; d = htrace d 90; x = htrace , (htrace + (a+b), htrace

[Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-24 Thread Eugene Kirpichov
Hi cafe, Look how one can watch the evaluation tree of a computation, to debug laziness-related problems. {-# LANGUAGE BangPatterns #-} module HTrace where import Data.List (foldl') import Data.IORef import System.IO.Unsafe level = unsafePerformIO $ newIORef 0 htrace str x = unsafePerformIO $

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-24 Thread HASHIMOTO, Yusaku
Great, It illustrates why difference lists are awesome. import HTrace app :: [a] - [a] - [a] app [] ys = htrace app ys app (x:xs) ys = htrace app (x:app xs ys) rev1 [] = htrace [] [] rev1 (x:xs) = htrace rev1 (app (rev1 xs) [x]) rev2 []     ys = htrace ys ys rev2 (x:xs) ys = htrace : (rev2 xs

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-24 Thread Felipe Almeida Lessa
Really nice! Looks like it could be a useful mini-package on Hackage. -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] debugging snap app

2012-01-10 Thread Eric Wong
Hi, I'm trying to get the debugging messages in snap-server in order to find the socket leaking in my snap app. I find the doc on snapframework.com says that setting an environment variable DEBUG=1 will enable the app to output the messages in stderr. But I don't get any. I installed the snap

Re: [Haskell-cafe] Program used for debugging

2011-12-02 Thread Rustom Mody
On Thu, Dec 1, 2011 at 7:40 PM, Yves Parès limestr...@gmail.com wrote: Hey, What do you mostly use for debugging? Simple calls to Debug.Trace.trace? Hpc? Hood? I also wonder about 'type-debugging' Using ghci: For a top level expression: - if it is not compiling I can put in (or remove

Re: [Haskell-cafe] Program used for debugging

2011-12-02 Thread Yves Parès
. 2011/12/2 Rustom Mody rustom.m...@parsci.com On Thu, Dec 1, 2011 at 7:40 PM, Yves Parès limestr...@gmail.com wrote: Hey, What do you mostly use for debugging? Simple calls to Debug.Trace.trace? Hpc? Hood? I also wonder about 'type-debugging' Using ghci: For a top level expression

[Haskell-cafe] Program used for debugging

2011-12-01 Thread Yves Parès
Hey, What do you mostly use for debugging? Simple calls to Debug.Trace.trace? Hpc? Hood? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Program used for debugging

2011-12-01 Thread Ivan Lazar Miljenovic
On 2 December 2011 01:10, Yves Parès limestr...@gmail.com wrote: Hey, What do you mostly use for debugging? Simple calls to Debug.Trace.trace? Hpc? Hood? trace and ghci. -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com

Re: [Haskell-cafe] Program used for debugging

2011-12-01 Thread Andrew Butterfield
On 1 Dec 2011, at 14:10, Yves Parès wrote: Hey, What do you mostly use for debugging? Simple calls to Debug.Trace.trace? Hpc? Hood? Debug.Trace, with some short helpers so dbg x= x displays the value of x, provided x is in Show import Debug.Trace dbg msg x = dbgsh show msg x dbgsh

[Haskell-cafe] Debugging with gdb?

2011-04-13 Thread Svante Signell
Hi, As I don't know anything about Haskell, can I make a stupid question: Is there any method to create debug symbols for a Haskell program, and is it possible to debug with gdb? Thanks! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Debugging with gdb?

2011-04-13 Thread Tim Chevalier
of debuggers that are more tailored to the process of debugging a functional program. Cheers, Tim -- Tim Chevalier * http://cs.pdx.edu/~tjc/ * Often in error, never in doubt an intelligent person fights for lost causes,realizing that others are merely effects -- E.E. Cummings

Re: [Haskell-cafe] Debugging with gdb?

2011-04-13 Thread Max Bolingbroke
that are possible: 1. You may use the -debug flag to GHC to link with the debug RTS, which has full debugging information for GDB. Note that this only lets you debug the *RTS*, not any of the code you wrote 2. Use GDB to debug your Haskell code without giving it any symbols or understanding

Re: [Haskell-cafe] Debugging with gdb?

2011-04-13 Thread Svante Signell
debug symbols for a Haskell program, and is it possible to debug with gdb? You cannot create debug symbols. Things that are possible: 1. You may use the -debug flag to GHC to link with the debug RTS, which has full debugging information for GDB. Note that this only lets you debug the *RTS

Re: [Haskell-cafe] Debugging with gdb?

2011-04-13 Thread Edward Z. Yang
Hello Svante, I have a few recommendations, places where I'd check: 1. Consult the arguments passed to read() usign GDB (your libc has debugging symbols) and see if they are obviously wrong. It seems more plausible that they are something that would be right for Linux, but not so right

Re: [Haskell-cafe] Improving HList programming/debugging (longish)

2011-01-12 Thread Wolfgang Jeltsch
to not be implementable with associated type synonyms. It also makes higher-order HList programming/debugging much more tractable. Hi, a few years ago, I also experienced with using GADTs for representing heterogenous lists. However, I dropped this idea, since GADTs force you to provide type

[Haskell-cafe] Improving HList programming/debugging (longish)

2011-01-11 Thread jeff p
. It also makes higher-order HList programming/debugging much more tractable. Programming with HLists, at least in our experience, encourages GHC to produce long and inscrutable type errors. This confusing behaviour is caused by the open nature of type classes-- GHC (as per the Haskell specification

Re: [Haskell-cafe] global, modifiable variable for debugging

2010-12-27 Thread Gregory Collins
We have some code to do exactly this: https://github.com/snapframework/snap-core/blob/master/src/Snap/Internal/Debug.hs You set a DEBUG environment variable to turn debugging output on. We should probably split this code out into its own package. G On Sun, Dec 26, 2010 at 8:53 PM, bri

[Haskell-cafe] global, modifiable variable for debugging

2010-12-26 Thread briand
Hi, I have a program with a debug flag in it (Strangely I've yet to be able to write bug-free code). I'd like to change the state of the debug flag based on command line args. I looked at IOVar but that would cause all the pure procedures to get swallowed by the IO Monad. Is a better way to

Re: [Haskell-cafe] global, modifiable variable for debugging

2010-12-26 Thread Michael Snoyman
I think something like this would work: myFlag = unsafePerformIO $ do [x] - getArgs return $ x == debug In general, unsafePerformIO should be avoided, but this is one of those situations where we can give you a pass ;). Michael On Sun, Dec 26, 2010 at 9:53 PM, bri...@aracnet.com

Re: [Haskell-cafe] global, modifiable variable for debugging

2010-12-26 Thread aditya siram
If you don't want go the unsafePerformIO route you might use implicit parameters [1]. You can add an hidden parameter to a function like: {-# LANGUAGE ImplicitParams #-} func1 :: (?dbg :: Bool) = String - String func1 s = if ?dbg then (func2 (func1 : ++ s)) else s func2 :: (?dbg ::

Re: [Haskell-cafe] global, modifiable variable for debugging

2010-12-26 Thread Daniel Peebles
Seems like you'd want x - getArgs and x == [debug] rather than the irrefutable pattern match. On Sun, Dec 26, 2010 at 3:04 PM, Michael Snoyman mich...@snoyman.comwrote: I think something like this would work: myFlag = unsafePerformIO $ do [x] - getArgs return $ x == debug In

[Haskell-cafe] Re: libefence useful for debugging ghc+ffi programs?

2010-10-20 Thread Johannes Waldmann
That looks a lot like a double free [...] there's definitely something about initializing libcurl: http://curl.haxx.se/libcurl/c/curl_easy_init.html uses nice phrases like may be letal in multi-threading the documentation of Haskell curl

Re: [Haskell-cafe] Re: libefence useful for debugging ghc+ffi programs?

2010-10-20 Thread Edward Z. Yang
Excerpts from Johannes Waldmann's message of Wed Oct 20 05:13:36 -0400 2010: and indeed, gethostbyname is famous for being non re-entrant. If you have the time, this would be a great time to improve the multithreaded support of these libraries. In particular, glibc offers a re-entrant version

[Haskell-cafe] Re: libefence useful for debugging ghc+ffi programs?

2010-10-20 Thread Johannes Waldmann
and indeed, gethostbyname is famous for being non re-entrant. it already has a lock in Network.BSD, so I assume it's fine: {-# NOINLINE lock #-} lock :: MVar () lock = unsafePerformIO $ newMVar () withLock :: IO a - IO a withLock act = withMVar lock (\_ - act) getHostByName :: HostName -

Re: [Haskell-cafe] Re: libefence useful for debugging ghc+ffi programs?

2010-10-20 Thread Edward Z. Yang
Hmm, in that case, one possibility is someone else did an FFI import of gethostbyname and isn't using the same lock. Can you check for that? Edward Excerpts from Johannes Waldmann's message of Wed Oct 20 16:17:06 -0400 2010: and indeed, gethostbyname is famous for being non re-entrant.

[Haskell-cafe] Re: libefence useful for debugging ghc+ffi programs?

2010-10-20 Thread Johannes Waldmann
OK, never mind, I found the problem in my C code. some uninitialized variables - mostly they were 0, but sometimes not: I guess when I got mallocForeignPtrBytes that were just freed by the garbage collector. Although the program does a ton of allocations, most start with memcpy of something

[Haskell-cafe] Re: libefence useful for debugging ghc+ffi programs?

2010-10-19 Thread Johannes Waldmann
some more info on this: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x42773950 (LWP 29449)] 0x7f717c70e370 in free () from /usr/lib/libefence.so.0 (gdb) where #0 0x7f717c70e370 in free () from /usr/lib/libefence.so.0 #1 0x7f717b931ee9 in conn_free ()

Re: [Haskell-cafe] Debugging cause of indefinite thread blocking

2010-07-07 Thread Claus Reinke
for the above error when the only use of parallelism is Repa arrays? If you're sure the issue is in Repa, contact the Repa authors? 2. What are the best strategies for debugging he cause(s) of such an error? If it is in your code, you could try replacing the Control.Concurrent operations

[Haskell-cafe] Debugging cause of indefinite thread blocking

2010-07-06 Thread Ben Lever
arrays? 2. What are the best strategies for debugging he cause(s) of such an error? Cheers, Ben. The information in this e-mail may be confidential and subject to legal professional privilege and/or copyright. National ICT Australia Limited accepts no liability for any damage caused

[Haskell-cafe] Help debugging code broken after upgrading debian to GHC 6.12: invalid argument

2010-05-15 Thread Brandon Simmons
On May 14, 2010, at 20:24 , Brandon Simmons wrote: The other baffling thing is this: if the debugging line 426 is uncommented, then even running: $ runghc Befunge.hs --quiet mycology.b98 ...will fail. But all we're doing is a call to `putStr`! Why would that trigger an error?! Maybe

Re: [Haskell-cafe] Help debugging code broken after upgrading debian to GHC 6.12: invalid argument

2010-05-15 Thread Daniel Fischer
On Saturday 15 May 2010 15:18:28, Brandon Simmons wrote: On May 14, 2010, at 20:24 , Brandon Simmons wrote: The other baffling thing is this: if the debugging line 426 is uncommented, then even running: $ runghc Befunge.hs --quiet mycology.b98 ...will fail. But all we're doing

[Haskell-cafe] Help debugging code broken after upgrading debian to GHC 6.12: invalid argument

2010-05-15 Thread Brandon Simmons
GHC 6.12's runtime handles input and output encoding, instead of simply truncating Chars; my guess is it's locale-related. And sure enough, I see several non-ASCII characters in mycology.b98 which are likely to do the wrong thing if the runtime doesn't know which character set to use.

Re: [Haskell-cafe] Help debugging code broken after upgrading debian to GHC 6.12: invalid argument

2010-05-14 Thread Brandon S. Allbery KF8NH
On May 14, 2010, at 20:24 , Brandon Simmons wrote: The other baffling thing is this: if the debugging line 426 is uncommented, then even running: $ runghc Befunge.hs --quiet mycology.b98 ...will fail. But all we're doing is a call to `putStr`! Why would that trigger an error?! Maybe

Re: [Haskell-cafe] Help debugging code broken after upgrading debian to GHC 6.12: invalid argument

2010-05-14 Thread Daniel Fischer
On Saturday 15 May 2010 02:53:43, Brandon S. Allbery KF8NH wrote: On May 14, 2010, at 20:24 , Brandon Simmons wrote: The other baffling thing is this: if the debugging line 426 is uncommented, then even running: $ runghc Befunge.hs --quiet mycology.b98 ...will fail. But all we're

Re: [Haskell-cafe] debugging a hanging program: where to start?

2010-05-13 Thread Ketil Malde
Aran Donohue aran.dono...@gmail.com writes: I have a program that I can reliably cause to hang. It's concurrent using STM, so I think it could be a deadlock or related issue. I also do some IO, so I think it could be blocking in a system call. If it's the latter, 'strace' might help you. Use

Re: [Haskell-cafe] debugging a hanging program: where to start?

2010-05-13 Thread Aran Donohue
Thanks folks! Forward progress is made... Unfortunately, programs don't seem to write out their threadscope event logs until they terminate, and mine hangs until I kill it, so I can't get at the event log. Tracing has taught me that before the hang-cause, my program splits its time in

Re: [Haskell-cafe] debugging a hanging program: where to start?

2010-05-13 Thread Jason Dagit
On Thu, May 13, 2010 at 5:53 AM, Aran Donohue aran.dono...@gmail.comwrote: Thanks folks! Forward progress is made... Unfortunately, programs don't seem to write out their threadscope event logs until they terminate, and mine hangs until I kill it, so I can't get at the event log. Tracing

Re: [Haskell-cafe] debugging a hanging program: where to start?

2010-05-13 Thread Aran Donohue
I have an accept-loop: do (conn, _saddr) - accept sock forkIO $ initializeConnection conn Which allocates memory iff accept allocates, I suppose. To test the theory, is there a way I can force an allocation that won't get optimized away? According to the old print-statement debugging

Re: [Haskell-cafe] debugging a hanging program: where to start?

2010-05-13 Thread Daniel Fischer
still very open to debugging tools and techniques I could use to approach the problem! Aran ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] debugging a hanging program: where to start?

2010-05-13 Thread Aran Donohue
to debugging tools and techniques I could use to approach the problem! Aran ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] debugging a hanging program: where to start?

2010-05-12 Thread Aran Donohue
Hi Cafe, I have a program that I can reliably cause to hang. It's concurrent using STM, so I think it could be a deadlock or related issue. I also do some IO, so I think it could be blocking in a system call. It only hangs when compiled with -threaded. I tried building with -prof, and running

Re: [Haskell-cafe] debugging a hanging program: where to start?

2010-05-12 Thread Jason Dagit
On Wed, May 12, 2010 at 8:15 PM, Aran Donohue aran.dono...@gmail.comwrote: Hi Cafe, I have a program that I can reliably cause to hang. It's concurrent using STM, so I think it could be a deadlock or related issue. I also do some IO, so I think it could be blocking in a system call. It only

Re: [Haskell-cafe] some help debugging ghci build on powerpc

2009-11-29 Thread Duncan Coutts
On Sun, 2009-11-22 at 16:22 -0800, Brian Denheyer wrote: I'm trying to build ghc so that ghci will be included under linux power-pc. The build dies here: /tmp/ghc21791_0/ghc21791_0.s: Assembler messages: /tmp/ghc21791_0/ghc21791_0.s:15:0: Error: junk at end of line, first

[Haskell-cafe] some help debugging ghci build on powerpc

2009-11-22 Thread Brian Denheyer
I'm trying to build ghc so that ghci will be included under linux power-pc. The build dies here: ~/ghc6-6.10.4/rts$ /home/briand/ghc6-6.10.4/ghc/stage1-inplace/ghc -optc-O -optc-Wall -optc-W -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline

Re: [Haskell-cafe] Debugging Haskell code

2009-09-29 Thread Justin Bailey
On Sun, Sep 27, 2009 at 12:50 PM, Paul Moore p.f.mo...@gmail.com wrote: The problem is that I have *no idea* how to begin debugging this. In C, Python, or any other imperative language, I'd put traces in, etc. But in Haskell, I don't even know where to start. One of the standard modules

Re: [Haskell-cafe] Debugging Haskell code

2009-09-29 Thread Dougal Stanton
On Sun, Sep 27, 2009 at 9:17 PM, Paul Moore p.f.mo...@gmail.com wrote: That's odd, it seems to be saying it's not installed at all! Hmm, no - I did a cabal install --user (because Vista doesn't let me do site-wide installs), looks like cabal list doesn't pick up user installs. Hmm, cabal

Re: [Haskell-cafe] Debugging Haskell code

2009-09-28 Thread John D. Ramsdell
On Sun, Sep 27, 2009 at 3:50 PM, Paul Moore p.f.mo...@gmail.com wrote: The problem is that I have *no idea* how to begin debugging this. I've had great success debugging a large program by loading the Main module into ghci after setting GHC extensions, changing the search path, and setting

Re: [Haskell-cafe] Debugging Haskell code

2009-09-28 Thread Curt Sampson
On 2009-09-28 22:53 -0400 (Mon), John D. Ramsdell wrote: I've had great success debugging a large program by loading the Main module into ghci after setting GHC extensions, changing the search path, and setting break on errors. If you then place calls to the error function at the right

[Haskell-cafe] Debugging Haskell code

2009-09-27 Thread Paul Moore
not the right way to code, I know, but never mind. The problem is that I have *no idea* how to begin debugging this. In C, Python, or any other imperative language, I'd put traces in, etc. But in Haskell, I don't even know where to start. I attach the code below. While help in the form of pointers

Re: [Haskell-cafe] Debugging Haskell code

2009-09-27 Thread andy morris
(which I didn't understand) went away. Certainly not the right way to code, I know, but never mind. The problem is that I have *no idea* how to begin debugging this. In C, Python, or any other imperative language, I'd put traces in, etc. But in Haskell, I don't even know where to start. I

Re: [Haskell-cafe] Debugging Haskell code

2009-09-27 Thread Paul Moore
2009/9/27 andy morris a...@adradh.org.uk: mersenne-random uses the FFI, so it's probably that. I just ran your code with mersenne-random-1.0 and didn't get a segfault. What version are you using? Not entirely sure, I just did a cabal install a short while back. cabal list mersenne Warning:

Re: [Haskell-cafe] Debugging Haskell code

2009-09-27 Thread Daniel Fischer
Am Sonntag 27 September 2009 22:02:45 schrieb andy morris: mersenne-random uses the FFI, so it's probably that. I just ran your code with mersenne-random-1.0 and didn't get a segfault. Yup, works here, too. And everything but mersenne-random should be fool-proof. What version are you using?

[Haskell-cafe] Re: was: Debugging methods for haskell structured data types the right way in haskell

2009-07-20 Thread Jon Fairbairn
Fernan Bolando fernanbola...@mailc.net writes: On Sun, Jul 19, 2009 at 7:40 AM, wren ng thorntonw...@freegeek.org wrote: Fernan Bolando wrote: The intention is z0 is a system parameter and database, it contains a set of info needed to define a particular simulation A single-constructor

[Haskell-cafe] Re: Debugging methods for haskell

2009-07-18 Thread Jon Fairbairn
Henning Thielemann lemm...@henning-thielemann.de writes: On Thu, 16 Jul 2009, Fernan Bolando wrote: Hi all I recently used 2 hours of work looking for a bug that was causing Program error: Prelude.!!: index too large A good way to avoid such problems is to avoid partial functions at

Re: [Haskell-cafe] Re: Debugging methods for haskell

2009-07-18 Thread Fernan Bolando
On Sat, Jul 18, 2009 at 4:57 PM, Jon Fairbairnjon.fairba...@cl.cam.ac.uk wrote: Henning Thielemann lemm...@henning-thielemann.de writes: On Thu, 16 Jul 2009, Fernan Bolando wrote: Hi all I recently used 2 hours of work looking for a bug that was causing Program error: Prelude.!!: index

[Haskell-cafe] was: Debugging methods for haskell structured data types the right way in haskell

2009-07-18 Thread Fernan Bolando
On Sun, Jul 19, 2009 at 7:40 AM, wren ng thorntonw...@freegeek.org wrote: Fernan Bolando wrote: The intention is z0 is a system parameter and database, it contains a set of info needed to define a particular simulation it looks like ( [n,m...], [m,o,p]) n is is a list info settings for the

Re: [Haskell-cafe] Re: Debugging methods for haskell

2009-07-18 Thread wren ng thornton
Fernan Bolando wrote: The intention is z0 is a system parameter and database, it contains a set of info needed to define a particular simulation it looks like ( [n,m...], [m,o,p]) n is is a list info settings for the circuit analysis m is a list of statistics for the circuits that is need in

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-17 Thread Henning Thielemann
On Thu, 16 Jul 2009, Fernan Bolando wrote: Hi all I recently used 2 hours of work looking for a bug that was causing Program error: Prelude.!!: index too large A good way to avoid such problems is to avoid partial functions at all. (!!) is also inefficient. Is it possible to define the

[Haskell-cafe] Re: Debugging methods for haskell

2009-07-16 Thread Jon Fairbairn
Fernan Bolando fernanbola...@mailc.net writes: Hi all I recently used 2 hours of work looking for a bug that was causing Program error: Prelude.!!: index too large This is not very informative. It did not give me a hint which function was causing this. In C adding a few printf would have

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-16 Thread Thomas Schilling
2009/7/16 Marc Weber marco-owe...@gmx.de I recall there was another method. Yeah, I even found it (using ghci and set -fbreak-on-exception) http://donsbot.wordpress.com/2007/11/14/no-more-exceptions-debugging-haskell-code-with-ghci/ Careful, better use -fbreak-on-error rather than -fbreak

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-16 Thread Matthias Görgens
By the way, does Hat - the Haskell Tracer? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-16 Thread Matthias Görgens
By the way, does Hat - the Haskell Tracer? Please append: still work. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Debugging methods for haskell

2009-07-16 Thread Fernan Bolando
On Thu, Jul 16, 2009 at 4:10 PM, Jon Fairbairnjon.fairba...@cl.cam.ac.uk wrote: I wonder if your code has to use !! at all? I took a look at a random module from the above link, and (without making much attempt at understanding it), I'd guess that using accumArray and friends would be more

[Haskell-cafe] Re: Debugging methods for haskell

2009-07-16 Thread Jon Fairbairn
Fernan Bolando fernanbola...@mailc.net writes: On Thu, Jul 16, 2009 at 4:10 PM, Jon Fairbairnjon.fairba...@cl.cam.ac.uk wrote: I wonder if your code has to use !! at all? I took a look at a random module from the above link, and (without making much attempt at understanding it), I'd guess

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-16 Thread Magnus Therning
this. In C adding a few printf would have helped me, but in haskell I was not sure how to do that. Can anybody point me to some debuggin method everyone uses. You could:    * use Debug.Trace.trace  (equivalent of printf debugging)    * use asserts: the 'assert' function    * use the GHCi debugger

[Haskell-cafe] Debugging methods for haskell

2009-07-15 Thread Fernan Bolando
Hi all I recently used 2 hours of work looking for a bug that was causing Program error: Prelude.!!: index too large This is not very informative. It did not give me a hint which function was causing this. In C adding a few printf would have helped me, but in haskell I was not sure how to do

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-15 Thread Don Stewart
was not sure how to do that. Can anybody point me to some debuggin method everyone uses. You could: * use Debug.Trace.trace (equivalent of printf debugging) * use asserts: the 'assert' function * use the GHCi debugger to construct a stack trace * use profiling to construct a stack

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-15 Thread Marc Weber
/14921/match=empty+list+head http://article.gmane.org/gmane.comp.lang.haskell.cafe/6719/match=empty+list+head I recall there was another method. Yeah, I even found it (using ghci and set -fbreak-on-exception) http://donsbot.wordpress.com/2007/11/14/no-more-exceptions-debugging-haskell-code-with-ghci

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-15 Thread Anton van Straaten
Fernan Bolando wrote: Program error: Prelude.!!: index too large This is not very informative. It did not give me a hint which function was causing this. In addition to the debugging methods that have been mentioned, the Safe library provides a way to write the code more robustly

[Haskell-cafe] Re: Debugging misbehaving multi-threaded programs

2009-06-12 Thread Simon Marlow
On 11/06/2009 05:40, Evan Klitzke wrote: I've written a multi-threaded Haskell program that I'm trying to debug. Basically what's happening is the program runs for a while, and then at some point one of the threads goes crazy and spins the CPU while allocating memory; this proceeds until the

Re: [Haskell-cafe] Debugging misbehaving multi-threaded programs

2009-06-11 Thread Ketil Malde
Evan Klitzke e...@eklitzke.org writes: [...] Unfortunately, this doesn't seem to work; whenever the program terminates due to running out of heap space, the generated .prof file is empty. Unless there's some specific problem with profiling in combination with threading, you can get heap

Re: [Haskell-cafe] Debugging misbehaving multi-threaded programs

2009-06-11 Thread Claus Reinke
I've written a multi-threaded Haskell program that I'm trying to debug. Basically what's happening is the program runs for a while, and then at some point one of the threads goes crazy and spins the CPU while allocating memory; this proceeds until the system runs out of available memory. I can't

Re: [Haskell-cafe] Debugging misbehaving multi-threaded programs

2009-06-11 Thread Evan Klitzke
On Thu, Jun 11, 2009 at 12:40 AM, Ketil Maldeke...@malde.org wrote: Evan Klitzke e...@eklitzke.org writes: [...] Unfortunately, this doesn't seem to work; whenever the program terminates due to running out of heap space, the generated .prof file is empty. Unless there's some specific

[Haskell-cafe] Debugging misbehaving multi-threaded programs

2009-06-10 Thread Evan Klitzke
I've written a multi-threaded Haskell program that I'm trying to debug. Basically what's happening is the program runs for a while, and then at some point one of the threads goes crazy and spins the CPU while allocating memory; this proceeds until the system runs out of available memory. I can't

[Haskell-cafe] Debugging a RecSel Error

2009-04-17 Thread Gü?nther Schmidt
Hi all, I'm trying to find the spot in my source code that triggered a RecSel Exception (No match in record selector ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-15 Thread Colin Paul Adams
Claus == Claus Reinke claus.rei...@talk21.com writes: Claus None of which is satisfactory. You might also want to add Claus yourself to this ticket: Claus index out of range error message regression Claus http://hackage.haskell.org/trac/ghc/ticket/2669 How do I

Re: [Haskell-cafe] Re: How to catch error in array index when debugging

2009-03-15 Thread Colin Paul Adams
Peter == Peter Hercek pher...@gmail.com writes: Peter Colin Paul Adams wrote: Adrian == Adrian Neumann aneum...@inf.fu-berlin.de writes: Adrian You can use the ghci debugger http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci- Adrian debugger.html

[Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Colin Paul Adams
I'm getting a runtime failure Error in array index. This causes ghci to exit. Is there a way to get it to break instead, so I can find out which function is failing? -- Colin Adams Preston Lancashire ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Bulat Ziganshin
Hello Colin, Saturday, March 14, 2009, 11:39:41 AM, you wrote: I'm getting a runtime failure Error in array index. This causes ghci to exit. Is there a way to get it to break instead, so I can find out which function is failing? i recall two techniques - one is trivially define your own

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Adrian Neumann
You can use the ghci debugger http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci- debugger.html it can set breakpoints on exceptions. Am 14.03.2009 um 09:39 schrieb Colin Paul Adams: I'm getting a runtime failure Error in array index. This causes ghci to exit. Is there a way

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Claus Reinke
I'm getting a runtime failure Error in array index. This causes ghci to exit. Is there a way to get it to break instead, so I can find out which function is failing? i recall two techniques - one is trivially define your own (!) and print index at least. another is to use ghc profiling with

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Colin Paul Adams
Claus == Claus Reinke claus.rei...@talk21.com writes: Claus None of which is satisfactory. You might also want to add Claus yourself to this ticket: Clausindex out of range error message regression Claus http://hackage.haskell.org/trac/ghc/ticket/2669 How do I do that? --

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Colin Paul Adams
Adrian == Adrian Neumann aneum...@inf.fu-berlin.de writes: Adrian You can use the ghci debugger http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci- Adrian debugger.html Adrian it can set breakpoints on exceptions. So i tried adding the -fbreak-on-error flag. It made

  1   2   3   >