What steps will reproduce the problem?
This segfaults python.
def f(): a = np.arange(10000000) string = "(a==3) | (a==1)" eval(string)
def f(): a = np.arange(10000000) string = "(a==3) | (a==1)" ne.evaluate(string)
print timeit.repeat("f()","from main import f",number=10);
What is the expected output? What do you see instead?
The code should redefine f and run normally, producing e.g. some timing information. Instead you get a segfault.
Removing the first definition of f() results in this output: [0.7341048717498779, 0.7121732234954834, 0.6966848373413086] (which incidentally, is slower than numpy by 5-10%...)
Similarly replacing ne.evaluate with eval in the second definition prevents the segfault. so the segfault is being caused by numexpr and the function redefinition somehow.
What version of the product are you using? On what operating system?
python 2.7, macos numexpr 1.4.2
Please provide any additional information below.
Comment #1
Posted on Aug 29, 2013 by Quick ElephantHi I cannot reproduce your problem using numexpr 2.1.
I am going to close this, but feel free to reopen it in case you continue experiencing the problem with a newer numexpr.
Comment #2
Posted on Aug 29, 2013 by Happy DogOK, will try again if I try out numexpr again in future. Glad to hear it may be fixed.
Status: Invalid
Labels:
Type-Defect
Priority-Medium