## #1881 simplify_sum(sum(k^n,k,1,m)) -> stack overflow

closed
nobody
5
2010-01-31
2010-01-23
No

The following example causes a crash of Maxima:

(%i2) sum(k^n,k,1,m);
(%o2) 'sum(k^n,k,1,m)

(%i3) simplify_sum(%);

INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution
Maxima encountered a Lisp error:

Observed with Maxima 5.20post and SBCL 1.0.29.

Dieter Kaiser

## Discussion

• Dieter Kaiser - 2010-01-24
• status: open --> closed

• Dieter Kaiser - 2010-01-24

This is a duplicate of the reported problem Bug ID: 2938078 - Crash on attached input. Again we get an endless loop between the functions maxima-integerp and check-integer-facts.
Closing this bug report as a duplicate.
Dieter Kaiser

• Dieter Kaiser - 2010-01-28

Reopen this bug report:

This bug is not related to the bug ID: 2938078 - Crash on attached input.

It is not observable with GCL (but present), with CLISP and SBCL Maxima enters an endless loop. Furthermore, I have gone back to old versions of Maxima. I have seen this bug with Maxima 5.16 too.

The problem is the function \$poly in algUtil.mac. The recursion is stopped, when the degree (the last argument to \$poly) is equal to -1. But we have a symbolic expression as a degree and \$poly loops endlessly.

(%i8) trace(poly);
(%o8) [poly]

(%i9) sum(k^n,k,1,n);
(%o9) 'sum(k^n,k,1,n)

(%i10) simplify_sum(%);
1 Enter poly [k,_g,n+2]
2 Enter poly [k,_g,n+1]
3 Enter poly [k,_g,n]
4 Enter poly [k,_g,n-1]
5 Enter poly [k,_g,n-2]
6 Enter poly [k,_g,n-3]
7 Enter poly [k,_g,n-4]
...

Dieter Kaiser

• Dieter Kaiser - 2010-01-28
• status: closed --> open

• Andrej Vodopivec - 2010-01-28

Fixed in zeilberger_algorithm.mac rev 1.8.

• Andrej Vodopivec - 2010-01-28
• status: open --> closed

• Robert Dodier - 2010-01-31
• labels: --> Share Libraries

• Robert Dodier - 2010-01-31

changing resolution to "fixed" per previous comment.