
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!) It's not as if my program is anything unusual. There are no unsafe functions. No FFI. Nothing. Just regular high-level Haskell. Is this a known bug in GHC 6.10.1? Will upgrading fix it? (Obviously, it's quite a lot of work to change GHC.) Suffice it to say that my program is quite big and complicated; it worked fine when it was still small and simple. ;-)

On Sat, Jun 20, 2009 at 8:29 AM, Andrew Coppin
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!)
It's not as if my program is anything unusual. There are no unsafe functions. No FFI. Nothing. Just regular high-level Haskell.
Is this a known bug in GHC 6.10.1? Will upgrading fix it? (Obviously, it's quite a lot of work to change GHC.) Suffice it to say that my program is quite big and complicated; it worked fine when it was still small and simple. ;-)
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
I think you'll need to provide a bit more detail about what you're doing in order for anyone to have anything to go off of. If you can link to the source, that would help, or even give a summary of what you're trying to do. Alex

Alexander Dunlap wrote:
On Sat, Jun 20, 2009 at 8:29 AM, 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!)
I think you'll need to provide a bit more detail about what you're doing in order for anyone to have anything to go off of. If you can link to the source, that would help, or even give a summary of what you're trying to do.
The program takes some text, parses it as a lambda calculus expression, and prints it out again. Except, somewhere during the variable uniqueness pass, the program just halts. For no defined reason. As you can see, nothing remotely unusual for a Haskell program to be doing. And yet, the result is very unusual. (I.e., halting part-way through some pure code without throwing an exception.) Given that it doesn't appear to be a known bug (presumably somebody would have said something by now if it was...), I think I'm going to try upgrading GHC anyway, just for arguments' sake, and see if that fixes it.

Really, without code or more than "it just disappears", it's just conjecture what's happening. Can you post the code, or even better yet a minimized case that reproduces it? -Ross On Jun 20, 2009, at 1:34 PM, Andrew Coppin wrote:
Alexander Dunlap wrote:
On Sat, Jun 20, 2009 at 8:29 AM, 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!)
I think you'll need to provide a bit more detail about what you're doing in order for anyone to have anything to go off of. If you can link to the source, that would help, or even give a summary of what you're trying to do.
The program takes some text, parses it as a lambda calculus expression, and prints it out again. Except, somewhere during the variable uniqueness pass, the program just halts. For no defined reason.
As you can see, nothing remotely unusual for a Haskell program to be doing. And yet, the result is very unusual. (I.e., halting part-way through some pure code without throwing an exception.)
Given that it doesn't appear to be a known bug (presumably somebody would have said something by now if it was...), I think I'm going to try upgrading GHC anyway, just for arguments' sake, and see if that fixes it.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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!)
It's not as if my program is anything unusual. There are no unsafe functions. No FFI. Nothing. Just regular high-level Haskell.
Is this a known bug in GHC 6.10.1? Will upgrading fix it? (Obviously, it's quite a lot of work to change GHC.) Suffice it to say that my program is quite big and complicated; it worked fine when it was still small and simple. ;-)
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. Thanks! Marcin Kosiba [1] http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-debugger.html

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.

Did you try running it in some debugger, like windbg or VS?
2009/6/20 Andrew Coppin
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.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (5)
-
Alexander Dunlap
-
Andrew Coppin
-
Lennart Augustsson
-
Marcin Kosiba
-
Ross Mellgren