A Little Learning is a Dangerous Thing !

2001-05-14 Thread Iain McNaughton


Hi !

I'm not quite sure if this is the right place to go for help with Hugs,
but I'll give it try...

Situation is this:

I was running some scripts in WinHugs, and everything was running
happily. I then attempted to add ( using ":a" ) a new script, and
received the following error message: "Program code storage space
exhausted".

Well, I thought to myself ( fool that I evidently was ! ) that there
must be a parameter somewhere in Hugs that I can set to increase the
program storage space, so I set out to find it. Unfortunately, having
tweaked a couple of numbers ( heap size was one, I think, and the other
was something similar-looking ), and restarted Hugs, I now have the
following error as I start WinHugs: "Cannot allocate heap storage".
Immediately after this error message within the WinHugs interface, a
pop-up box appears, containing the message: "Fatal Error: unable to load
prelude". At that point, WinHugs disappears.

I've tried uninstalling Hugs, and completely re-installing it, but that
doesn't appear to do any good. So, I've clearly f*cked up somewhere, but
I'm not sure where. Any comments or advice would be greatly appreciated.

I understand that this might not count as a bug in its own right, as the
software is presumably behaving in a perfectly sensible way; rather, the
bug is in me, the over-adventurous user. However, though I've read all
the documentation, I'm stuck, and would appreciate any help or
assistance you can give me. If you want to flame me for gross stupidity,
that would be fine, too !

Thanks for your ( hoped for ) help.

Sincerely,

Iain McNaughton.


-- 
Iain McNaughton

___
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs



Re: A Little Learning is a Dangerous Thing !

2001-05-14 Thread Ch. A. Herrmann

Hi Iain,

I'm working with UNIX only but likely my change will solve your problem too.

Iain> I was running some scripts in WinHugs, and everything was
Iain> running happily. I then attempted to add ( using ":a" ) a new
Iain> script, and received the following error message: "Program
Iain> code storage space exhausted".

In the "src" directory, there are some parameters defined in
"prelude.h". Our settings are (we use LARGE_HUGS):

#define NUM_ADDRS  Pick(28000,  6,  128)
#define NUM_STACK  Pick(1800,   12000,  64000)

NUM_ADDRS is for the program code storage space and NUM_STACK for the
stacksize. Recompile, maybe it'll work.

Cheers
-- 
 Christoph Herrmann
 Postdoctoral Research Associate 
 University of Passau, Germany 
 E-mail:  [EMAIL PROTECTED]
 WWW: http://brahms.fmi.uni-passau.de/cl/staff/herrmann.html




  

___
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs



Re: A Little Learning is a Dangerous Thing !

2001-05-14 Thread Antony Courtney

Hi Iain,

Iain McNaughton wrote:
> 
> Well, I thought to myself ( fool that I evidently was ! ) that there
> must be a parameter somewhere in Hugs that I can set to increase the
> program storage space, so I set out to find it. Unfortunately, having
> tweaked a couple of numbers ( heap size was one, I think, and the other
> was something similar-looking ), and restarted Hugs, I now have the
> following error as I start WinHugs: "Cannot allocate heap storage".
> Immediately after this error message within the WinHugs interface, a
> pop-up box appears, containing the message: "Fatal Error: unable to load
> prelude". At that point, WinHugs disappears.
> 
> I've tried uninstalling Hugs, and completely re-installing it, but that
> doesn't appear to do any good. So, I've clearly f*cked up somewhere, but
> I'm not sure where. Any comments or advice would be greatly appreciated.

Actually, I think you have stepped on a known design problem concerning how hugs
stores its state to the registry under Windows.  Unfortunately, every time you
do a ":set" in hugs, the changes you make to the options settings are stored in
the registry.  This is great if you set the right option in exactly the right
way, but is brutally unforgiving of mistakes (as you have discovered).

Your best bet (be VERY careful doing this) is to run "regedit" (by selecting
"Run..." from the Windows "Start" menu and typing "regedit"), and navigate to
the key:

"HKEY_CURRENT_USER\Software\Haskell\Hugs"

select the subkey folder for your hugs version (i.e. "February 2000").

The "Options" key contains the options settings you entered.  You can try and
edit this by hand to get rid of the options settings that accidentally caused
your problem.

I *think* you can also just delete this key altogether and hugs will revert to
its default configuration.

All of this is done at your own risk.

> I understand that this might not count as a bug in its own right, as the
> software is presumably behaving in a perfectly sensible way; rather, the
> bug is in me, the over-adventurous user. However, though I've read all
> the documentation, I'm stuck, and would appreciate any help or
> assistance you can give me. If you want to flame me for gross stupidity,
> that would be fine, too !

Whether this is a bug or a "design flaw" is a matter of opinion.

But hopefully we all agree that an "adventurous user" should not be punished
with an unusable hugs installation for all time!  

We are working on improving this situation.

Good luck,

-antony

-- 
Antony Courtney  
Grad. Student, Dept. of Computer Science, Yale University
[EMAIL PROTECTED]  http://www.apocalypse.org/pub/u/antony

___
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs



stack overflow

2001-05-14 Thread Gustav Andersson



Hello,
I think I've found a bug in Hugs 98 (February 2001 
version). Hugs crashes (Stack Overflow) whenever I try to execute the following 
piece of code (well I know, the code is not very useful, it came from a typo): 

 

--
f :: Int -> Int -> 
Intf a b = f (f' a b) b
 
f':: Int -> Int -> Intf' a b = 
a+b
--
Then i Hugs execute f with two arbitary 
integers
ex.
> f 2 2
 
Hugs Version February 2001 will crash with 
the following error (piece from drwatson's log-file in Windows 
2000).
Application exception 
occurred:    App:  
(pid=996)    When: 2001-05-14 @ 
19:01:03.010    Exception number: 
c0fd (stack overflow)
 
I've also tried the program under hugs in unix (I 
don't know the version, it didn't have the function ":version")

Stack overflow: pid 9856, proc hugs, addr 
0x11fdfffe0, pc 0x12001c124Segmentation fault
 
I hope this will help you with the next version of hugs.
 
Yours Sincerly 
Gustav Andersson


Re: stack overflow

2001-05-14 Thread Ch. A. Herrmann

Hi Gustav,

Gustav> Hello, I think I've found a bug in Hugs 98 (February 2001
Gustav> version). Hugs crashes (Stack Overflow) whenever I try to
Gustav> execute the following piece of code:

Gustav> f a b = f (f' a b) b

that's OK. Function f has two bad properties:

(1) it loops forever (theoretically)
(2) it increases the control stack in each call
(at least by the unevaluated closure of (f' a b))

Thus, at some point, the memory reserved for the
control stack will be consumed.

Cheers
Christoph

___
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs