Re: [Haskell-cafe] Obscure weirdness

2009-06-21 Thread Andrew Coppin

Andrew Coppin wrote:

Anyway, I shall try 6.10.3 and see what happens.


Recompiled my program. It now throws a "loop" exception (which the 
exception handler catches) instead of just dying.


(Curiosly, the exception handler itself then throws an exception saying 
": hGetLine: illegal operation (handle is finalized)". It worked 
fine before... anybody know about this?)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Obscure weirdness

2009-06-21 Thread Andrew Coppin

Raynor Vliegendhart wrote:

There is a bug in ghci 6.10.1 that seems to be fixed in 6.10.3 (not
sure whether it's fixed in 6.10.3). Certain non-terminating
expressions causes ghci to crash immediately and go back to the
prompt:


C:\>ghci
GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude> let loop = loop in loop

C:\>


Compiling a module with a non-terminating expression first with ghc
and then loading it in ghci does not seem to result in a crash.
  


That certainly sounds very much like the behaviour I'm seeing, except... 
it happens whether or not the code is compiled.


If I run GHCi with nothing compiled, it crashes. If I compile all the 
modules and run GHCi, it crashes. If I make a stand-alone executable and 
run it, it crashes.


Anyway, I shall try 6.10.3 and see what happens.

PS. Is there a ticket for this? I mean, it seems to be fixed, but we 
should probably still record it somehow?


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Obscure weirdness

2009-06-20 Thread Raynor Vliegendhart
On 6/20/09, Andrew Coppin  wrote:
>
> 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. ;-)

There is a bug in ghci 6.10.1 that seems to be fixed in 6.10.3 (not
sure whether it's fixed in 6.10.3). Certain non-terminating
expressions causes ghci to crash immediately and go back to the
prompt:


C:\>ghci
GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude> let loop = loop in loop

C:\>


Compiling a module with a non-terminating expression first with ghc
and then loading it in ghci does not seem to result in a crash.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Obscure weirdness

2009-06-20 Thread Lennart Augustsson
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
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Obscure weirdness

2009-06-20 Thread 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


Re: [Haskell-cafe] Obscure weirdness

2009-06-20 Thread Marcin Kosiba
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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Obscure weirdness

2009-06-20 Thread Ross Mellgren
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


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Obscure weirdness

2009-06-20 Thread Andrew Coppin

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


Re: [Haskell-cafe] Obscure weirdness

2009-06-20 Thread Alexander Dunlap
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!)
>
> 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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Obscure weirdness

2009-06-20 Thread 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