I keep getting this seg fault, at same place in a script.
/usr/bin/sage-python: line 2: 17786 Segmentation fault (core dumped) sage -python "$@"
I am using SageMath version 8.2, Release Date: 2018-05-05 on Linux Manjaro 17.1. Installed sage using Manjaro package manager.
Where does the core dump file go to? I do not see it in the folder I was running the sage script from.
it core dumps when it gets to the 99th integral for some reason. I am using multiprocessing so I can better set a timeout on integrate. This works very well. I use the same exact setup with python directly, and its been running there on sympy for hrs with no problem.
Only when I use the same setup in sage, it core dumps when it gets to integral 99 in the list.
Could someone please run the following script and see if they can reproduce the problem? it is self contained. I do
./test_maxima.sage
And after about 5 minutes or so, see the core dump
.......
>>>>>>>> doing integral number 97
before creating process
before p.start()
before p.join()
inside doTheIntegration, finished!!
after p.join()
result returned Ok, check it later
>>>>>>>> doing integral number 98
before creating process
before p.start()
before p.join()
inside doTheIntegration, finished!!
after p.join()
result returned Ok, check it later
>>>>>>>> doing integral number 99
/usr/bin/sage-python: line 2: 23427 Segmentation fault (core dumped) sage -python "$@"
Here is the script test_maxima.sage
#!/usr/bin/env sage
import os, sys, time, datetime, ntpath
from multiprocessing import Process, Queue
from sage.all import *
def doTheIntegration(q):
problem = q.get()
try:
anti=integrate(problem[0],problem[1],algorithm="maxima")
result = [0,"",anti]
except Exception as e:
print "cought exception" , type(e).__name__
result = [-1,type(e).__name__ ,""]
q.put(result)
print("inside doTheIntegration, finished!!")
def tree(expr):
if expr.operator() is None:
return expr
else:
return map(tree, expr.operands())
q = Queue()
var('a a1 b b1 n t x z ')
lst=[[(1+2*x)^(1/2),x,1,],
[x*(1+3*x)^(1/2),x,2,],
[x^2*(1+x)^(1/2),x,2,],
[x/(2-3*x)^(1/2),x,2,],
[(1+x)/(x^2+2*x+2)^3,x,1,],
[sin(x)^3,x,2,],
[(-1+z)^(1/3)*z,z,2,],
[cos(x)/sin(x)^3,x,2,],
[cos(2*x)*(4-sin(2*x))^(1/2),x,2,],
[sin(x)/(3+cos(x))^2,x,2,],
[sin(x)/(cos(x)^3)^(1/2),x,3,],
[sin((1+x)^(1/2))/(1+x)^(1/2),x,3,],
[x^(-1+n)*sin(x^n),x,2,],
[x^5/(-x^6+1)^(1/2),x,1,],
[t*(1+t)^(1/4),t,2,],
[1/(x^2+1)^(3/2),x,1,],
[x^2*(8*x^3+27)^(2/3),x,1,],
[(cos(x)+sin(x))/(-cos(x)+sin(x))^(1/3),x,1,],
[x/(1+x^2+(x^2+1)^(3/2))^(1/2),x,3,],
[x/(x^2+1)^(1/2)/((x^2+1)^(1/2)+1)^(1/2),x,1,],
[(x^2-2*x+1)^(1/5)/(1-x),x,2,],
[x*sin(x),x,2,],
[x^2*sin(x),x,3,],
[x^3*cos(x),x,4,],
[x^3*sin(x),x,4,],
[cos(x)*sin(x),x,2,],
[x*cos(x)*sin(x),x,3,],
[sin(x)^2,x,2,],
[sin(x)^3,x,2,],
[sin(x)^4,x,3,],
[sin(x)^5,x,2,],
[sin(x)^6,x,4,],
[x*sin(x)^2,x,2,],
[x*sin(x)^3,x,3,],
[x^2*sin(x)^2,x,4,],
[cos(x)^2,x,2,],
[cos(x)^3,x,2,],
[cos(x)^4,x,3,],
[(a^2-x^2)^(5/2),x,5,],
[x^5/(x^2+5)^(1/2),x,3,],
[t^3/(t^3+4)^(1/2),t,2,],
[tan(x)^2,x,2,],
[tan(x)^4,x,3,],
[cot(x)^2,x,2,],
[cot(x)^4,x,3,],
[(2+3*x)*sin(5*x),x,2,],
[x*(x^2+1)^(1/2),x,1,],
[x*(x^2-1)^9,x,1,],
[(3+2*x)/(7+6*x)^3,x,1,],
[x^4*(x^5+1)^5,x,1,],
[(1-x)^20*x^4,x,2,],
[sin(1/x)/x^2,x,2,],
[sin((-1+x)^(1/4)),x,5,],
[x*cos(x^2)*sin(x^2),x,1,],
[sin(2*x)*(1+3*cos(x)^2)^(1/2),x,3,],
[1/(2+3*x),x,1,],
[ln(x)^2,x,2,],
[x*ln(x),x,1,],
[x*ln(x)^2,x,2,],
[1/(1+t),t,1,],
[cot(x),x,1,],
[x^n*ln(a*x),x,1,],
[x^2*ln(x)^2,x,2,],
[1/x/ln(x),x,2,],
[ln(1-t)/(1-t),t,2,],
[ln(x)/x/(1+ln(x))^(1/2),x,3,],
[x^3*ln(x)^3,x,3,],
[exp(x^3)*x^2,x,1,],
[2^(x^(1/2))/x^(1/2),x,1,],
[exp(2*sin(x))*cos(x),x,2,],
[exp(x)*sin(x),x,1,],
[exp(x)*cos(x),x,1,],
[1/(1+exp(x)),x,4,],
[exp(x)*x,x,2,],
[x/exp(x),x,2,],
[exp(x)*x^2,x,3,],
[x^2/exp(2*x),x,3,],
[exp(x^(1/2)),x,3,],
[x^3/exp(x^2),x,2,],
[exp(a*x)*cos(b*x),x,1,],
[exp(a*x)*sin(b*x),x,1,],
[acot(x),x,2,],
[asec(x),x,4,],
[acsc(x),x,4,],
[asin(x)^2,x,3,],
[asin(x)/x^2,x,4,],
[1/(a^2-x^2)^(1/2),x,2,],
[1/(-x^2-2*x+1)^(1/2),x,2,],
[1/(a^2+x^2),x,1,],
[1/(b*x^2+a),x,1,],
[1/(x^2-x+2),x,2,],
[x*atan(x),x,3,],
[x^2*acos(x),x,4,],
[x*atan(x)^2,x,5,],
[atan(x^(1/2)),x,4,],
[atan(x^(1/2))/(1+x)/x^(1/2),x,1,],
[(-x^2+1)^(1/2),x,2,],
[exp(atan(x))*x/(x^2+1)^(3/2),x,1,],
[exp(atan(x))/(x^2+1)^(3/2),x,1,]]
n=0
for item in lst:
n = n + 1
print "\n\n>>>>>>>> doing integral number ", n
try:
q.put([item[0], item[1]])
except Exception as e:
print "Failed to put item on queue" , type(e).__name__
raise
print "before creating process"
p = Process(target=doTheIntegration, args=(q,))
starting_time = time.time()
print "before p.start()"
p.start()
print "before p.join()"
p.join(3*60)
print "after p.join()"
time_used = time.time() - starting_time
if p.exitcode == None:
print("process did not finish in time. Kill it")
p.terminate()
else:
anti=q.get()
print "result returned Ok, check it later"
print "finished"
Just like to know if someone can reproduce the core dump.