how to track down infinite loop?

David Roundy
Wed, 26 Mar 2003 10:23:51 -0500

Hello.  I've got an infinite loop (I think) which I recently introduced to
my code (the visible symptom is stack space overflow), and am wondering if
there is an easier way to figure out where it might be.  The problem being
that I've made a rather large number of changes (all of which are mutually

In the past, I've used ghc's heap profiling to track this sort of thing
down, as I can pretty easily trace from that what functions were called in
the infinite loop.  The problem I'm now having is that the string
describing the call stack is truncated too much, so I can't see who the
real culprit is.

I know the best thing would be to go over all my changes with a
fine-toothed comb, but it would be nice to have an idea where to look.
Actually, it's not all that much new code, but I usually find it hard to
see a bug that I've written myself...

Any ideas for tricks to see where a program is looping indefinitely? I'm
sure I can track down this bug pretty easily, but is seems like this is
something one really ought to be able to do...
David Roundy