Menu

#3865 crash from taking limit of factorial(x) + 1

None
closed
5
2021-11-14
2021-09-24
Dave Morris
No

As pointed out in sagemath trac ticket #31762, the following simple limit results in an error that "Maxima encountered a Lisp error: Binding stack exhausted":
(%i1) limit(factorial(x) + 1, x, 0);
(I seem to be using Maxima version: 5.43.0 (x86_64-apple-darwin13.4.0) / Lisp: SBCL 1.5.3.)

Discussion

  • Robert Dodier

    Robert Dodier - 2021-09-26
    • labels: --> limit, inf, zeroa, zerob
     
  • Robert Dodier

    Robert Dodier - 2021-09-26

    Confirmed with current version (post-5.45).

    For the record, a stack trace shows TOPLEVEL-$LIMIT --> LIMIT --> SIMPLIMIT --> SIMPLIMPLUS --> SIMPLIMPLUS1 --> SIMPAB --> SIMPINF --> SIMPINF-IC --> TOPLEVEL-$LIMIT.

    Looks like the original limit as x --> 0 is replaced by limit as 1/x --> inf and then back again. I guess we have to figure out how to tell that there's no point is doing the transformation a second time, if the first didn't help.

     
  • Barton Willis

    Barton Willis - 2021-09-29

    Inserting a call to ridoab early on eliminates this bug. I'm not sure it's the right fix:

    (defun simplimfact (expr var val)
      (let* ((arglim (limit (cadr expr) var val 'think)) ; Limit of the argument.
             (arg2 arglim))
        (setq arglim (ridofab arglim))  ;; New line!
    
     
  • Dan Gildea

    Dan Gildea - 2021-11-14
    • status: open --> closed
    • assigned_to: Dan Gildea
     

Log in to post a comment.