[M3devel] the formsedit crash

Jay K jay.krell at cornell.edu
Mon Jul 27 17:24:16 CEST 2009


I don't think this is a stack overflow but I will try that.
We should probably drastically increase the defaults.
 Like make them match whatever the underlying platform uses, or just make 
  sure that unless the user intercedes, that we don't either.
 
 
The whole notion of a limited size stack is pretty flawed imho.
And much worse if you engage in reducing it from the default.
How much stack do I need to leave for fopen to work?
What do I do when I run out of stack? On NT you can detect and handle it, but it is too tricky.
Personally I try to use very little stack, and don't use recursion - if I must use a "heap allocated stack" (e.g. std::stack<> in C++).
I understand though that the machine stack is tremendously faster than anything heap-based (at least in non-gc environments, gc heap alloc can be fast, if you don't mind the extra work for the gc to later clean it up..and if the usage is actually lifo...)
 
 
Granted, if I'm "just doing a bunch of math" and don't call into code I don't control, then it becomes more tenable. Still hard to pick a size that is portable, though multiplying by sizeof(void*) helps.
What if I use TRY? That uses a highly platform-specific and often fairly large amount of stack.
 
 
 - Jay


----------------------------------------
> Date: Mon, 27 Jul 2009 16:53:08 +0200
> From: wagner at elegosoft.com
> To: m3devel at elegosoft.com
> Subject: Re: [M3devel] the formsedit crash
>
> Quoting Tony Hosking :
>
>> Not sure if doing it that way works. Current default stack size set in
>> ThreadPThread.m3 is 4096 * ADRSIZE(Word.T). You'll need to try
>> changing it there.
>
> There used to be a procedure IncreaseDefaultStackSize. IITR we needed
> that for several M3 applications on some platforms several years ago.
>
> But probably we should also set the default for a target platform
> so that all our own applications are able to run.
>
> Olaf
> --
> Olaf Wagner -- elego Software Solutions GmbH
> Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
> phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95
> http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
> Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
>


More information about the M3devel mailing list