Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Segmentation fault (core dumped) sage -python "$@"

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.

Segmentation fault (core dumped) sage -python "$@"

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 I also put the file on my site if it easier for you to download. It is in this folder

#!/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.

Segmentation fault (core dumped) sage -python "$@"

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.problem. I think it might be because sage uses Python 2.7, while running Python directly, I am using python 3.6.5. So this might be an issue with the older Python sage is using? I do not know.

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 I also put the file on my site if it easier for you to download. It is in this folder

#!/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.

Segmentation fault (core dumped) sage -python "$@"

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. I think it might be because sage uses Python 2.7, while running Python directly, I am using python 3.6.5. So this might be an issue with the older Python sage is using? I do not know.

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 I also put the file on my site if it easier for you to download. It is in this folder

#!/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.

Segmentation fault (core dumped) sage -python "$@"

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. I think it might be because sage uses Python 2.7, while running Python directly, I am using python 3.6.5. So this might be an issue with the older Python sage is using? I do not know.

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 I also put the file on my site if it easier for you to download. It is in this folder

#!/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.

Segmentation fault (core dumped) sage -python "$@"SageMath version 8.2

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. I think it might be because sage uses Python 2.7, while running Python directly, I am using python 3.6.5. So this might be an issue with the older Python sage is using? I do not know.

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 I also put the file on my site if it easier for you to download. It is in this folder

#!/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.

Here is the installation of sagemath on Manjaro

Preparing...
Resolving dependencies...
Checking inter-conflicts...
Downloading...
Downloading sagemath-8.2-6-x86_64.pkg.tar.xz...
Checking keyring...
Checking integrity...
Loading packages files...
Checking file conflicts...
Checking available disk space...
Installing python2-decorator (4.3.0-1)...
Installing python2-enum34 (1.1.6-1)...
Installing python2-traitlets (4.3.2-1)...
Installing python2-ptyprocess (0.5.2-1)...
Installing python2-pexpect (4.6.0-1)...
Installing python2-pathlib (1.0.1-4)...
Installing python2-pickleshare (0.7.4-3)...
Installing python2-backports (1.0-1)...
Installing python2-backports.shutil_get_terminal_size (1.0.0-1)...
Installing python2-pygments (2.2.0-1)...
Installing python2-wcwidth (0.1.7-2)...
Installing python2-prompt_toolkit (1.0.15-1)...
Installing ipython2 (5.6.0-1)...
Installing ppl (1.2-2)...
Installing palp (2.1-2)...
Installing m4ri (20140914-2)...
Installing brial (1.2.3-1)...
Installing cliquer (1.21-2)...
Installing ecl-16.1.2 (16.1.2-1)...
Installing maxima-ecl (5.41.0-1)...
Installing cddlib (094i-1)...
Installing gfan (0.6.2-1)...
Installing sympow (1.018.1-5)...
Installing nauty (26r10-1)...
Installing cblas (3.8.0-2)...
Installing python2-numpy (1.14.3-1)...
Installing r (3.5.0-1)...
Installing python2-rpy2 (2.8.6-2)...
Installing qd (2.3.20-1)...
Installing fplll (5.2.1-1)...
Installing python2-cysignals (1.7.1-1)...
Installing python2-fpylll (0.4.1dev-1)...
Installing python2-psutil (5.4.6-1)...
Installing python2-cypari2 (1.1.4-1)...
Installing python2-pytz (2018.4-1)...
Installing python2-sip (4.19.8-1)...
Installing python2-pyqt5 (5.10.1-3)...
Installing python2-dateutil (2.7.3-1)...
Installing python2-cycler (0.10.0-2)...
Installing python2-kiwisolver (1.0.1-1)...
Installing python2-backports.functools_lru_cache (1.5-1)...
Installing python2-matplotlib (2.2.2-2)...
Installing python2-scipy (1.1.0-1)...
Installing python2-gmpy2 (2.1.0a2-2)...
Installing python2-mpmath (1.0.0-1)...
Installing python2-sympy (1.1.1-1)...
Installing python2-networkx (2.1-2)...
Installing python2-pillow (5.1.0-1)...
Installing python2-future (0.16.0-2)...
Installing numactl (2.0.11-2)...
Installing hwloc (1.11.10-1)...
Installing openmpi (3.1.0-1)...
Installing gap (4.8.10-3)...
Installing libgap (4.8.6-6)...
Installing flintqs (1:1.0-2)...
Installing lcalc (1.23-16)...
Installing lrcalc (1.2-3)...
Installing flint (2.5.2-22)...
Installing arb (2.13.0-1)...
Installing eclib (20171219-3)...
Installing gmp-ecm (7.0.4-1)...
Installing zn_poly (0.9-4)...
Installing python2-cvxopt (1.2.0-1)...
Installing singular (4.1.1.p2-3)...
Installing pynac (0.7.21-2)...
Installing m4rie (20150908-2)...
Installing iml (1.0.5-2)...
Installing givaro (4.0.4-2)...
Installing fflas-ffpack (2.3.2-1)...
Installing tinyxml2 (6.2.0-1)...
Installing linbox (1.5.2-7)...
Installing rubiks (20070912-3)...
Installing pari-galdata (20080411-2)...
Installing pari-seadata-small (20090618-2)...
Installing planarity (3.0.0.5-1)...
Installing arpack (3.6.0-1)...
Installing igraph (0.7.1-7)...
Installing rankwidth (0.7-2)...
Installing tachyon (0.98.9-4)...
Installing sage-data-combinatorial_designs (20140630-2)...
Installing sage-data-elliptic_curves (0.8-2)...
Installing sage-data-graphs (20161026-1)...
Installing sage-data-polytopes_db (20170220-1)...
Installing sage-data-conway_polynomials (0.5-2)...
Installing sagemath (8.2-6)...
Running post-transaction hooks...
Updating TeXLive filename database...
Arming ConditionNeedsUpdate...
Updating the info directory file...
Updating the desktop file MIME type cache...
Updating the MIME type database...
Transaction successfully finished.

Segmentation fault (core dumped) SageMath version 8.2

I keep getting this seg fault, at same place in a script. script on Linux Manjaro

    /usr/bin/sage-python: line 2: 17786 Segmentation fault      (core dumped) sage -python "$@"

Update I get same core dump on Linux mint 19, using sage 8.1 at same location

>>>>>>>> doing integral number  99
/usr/share/sagemath/bin/sage-python: line 2: 14622 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. I think it might be because sage uses Python 2.7, while running Python directly, I am using python 3.6.5. So this might be an issue with the older Python sage is using? I do not know.

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 I also put the file on my site if it easier for you to download. It is in this folder

#!/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.

Here is the installation of sagemath on Manjaro

Preparing...
Resolving dependencies...
Checking inter-conflicts...
Downloading...
Downloading sagemath-8.2-6-x86_64.pkg.tar.xz...
Checking keyring...
Checking integrity...
Loading packages files...
Checking file conflicts...
Checking available disk space...
Installing python2-decorator (4.3.0-1)...
Installing python2-enum34 (1.1.6-1)...
Installing python2-traitlets (4.3.2-1)...
Installing python2-ptyprocess (0.5.2-1)...
Installing python2-pexpect (4.6.0-1)...
Installing python2-pathlib (1.0.1-4)...
Installing python2-pickleshare (0.7.4-3)...
Installing python2-backports (1.0-1)...
Installing python2-backports.shutil_get_terminal_size (1.0.0-1)...
Installing python2-pygments (2.2.0-1)...
Installing python2-wcwidth (0.1.7-2)...
Installing python2-prompt_toolkit (1.0.15-1)...
Installing ipython2 (5.6.0-1)...
Installing ppl (1.2-2)...
Installing palp (2.1-2)...
Installing m4ri (20140914-2)...
Installing brial (1.2.3-1)...
Installing cliquer (1.21-2)...
Installing ecl-16.1.2 (16.1.2-1)...
Installing maxima-ecl (5.41.0-1)...
Installing cddlib (094i-1)...
Installing gfan (0.6.2-1)...
Installing sympow (1.018.1-5)...
Installing nauty (26r10-1)...
Installing cblas (3.8.0-2)...
Installing python2-numpy (1.14.3-1)...
Installing r (3.5.0-1)...
Installing python2-rpy2 (2.8.6-2)...
Installing qd (2.3.20-1)...
Installing fplll (5.2.1-1)...
Installing python2-cysignals (1.7.1-1)...
Installing python2-fpylll (0.4.1dev-1)...
Installing python2-psutil (5.4.6-1)...
Installing python2-cypari2 (1.1.4-1)...
Installing python2-pytz (2018.4-1)...
Installing python2-sip (4.19.8-1)...
Installing python2-pyqt5 (5.10.1-3)...
Installing python2-dateutil (2.7.3-1)...
Installing python2-cycler (0.10.0-2)...
Installing python2-kiwisolver (1.0.1-1)...
Installing python2-backports.functools_lru_cache (1.5-1)...
Installing python2-matplotlib (2.2.2-2)...
Installing python2-scipy (1.1.0-1)...
Installing python2-gmpy2 (2.1.0a2-2)...
Installing python2-mpmath (1.0.0-1)...
Installing python2-sympy (1.1.1-1)...
Installing python2-networkx (2.1-2)...
Installing python2-pillow (5.1.0-1)...
Installing python2-future (0.16.0-2)...
Installing numactl (2.0.11-2)...
Installing hwloc (1.11.10-1)...
Installing openmpi (3.1.0-1)...
Installing gap (4.8.10-3)...
Installing libgap (4.8.6-6)...
Installing flintqs (1:1.0-2)...
Installing lcalc (1.23-16)...
Installing lrcalc (1.2-3)...
Installing flint (2.5.2-22)...
Installing arb (2.13.0-1)...
Installing eclib (20171219-3)...
Installing gmp-ecm (7.0.4-1)...
Installing zn_poly (0.9-4)...
Installing python2-cvxopt (1.2.0-1)...
Installing singular (4.1.1.p2-3)...
Installing pynac (0.7.21-2)...
Installing m4rie (20150908-2)...
Installing iml (1.0.5-2)...
Installing givaro (4.0.4-2)...
Installing fflas-ffpack (2.3.2-1)...
Installing tinyxml2 (6.2.0-1)...
Installing linbox (1.5.2-7)...
Installing rubiks (20070912-3)...
Installing pari-galdata (20080411-2)...
Installing pari-seadata-small (20090618-2)...
Installing planarity (3.0.0.5-1)...
Installing arpack (3.6.0-1)...
Installing igraph (0.7.1-7)...
Installing rankwidth (0.7-2)...
Installing tachyon (0.98.9-4)...
Installing sage-data-combinatorial_designs (20140630-2)...
Installing sage-data-elliptic_curves (0.8-2)...
Installing sage-data-graphs (20161026-1)...
Installing sage-data-polytopes_db (20170220-1)...
Installing sage-data-conway_polynomials (0.5-2)...
Installing sagemath (8.2-6)...
Running post-transaction hooks...
Updating TeXLive filename database...
Arming ConditionNeedsUpdate...
Updating the info directory file...
Updating the desktop file MIME type cache...
Updating the MIME type database...
Transaction successfully finished.

Segmentation fault (core dumped) SageMath version 8.2

Update Problem resolved. I upgraded to 8.3 beta6 from 8.2 and the core dump went away. This is using Majora package manager (Pacman is an amazing package manger. It compiled everything from source with one click of button.


Original question

I keep getting this seg fault, at same place in a script on Linux Manjaro

    /usr/bin/sage-python: line 2: 17786 Segmentation fault      (core dumped) sage -python "$@"

Update I get same core dump on Linux mint 19, using sage 8.1 at same location

>>>>>>>> doing integral number  99
/usr/share/sagemath/bin/sage-python: line 2: 14622 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. I think it might be because sage uses Python 2.7, while running Python directly, I am using python 3.6.5. So this might be an issue with the older Python sage is using? I do not know.

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 I also put the file on my site if it easier for you to download. It is in this folder

#!/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.

Here is the installation of sagemath on Manjaro

Preparing...
Resolving dependencies...
Checking inter-conflicts...
Downloading...
Downloading sagemath-8.2-6-x86_64.pkg.tar.xz...
Checking keyring...
Checking integrity...
Loading packages files...
Checking file conflicts...
Checking available disk space...
Installing python2-decorator (4.3.0-1)...
Installing python2-enum34 (1.1.6-1)...
Installing python2-traitlets (4.3.2-1)...
Installing python2-ptyprocess (0.5.2-1)...
Installing python2-pexpect (4.6.0-1)...
Installing python2-pathlib (1.0.1-4)...
Installing python2-pickleshare (0.7.4-3)...
Installing python2-backports (1.0-1)...
Installing python2-backports.shutil_get_terminal_size (1.0.0-1)...
Installing python2-pygments (2.2.0-1)...
Installing python2-wcwidth (0.1.7-2)...
Installing python2-prompt_toolkit (1.0.15-1)...
Installing ipython2 (5.6.0-1)...
Installing ppl (1.2-2)...
Installing palp (2.1-2)...
Installing m4ri (20140914-2)...
Installing brial (1.2.3-1)...
Installing cliquer (1.21-2)...
Installing ecl-16.1.2 (16.1.2-1)...
Installing maxima-ecl (5.41.0-1)...
Installing cddlib (094i-1)...
Installing gfan (0.6.2-1)...
Installing sympow (1.018.1-5)...
Installing nauty (26r10-1)...
Installing cblas (3.8.0-2)...
Installing python2-numpy (1.14.3-1)...
Installing r (3.5.0-1)...
Installing python2-rpy2 (2.8.6-2)...
Installing qd (2.3.20-1)...
Installing fplll (5.2.1-1)...
Installing python2-cysignals (1.7.1-1)...
Installing python2-fpylll (0.4.1dev-1)...
Installing python2-psutil (5.4.6-1)...
Installing python2-cypari2 (1.1.4-1)...
Installing python2-pytz (2018.4-1)...
Installing python2-sip (4.19.8-1)...
Installing python2-pyqt5 (5.10.1-3)...
Installing python2-dateutil (2.7.3-1)...
Installing python2-cycler (0.10.0-2)...
Installing python2-kiwisolver (1.0.1-1)...
Installing python2-backports.functools_lru_cache (1.5-1)...
Installing python2-matplotlib (2.2.2-2)...
Installing python2-scipy (1.1.0-1)...
Installing python2-gmpy2 (2.1.0a2-2)...
Installing python2-mpmath (1.0.0-1)...
Installing python2-sympy (1.1.1-1)...
Installing python2-networkx (2.1-2)...
Installing python2-pillow (5.1.0-1)...
Installing python2-future (0.16.0-2)...
Installing numactl (2.0.11-2)...
Installing hwloc (1.11.10-1)...
Installing openmpi (3.1.0-1)...
Installing gap (4.8.10-3)...
Installing libgap (4.8.6-6)...
Installing flintqs (1:1.0-2)...
Installing lcalc (1.23-16)...
Installing lrcalc (1.2-3)...
Installing flint (2.5.2-22)...
Installing arb (2.13.0-1)...
Installing eclib (20171219-3)...
Installing gmp-ecm (7.0.4-1)...
Installing zn_poly (0.9-4)...
Installing python2-cvxopt (1.2.0-1)...
Installing singular (4.1.1.p2-3)...
Installing pynac (0.7.21-2)...
Installing m4rie (20150908-2)...
Installing iml (1.0.5-2)...
Installing givaro (4.0.4-2)...
Installing fflas-ffpack (2.3.2-1)...
Installing tinyxml2 (6.2.0-1)...
Installing linbox (1.5.2-7)...
Installing rubiks (20070912-3)...
Installing pari-galdata (20080411-2)...
Installing pari-seadata-small (20090618-2)...
Installing planarity (3.0.0.5-1)...
Installing arpack (3.6.0-1)...
Installing igraph (0.7.1-7)...
Installing rankwidth (0.7-2)...
Installing tachyon (0.98.9-4)...
Installing sage-data-combinatorial_designs (20140630-2)...
Installing sage-data-elliptic_curves (0.8-2)...
Installing sage-data-graphs (20161026-1)...
Installing sage-data-polytopes_db (20170220-1)...
Installing sage-data-conway_polynomials (0.5-2)...
Installing sagemath (8.2-6)...
Running post-transaction hooks...
Updating TeXLive filename database...
Arming ConditionNeedsUpdate...
Updating the info directory file...
Updating the desktop file MIME type cache...
Updating the MIME type database...
Transaction successfully finished.

Segmentation fault (core dumped) SageMath version 8.2

Update Problem resolved. I upgraded to 8.3 beta6 from 8.2 and the core dump went away. This is using Majora package manager (Pacman is an amazing package manger. It compiled everything from source with one click of button.


Original question

I keep getting this seg fault, at same place in a script on Linux Manjaro

    /usr/bin/sage-python: line 2: 17786 Segmentation fault      (core dumped) sage -python "$@"

Update I get same core dump on Linux mint 19, using sage 8.1 at same location

>>>>>>>> doing integral number  99
/usr/share/sagemath/bin/sage-python: line 2: 14622 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. I think it might be because sage uses Python 2.7, while running Python directly, I am using python 3.6.5. So this might be an issue with the older Python sage is using? I do not know.

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 I also put the file on my site if it easier for you to download. It is in this folder

#!/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.

Here is the installation of sagemath on Manjaro

Preparing...
Resolving dependencies...
Checking inter-conflicts...
Downloading...
Downloading sagemath-8.2-6-x86_64.pkg.tar.xz...
Checking keyring...
Checking integrity...
Loading packages files...
Checking file conflicts...
Checking available disk space...
Installing python2-decorator (4.3.0-1)...
Installing python2-enum34 (1.1.6-1)...
Installing python2-traitlets (4.3.2-1)...
Installing python2-ptyprocess (0.5.2-1)...
Installing python2-pexpect (4.6.0-1)...
Installing python2-pathlib (1.0.1-4)...
Installing python2-pickleshare (0.7.4-3)...
Installing python2-backports (1.0-1)...
Installing python2-backports.shutil_get_terminal_size (1.0.0-1)...
Installing python2-pygments (2.2.0-1)...
Installing python2-wcwidth (0.1.7-2)...
Installing python2-prompt_toolkit (1.0.15-1)...
Installing ipython2 (5.6.0-1)...
Installing ppl (1.2-2)...
Installing palp (2.1-2)...
Installing m4ri (20140914-2)...
Installing brial (1.2.3-1)...
Installing cliquer (1.21-2)...
Installing ecl-16.1.2 (16.1.2-1)...
Installing maxima-ecl (5.41.0-1)...
Installing cddlib (094i-1)...
Installing gfan (0.6.2-1)...
Installing sympow (1.018.1-5)...
Installing nauty (26r10-1)...
Installing cblas (3.8.0-2)...
Installing python2-numpy (1.14.3-1)...
Installing r (3.5.0-1)...
Installing python2-rpy2 (2.8.6-2)...
Installing qd (2.3.20-1)...
Installing fplll (5.2.1-1)...
Installing python2-cysignals (1.7.1-1)...
Installing python2-fpylll (0.4.1dev-1)...
Installing python2-psutil (5.4.6-1)...
Installing python2-cypari2 (1.1.4-1)...
Installing python2-pytz (2018.4-1)...
Installing python2-sip (4.19.8-1)...
Installing python2-pyqt5 (5.10.1-3)...
Installing python2-dateutil (2.7.3-1)...
Installing python2-cycler (0.10.0-2)...
Installing python2-kiwisolver (1.0.1-1)...
Installing python2-backports.functools_lru_cache (1.5-1)...
Installing python2-matplotlib (2.2.2-2)...
Installing python2-scipy (1.1.0-1)...
Installing python2-gmpy2 (2.1.0a2-2)...
Installing python2-mpmath (1.0.0-1)...
Installing python2-sympy (1.1.1-1)...
Installing python2-networkx (2.1-2)...
Installing python2-pillow (5.1.0-1)...
Installing python2-future (0.16.0-2)...
Installing numactl (2.0.11-2)...
Installing hwloc (1.11.10-1)...
Installing openmpi (3.1.0-1)...
Installing gap (4.8.10-3)...
Installing libgap (4.8.6-6)...
Installing flintqs (1:1.0-2)...
Installing lcalc (1.23-16)...
Installing lrcalc (1.2-3)...
Installing flint (2.5.2-22)...
Installing arb (2.13.0-1)...
Installing eclib (20171219-3)...
Installing gmp-ecm (7.0.4-1)...
Installing zn_poly (0.9-4)...
Installing python2-cvxopt (1.2.0-1)...
Installing singular (4.1.1.p2-3)...
Installing pynac (0.7.21-2)...
Installing m4rie (20150908-2)...
Installing iml (1.0.5-2)...
Installing givaro (4.0.4-2)...
Installing fflas-ffpack (2.3.2-1)...
Installing tinyxml2 (6.2.0-1)...
Installing linbox (1.5.2-7)...
Installing rubiks (20070912-3)...
Installing pari-galdata (20080411-2)...
Installing pari-seadata-small (20090618-2)...
Installing planarity (3.0.0.5-1)...
Installing arpack (3.6.0-1)...
Installing igraph (0.7.1-7)...
Installing rankwidth (0.7-2)...
Installing tachyon (0.98.9-4)...
Installing sage-data-combinatorial_designs (20140630-2)...
Installing sage-data-elliptic_curves (0.8-2)...
Installing sage-data-graphs (20161026-1)...
Installing sage-data-polytopes_db (20170220-1)...
Installing sage-data-conway_polynomials (0.5-2)...
Installing sagemath (8.2-6)...
Running post-transaction hooks...
Updating TeXLive filename database...
Arming ConditionNeedsUpdate...
Updating the info directory file...
Updating the desktop file MIME type cache...
Updating the MIME type database...
Transaction successfully finished.

Segmentation fault (core dumped) SageMath version 8.2

Update Problem resolved. I upgraded to 8.3 beta6 from 8.2 and the Sage still core dump went away. This is using Majora package manager (Pacman is an amazing package manger. It compiled everything from source with one click of button.


Original question

I keep getting this seg fault, at same place in a script on Linux Manjarodumps. I thought earlier it was fixed, but it is not.

  /usr/bin/sage-python: line 2: 17786  2794 Segmentation fault      (core dumped) sage -python "$@"

UpdateShort summary of the problem I get same core dump : When I run a sage script which iterate over large list of integrals, then call maxima, it segfault, but only when the list is long. (trial and error shows when it is over 45 entries)

When I change the algorithm from "maxima" to "fricas", the script runs and it works. NO OTHER CHNAGES.

When the list is short, using maxima no longer causes a segfault. So it seems like a memory corruption for me.

Why when the list is short it works, but when adding one more entry to the list, it segfault? And only when using maxima?

The script is long, since the list is long. So I was not sure if I should post it here. (I could if needed) but I put a link to it here. Please see https://www.12000.org/tmp/sage_segfault/test_maxima.sage

To run, simply download to any folder and type ./test_maxima.sage

It will segfault. I tried it on sage 8.2, sage 8.1, sage 8.3 beta 6. On latest Manjora linux 17.1 and also on Linux mint 19, using sage 8.1 at same location

>>>>>>>> doing integral number  99
/usr/share/sagemath/bin/sage-python: line 2: 14622 Segmentation fault      (core dumped) sage -python "$@"

19

Could someone please try this script to see if they get the segfault? Otherwise, I could not test maxima for integration and will have just leave it out.

Segmentation fault (core dumped) SageMath version 8.2

Sage still core dumps. I thought earlier it was fixed, but it is not.

 /usr/bin/sage-python: line 2:  2794 Segmentation fault      (core dumped) sage -python "$@"

Short summary of the problem: When I run a sage script which iterate iterates over large list of integrals, then call maxima, it segfault, but only when the list is long. (trial and error shows when it is over 45 entries)

When I change the algorithm from "maxima" to "fricas", the script runs and it works. NO OTHER CHNAGES.

When the list is short, using maxima no longer causes a segfault. So it seems like a memory corruption for me.

Why when the list is short it works, but when adding one more entry to the list, it segfault? And only when using maxima?maxima?

The script uses Python multiprocessing.

The script is long, since but only because the list is long. So I was not sure if I should post it here. (I could if needed) but I put a link to it here. Please see https://www.12000.org/tmp/sage_segfault/test_maxima.sage

To run, simply download to any folder and type ./test_maxima.sage

It will segfault. I tried it on sage 8.2, sage 8.1, sage 8.3 beta 6. On latest Manjora linux 17.1 and also on Linux mint 19

Could someone please try this script to see if they get the segfault? Otherwise, I could not test maxima for integration and will have just leave it out.

Segmentation fault (core dumped) SageMath version 8.2

Sage still core dumps. I thought earlier it was fixed, but it is not.

 /usr/bin/sage-python: line 2:  2794 Segmentation fault      (core dumped) sage -python "$@"

Short summary of the problem: When I run a sage script which iterates over large list of integrals, then call maxima, it segfault, but only when the list is long. (trial and error shows when it is over 45 entries)

When I change the algorithm from "maxima" to "fricas", the script runs and it works. NO OTHER CHNAGES.

When the list is short, using maxima no longer causes a segfault. So it seems like a memory corruption for me.

Why when the list is short it works, but when adding one more entry to the list, it segfault? And only when using maxima?

The script uses Python multiprocessing.

The script is long, but only because the list is long. So I was not sure if I should post it here. (I could if needed) but I put a link to it here. Please see https://www.12000.org/tmp/sage_segfault/test_maxima.sage

To run, simply download to any folder and type ./test_maxima.sage

It will segfault. I tried it on sage 8.2, sage 8.1, sage 8.2, sage 8.1, sage 8.3 beta 6. 6. On latest Manjora linux 17.1 17.1 and also on Linux mint 19 and tried it on standalone PC running Linux and inside Virtual box running Linux.

Could someone please try this script to see if they get the segfault? Otherwise, I could not test maxima for integration and will have just leave it out.

Segmentation fault (core dumped) SageMath version 8.2

Sage still core dumps. I thought earlier it was fixed, but it is not.

 /usr/bin/sage-python: line 2:  2794 Segmentation fault      (core dumped) sage -python "$@"

Short summary of the problem: When I run a sage script which iterates over large list of integrals, then call maxima, it segfault, but only when the list is long. (trial and error shows when it is over 45 entries)

When I change the algorithm from "maxima" to "fricas", the script runs and it works. NO OTHER CHNAGES.

When the list is short, using maxima no longer causes a segfault. So it seems like a memory corruption for me.

Why when the list is short it works, but when adding one more entry to the list, it segfault? And only when using maxima?

The script uses Python multiprocessing.

The script is long, but only because the list is long. So I was not sure if I should post it here. (I could if needed) but I put a link to it here. Please see https://www.12000.org/tmp/sage_segfault/test_maxima.sage

To run, simply download to any folder and type ./test_maxima.sage

It will segfault. I tried it on sage 8.2, sage 8.1, sage 8.3 beta 6. On latest Manjora linux 17.1 and also on Linux mint 19 and tried it on standalone PC running Linux and inside Virtual box running Linux.

Could someone please try this script to see if they get the segfault? Otherwise, I could not test maxima for integration and will have just leave it out.out. I do not know where the dump file is written to. Does any one know? I do not see it in same folder I am running the script from.