Opened 8 years ago

Closed 6 years ago

#12377 closed defect (fixed)

Stack overflow in definite integral

Reported by: mjo Owned by: burcin
Priority: major Milestone: sage-5.11
Component: calculus Keywords:
Cc: Merged in: sage-5.11.rc0
Authors: Michael Orlitzky Reviewers: Volker Braun
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by mjo)

This was reported by William in #11591. It still occurs with maxima-5.26:

sage: y=(x^2)*exp(x)/(1+exp(x))^2
sage: integrate(y,(x,-1000,1000))
...
;;;
;;; Stack overflow.
;;; Jumping to the outermost toplevel prompt
;;;
...
/home/mjo/src/sage-5.0.beta1/spkg/bin/sage: line 304:   863 Segmentation fault      sage-ipython "$@" -i

Attachments (1)

sage-trac_12377.patch (852 bytes) - added by mjo 6 years ago.
Doctest the upstream fix

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by mjo

  • Description modified (diff)

comment:2 Changed 8 years ago by nbruin

This bug also occurs in Maxima (on at least SBCL and ECL):

(%i1) y: (x^2)*exp(x)/(1+exp(x))^2$
(%i2) integrate(y,x,-1000,1000);
Maxima encountered a Lisp error:

 Control stack exhausted (no more space for function call frames).

so this looks like a straightforward bug in maxima.

comment:3 Changed 8 years ago by nbruin

More news on Maxima bugtracker

(I'm not setting this to "Reported Upstream - little or no feedback" because, while technically correct, I think it's offensive to the Maxima devs, who are generally very diligent and helpful. They haven't had time to give feedback yet)

comment:4 Changed 6 years ago by kcrisman

  • Report Upstream changed from N/A to Fixed upstream, in a later stable release.

For some reason this works now.

sage: integrate(y,(x,-1000,1000))
-2*((1000*log(e^1000 + 1) - polylog(2, -e^(-1000)) - 1000000)*e^1000 + 1000*log(e^1000 + 1) - polylog(2, -e^(-1000)) - 500000)/(e^1000 + 1) - 2*(1000*(e^1000 + 1)*log(e^1000 + 1) + (e^1000 + 1)*polylog(2, -e^1000) - 500000*e^1000)/(e^1000 + 1)

The Maxima overflows also seem to work now.

Changed 6 years ago by mjo

Doctest the upstream fix

comment:5 Changed 6 years ago by mjo

  • Authors set to Michael Orlitzky
  • Status changed from new to needs_review

comment:6 Changed 6 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

comment:7 Changed 6 years ago by jdemeyer

  • Merged in set to sage-5.11.rc0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.