Opened 14 months ago

Last modified 2 months ago

#31762 new defect

Limit of factorial crashes

Reported by: gh-cEMRSS Owned by:
Priority: critical Milestone: sage-9.7
Component: calculus Keywords: maxima, limit
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

The relatively simple limit sage: ((factorial(x)-1)/x).limit(x=0) crashes silently, regardless of the algorithm.

Change History (8)

comment:1 Changed 11 months ago by mkoeppe

  • Milestone changed from sage-9.4 to sage-9.5

comment:2 Changed 9 months ago by gh-DaveWitteMorris

  • Report Upstream changed from N/A to Not yet reported upstream; Will do shortly.

I don't think the situation is as bad as the description says, because only the maxima algorithm crashes for me (but the answer from fricas does not seem very useful):

sage: ((factorial(x) - 1)/x).limit(x=0, algorithm='maxima_taylor')
-euler_gamma

sage: ((factorial(x) - 1)/x).limit(x=0, algorithm='sympy')
-euler_gamma

sage: ((factorial(x) - 1)/x).limit(x=0, algorithm='fricas')
D[0](factorial)(0)

On the other hand, the situation also seems worse than the description says because there doesn't even need to be a denominator for maxima to crash:

sage: (factorial(x)).limit(x=0, algorithm='maxima') # this is ok
1

sage: (factorial(x) + 1).limit(x=0, algorithm='maxima') # this crashes
;;;
;;; Detected access to protected memory, also known as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;
     < repeated many times >

/Users/dmorris/development/sage94/src/bin/sage-python: line 2: 20183 Segmentation fault: 11  sage -python "$@"

This seems to be a maxima bug, because command-line maxima also crashes:

(%i1) limit(factorial(x), x, 0);
1

(%i2) limit(factorial(x) + 1, x, 0);
Message from maxima's stderr stream: INFO: Binding stack guard page unprotected
Binding stack guard page temporarily disabled: proceed with caution
Maxima encountered a lisp error;
 Binding stack exhausted.
PROCEED WITH CAUTION.
Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
Message from maxima's stderr stream: INFO: Binding stack guard page reprotected

comment:3 Changed 9 months ago by gh-DaveWitteMorris

  • Report Upstream changed from Not yet reported upstream; Will do shortly. to Reported upstream. No feedback yet.

This is now maxima bug 3865.

comment:4 Changed 9 months ago by gh-DaveWitteMorris

  • Keywords maxima limit added

comment:5 Changed 9 months ago by gh-DaveWitteMorris

  • Report Upstream changed from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.

comment:6 Changed 8 months ago by gh-DaveWitteMorris

  • Report Upstream changed from Reported upstream. Developers acknowledge bug. to Fixed upstream, but not in a stable release.

comment:7 Changed 7 months ago by mkoeppe

  • Milestone changed from sage-9.5 to sage-9.6

comment:8 Changed 2 months ago by mkoeppe

  • Milestone changed from sage-9.6 to sage-9.7
Note: See TracTickets for help on using tickets.