Prelude> f 1 where f x = x : f x [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,{Interrupted!} Prelude> f 1 where f x = x : f x ==================== in unix/linux proper error msg comes out and back to interpreter. ERROR - Control stack overflow =========== but in windows 2000 Then suddnly interpreter fails and the red (X) popup window pops up. hugs.exe - application programm error unknown software exception (0xc000fd) ... blabla
but in windows 2000
Then suddnly interpreter fails and the red (X) popup window pops up.
hugs.exe - application programm error
unknown software exception (0xc000fd) ... blabla
Are you sure you have the very very very latest download? There have been some undocumented updates of the December 2001 release of Hugs. Download the very latest release and try it again. I tried you expression on Win2000, with Hugs Dec 2001, downloaded last week, and it runs in constant space for an unlimited time. Rijk-Jan
Prelude> f 1 where f x = x : f x [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,{Interrupted!} Prelude> f 1 where f x = x + f x ==================== in unix/linux proper error msg comes out and back to interpreter. ERROR - Control stack overflow =========== but in windows 2000 Then suddnly interpreter fails and the red (X) popup window pops up. hugs.exe - application programm error unknown software exception (0xc000fd) ... blabla
Ahn Ki-yung wrote:
Prelude> f 1 where f x = x : f x [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,{Interrupted!}
Prelude> f 1 where f x = x + f x
--> Immediate (!) crash Indeed, I could reproduce this on my computer (Win2000; Hugs Dec 2001 of last week). Rijk-Jan van Haaften
Ahn Ki-yung <kyagrd@bawi.org> reports:
{Apparently inessential details of program supressed]
in unix/linux proper error msg comes out and back to interpreter.
ERROR - Control stack overflow
=========== but in windows 2000
Then suddnly interpreter fails and the red (X) popup window pops up.
hugs.exe - application programm error
unknown software exception (0xc000fd) ... blabla
This is a known problem in Hugs to do with overflows of the C stack. The problem is: - Hugs evaluation is done on the C stack and so some kinds of evaluation can cause stack overflows. - OSs and C are pretty poor at detecting or avoiding stack overflows. The reason you didn't see this in Unix is: - Unix apparently assigns a different stack-size limit to Hugs. (I think you can tune stack size in Windows but forget how.) - Hugs uses a 2nd stack 'the control stack' during evaluation. This is a normal C array which Hugs knows the size of so it can detect overflow in that stack. Often, when you run out of C stack space, you were about to run out of control stack space anyway and when you run out of control stack space you were about to run out of C stack space. (In other words, running out of either usually indicates a problem in your program which will not be solved by tweaking stack sizes.) Hope this helps. -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/
participants (3)
-
Ahn Ki-yung -
Alastair Reid -
Rijk J. C. van Haaften