Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault (crash) when calling numpy np.isnan repeatedly in nopython parallel function #9167

Closed
2 tasks done
limwz01 opened this issue Aug 28, 2023 · 2 comments
Closed
2 tasks done
Labels
bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS duplicate ParallelAccelerator

Comments

@limwz01
Copy link

limwz01 commented Aug 28, 2023

Reporting a bug

  • I have tried using the latest released version of Numba (most recent is
    visible in the change log (https://github.com/numba/numba/blob/main/CHANGE_LOG).
  • I have included a self contained code sample to reproduce the problem.
    i.e. it's possible to run as 'python bug.py'.

numba crashes when calling numpy np.isnan repeatedly in nopython parallel function:

#!/usr/bin/env python3
import numba
import numpy as np


def main():
    bug()


@numba.njit(parallel=True)
def bug():
    for j in range(50000):
        np.isnan(np.full(1, 0.0))


if __name__ == "__main__":
    main()

Result with Python 3.8 on Ubuntu 20.04 (other versions may need different number of iterations?):

Segmentation fault (core dumped)
@limwz01 limwz01 changed the title crash when calling numpy np.isnan repeatedly in nopython parallel function segfault (crash) when calling numpy np.isnan repeatedly in nopython parallel function Aug 28, 2023
@sklam
Copy link
Member

sklam commented Aug 28, 2023

I can confirm the segfault on OSX with py3.9 after increasing number of iteration to 5000000.

@sklam sklam added bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS duplicate ParallelAccelerator labels Aug 28, 2023
@sklam
Copy link
Member

sklam commented Aug 28, 2023

This is another instance of #9029 and will be fixed by #9048.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS duplicate ParallelAccelerator
Projects
None yet
Development

No branches or pull requests

2 participants