Bug description:
x : SUP(INT) := reduce(+,[monomial(1, i)$SUP(INT) for i in 1..50800])

INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution

   >> System error:
   Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.

PROCEED WITH CAUTION.

=======

By examine the stack backtrace, this is caused by non-tail recursion
of sumWidthA in src/interp/i-output.boot, so I rewrite it in loop:

diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index f492283..bf794de 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -1992,10 +1992,11 @@ sumWidth u ==
   WIDTH u.1 + sumWidthA CDDR u

 sumWidthA u ==
-  not u => 0
-  ( member(keyp absym first u,'(_+ _-)) => 5; true => 3) +
-    WIDTH absym first u +
-      sumWidthA rest u
+  sum := 0
+  for item in u repeat
+    sum := sum + (if member(keyp absym first u,'(_+ _-)) then 5 else 3)
+    sum := sum + WIDTH absym first u
+  sum

 superSubApp(u, x, y, di) ==
   a := first (u := rest u)

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to