On Wed, Jun 08, 2016 at 11:11:13AM +0200, Sven Van Caekenberghe wrote:
> 
> > On 08 Jun 2016, at 10:40, Henrik Johansen <henrik.s.johan...@veloxit.no> 
> > wrote:
> > 
> > 
> >> On 04 Jun 2016, at 9:13 , stepharo <steph...@free.fr> wrote:
> >> 
> >> 
> >> 
> >> Le 3/6/16 ?? 19:16, Esteban A. Maringolo a ??crit :
> >>> Regarding the first part of your email, about UI lockups, it is almost
> >>> unavoidable, because in Pharo almost everything happens in the main
> >>> thread, as you pointed out.
> >> Yes. This is all my point.
> > 
> > IMHO, all Pharo beginner tutorials should start by showing off Cmd - dot 
> > (or Alt - dot, on Win / Linux).
> > 
> > Not just because it's cool, but because it's necessary :)
> > 
> > Cheers,
> > Henry
> 
> Very true.
> 
> Yet, and I have already mentioned this years ago, it is technically totally 
> possible to properly detect massive stack growth, before things get out of 
> control. Sadly, VM people think this is not needed (or too costly).
> 

Hi Sven,

I think that I remember this topic being discussed from time to time, but
I cannot recall specifics. Do you have a pointer to any discussions on the
mailing lists? I'm sure that there would be interest in doing this if it
can be done in an efficent manner.

Thanks,
Dave




> Consider the following in Common Lisp (LispWorks):
> 
> CL-USER 1 > (defun fac (n) (if (< n 2) 1 (* n (fac (1- n)))))
> FAC
> 
> CL-USER 2 > (fac 5)
> 120
> 
> CL-USER 3 > (fac 100)
> 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
> 
> CL-USER 4 > (fac 400)
> 
> Stack overflow (stack size 31744).
>   1 (continue) Extend stack by 50%.
>   2 (abort) Return to level 0.
>   3 Return to top loop level 0.
> 
> Type :b for backtrace or :c <option number> to proceed.
> Type :bug-form "<subject>" for a bug report template or :? for other options.
> 
> CL-USER 5 : 1 > :c 1
> 
> Stack overflow (stack size 48128).
>   1 (continue) Extend stack by 50%.
>   2 (abort) Return to level 0.
>   3 Return to top loop level 0.
> 
> Type :b for backtrace or :c <option number> to proceed.
> Type :bug-form "<subject>" for a bug report template or :? for other options.
> 
> CL-USER 6 : 1 > :c 1
> 64034522846623895262347970319503005850702583026002959458684445942802397169186831436278478647463264676294350575035856810848298162883517435228961988646802997937341654150838162426461942352307046244325015114448670890662773914918117331955996440709549671345290477020322434911210797593280795101545372667251627877890009349763765710326350331533965349868386831339352024373788157786791506311858702618270169819740062983025308591298346162272304558339520759611505302236086810433297255194852674432232438669948422404232599805551610635942376961399231917134063858996537970147827206606320217379472010321356624613809077942304597360699567595836096158715129913822286578579549361617654480453222007825818400848436415591229454275384803558374518022675900061399560145595206127211192918105032491008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
> 
> CL-USER 7 > (defun infinite () (cons 'a (infinite)))
> INFINIT
> 
> CL-USER 8 > (infinite)
> 
> Stack overflow (stack size 80896).
>   1 (continue) Extend stack by 50%.
>   2 (abort) Return to level 0.
>   3 Return to top loop level 0.
> 
> Type :b for backtrace or :c <option number> to proceed.
> Type :bug-form "<subject>" for a bug report template or :? for other options.
> 
> CL-USER 9 : 1 > :a
> 
> CL-USER 10 >
> 
> Just having an upper limit to the stack catches 99% of infinite loops - that 
> would be nice to have.
> 
> This has existed for 10s of years AFAIK.
> 
> Sven
> 
> PS: Of course, the stack size can be set larger to begin with, if necessary. 
> I believe it is even per execution thread.
> 

Reply via email to