hi people! have a question for you. I am using a code that makes almost no use of root, a part from using some numpy arrays produced with AsNumpy in RDF as input to a scipy minimizer. The problem arises when i parallelise some independent pieces of calculation (executed in numpy) using python threading.

here sometimes i get a segfault from root. this is the error i am getting:

```
The lines below might hint at the cause of the crash [....]
# that might help us fixing this issue.
#6 0x00007f186ed1a0ed in getenv () from /lib64/libc.so.6
#7 0x00007f186d17cd89 in mkl_serv_getenv () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/../../../../libmkl_rt.so
#8 0x00007f185af92b61 in mkl_vml_kernel_ReadEnvVarMode () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/../../../../libmkl_vml_def.so
#9 0x00007f185af928f3 in mkl_vml_kernel_GetMode () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/../../../../libmkl_vml_def.so
#10 0x00007f185af928c6 in mkl_vml_kernel_GetTTableIndex () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/../../../../libmkl_vml_def.so
#11 0x00007f185e58b2e0 in vsLinearFrac () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/../../../../libmkl_intel_lp64.so
#12 0x00007f1869e94868 in trivial_three_operand_loop () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/umath.so
#13 0x00007f1869e942ed in execute_legacy_ufunc_loop.A () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/umath.so
#14 0x00007f1869e8297d in PyUFunc_GenericFunction.A () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/umath.so
#15 0x00007f1869e7e75e in ufunc_generic_call.A () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/umath.so
#16 0x00007f186fa2d9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0
#17 0x00007f186fa2e29c in PyObject_CallFunctionObjArgs () from /lib64/libpython2.7.so.1.0
#18 0x00007f186daae19e in array_add () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/multiarray.so
#19 0x00007f1869ec63c5 in double_add () from /home/users/emanca/.local/lib/python2.7/site-packages/numpy/core/umath.so
#20 0x00007f186fa2989c in binary_op1 () from /lib64/libpython2.7.so.1.0
#21 0x00007f186fa2b511 in PyNumber_Add () from /lib64/libpython2.7.so.1.0
#22 0x00007f186fac1ecc in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#23 0x00007f186fac657d in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#24 0x00007f186fac8efd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#25 0x00007f186fa5294d in function_call () from /lib64/libpython2.7.so.1.0
#26 0x00007f186fa2d9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0
#27 0x00007f186fac15bd in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#28 0x00007f186fac657d in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#29 0x00007f186fac657d in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#30 0x00007f186fac8efd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#31 0x00007f186fa52858 in function_call () from /lib64/libpython2.7.so.1.0
#32 0x00007f186fa2d9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0
#33 0x00007f186fa3c995 in instancemethod_call () from /lib64/libpython2.7.so.1.0
#34 0x00007f186fa2d9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0
#35 0x00007f186fabf7b7 in PyEval_CallObjectWithKeywords () from /lib64/libpython2.7.so.1.0
#36 0x00007f186faf76e2 in t_bootstrap () from /lib64/libpython2.7.so.1.0
#37 0x00007f186f7c9e25 in start_thread () from /lib64/libpthread.so.0
#38 0x00007f186edda34d in clone () from /lib64/libc.so.6
```

and sometimes also this

```
Error in <TClingCallFunc::IFacePtr(kind)>: Attempt to get interface while invalid
```

repeated for every thread.

Do you have any idea? I am puzzled since I am actually not using root in my code. This is the function that gets called by a scipy minimiser:

```
def nllSimul(x, nEtaBins, datasetJ, datasetZ, datasetJGen, datasetZGen):
idx2D = 0
threads = []
que = Queue.Queue()
for idx in datasetZ:
if datasetZ[idx]["mass"].shape[0]<1:
continue
i = idx[0]
j = idx[1]
idx2D+=1
t = threading.Thread(target=lambda q, x,nEtaBins,i,j,datasetZ,datasetZGen: q.put(nllZ(x,nEtaBins,i,j,datasetZ,datasetZGen)), args=(que, x,nEtaBins,i,j,datasetZ,datasetZGen))
t.start()
threads.append(t)
# Join all the threads
for t in threads:
t.join()
# Check thread's return value
nll = []
while not que.empty():
#print que.get()
nll.append(que.get())
return np.sum(np.array(nll))
```

the function that gets multithreaded contains only numpy code. I repeat that only the input “dataset*” comes from root.

Thanks in advance!

Cheers,

Elisabetta