[Haskell-cafe] Obscure weirdness

Andrew Coppin andrewcoppin at btinternet.com
Sat Jun 20 16:36:58 EDT 2009

Marcin Kosiba wrote:
> On Saturday 20 June 2009, Andrew Coppin wrote:
>> OK, so here's an interesting problem...
>> I've been coding away all day, but now my program is doing something
>> slightly weird. For a specific input, it summarily terminates. The
>> registered exception handler does not fire. There is no output to stdout
>> or stderr indicating what the problem is. It just *stops* half way
>> through the printout.
>> Weirder: If I run it in GHCi, then GHCi itself terminates. (I didn't
>> think you could *do* that!)
> Hi,
> 	With the information you've provided it's hard to even guess. At least take a 
> look at your app's RAM usage -- it just may be that its allocating too much 
> memory and the OOM killer is killing it (if you're running linux, that is).
> 	You may also want to try the GHCi debugger [1] to find out where the program 
> crashes. The last thing I'd do is blame it on ghc/ghci, but as always -- such 
> a possibility exists.

It's Windows. And while it's possible (indeed even probable) that my 
code has an infinite loop in it somewhere, usually that makes the 
program slow to a crawl and start thrashing the HD as it hits virtual 
memory. But this program just dies. Instantly.

And I already tried the GHCi debugger. When I run the program, GHCi just 
quits. I suppose if I can track down exactly *where* in the program it's 
dying, I could try single-stepping through it...

If I was doing something tricky like FFI or unsafe coersions, I'd assume 
I'd got it wrong somewhere. But I'm just doing plain ordinary Haskell 
stuff - traversing trees, pattern matching, etc. I'm a bit perplexed 
that it can fail this way.

More information about the Haskell-Cafe mailing list