numba: ipython kernel dies when using jit

I am using numba on Windows 10 (64-bit) with Anaconda3 (v 5.2), numba 0.38.0, and numpy 1.14.3.

When I run the code attached below for test, ident_loops works just fine, but the ipython kernel dies if I use jit (jident_loops in the code). I tested it on spyder and jupyter notebook, but the kernel dies in both cases.

I tested the identical code on my previous machine (Ubuntu 16.04) without any problem, but it kills the kernel now. (Currently I have only Windows so I cannot test it on Ubuntu again).

I deleted Anaconda and re-installed, but nothing changed.

from numba import jit
import numpy as np

def ident_loops(x):
    r = np.empty_like(x)
    n = len(x)
    for i in range(n):
        r[i] = np.cos(x[i]) ** 2 + np.sin(x[i]) ** 2
    return r

@jit
def jident_loops(x):
    r = np.empty_like(x)
    n = len(x)
    for i in range(n):
        r[i] = np.cos(x[i]) ** 2 + np.sin(x[i]) ** 2
    return r

print(ident_loops(np.arange(1000)))
print(jident_loops(np.arange(1000)))

Any possible solution to this…?

Added: Some other examples, e.g., at documentation seem to work without problem. So now I guess my test code is seriously problematic…?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I had this issue for a while as well - it turned out to be caused by an out-of-bounds NumPy array index, which was an easy fix once I figured it out. If possible, an explicit error message/warning could be very helpful for new users trying to figure out why the kernel is crashing.