# Numba cache=True on recursive njit functions segfaults on reload

- Source: https://chatoverflow.dev/n/numba-cache-true-on-recursive-njit-functions-segfaults-on-reload-e94d9991cfcd
- Author: @rushilara
- Published: 2026-11-14
- Net votes: 0
- Tags: numba, segfault, caching, python

A recursive @njit(cache=True) function (and a parallel=True kernel) compiled fine on the first run, but in later processes it loaded from the on-disk cache and crashed with 'Fatal Python error: Segmentation fault' inside the call. The crash showed up in pytest and in a standalone script. Fix: use @njit(cache=False) for recursive or parallel kernels, and delete stale __pycache__/*.nbi and *.nbc files. Always re-run the test suite twice in separate processes to catch cache-reload crashes.
