Skip to content

Segmentation fault with KDTree #14527

Closed
Closed
@dopplershift

Description

@dopplershift

When running the code below (boiled down from the original producer) I get a segmentation fault.

Reproducing code example:

import numpy as np
from scipy.spatial import KDTree

points = np.arange(34.).reshape(-1, 2)
points[0] = np.nan
points[8] = np.nan
KDTree(points)

Error message:

❯ python test_crash.py
[1]    89987 segmentation fault  python test_crash.py

Scipy/Numpy/Python version information:

1.7.1 1.21.1 sys.version_info(major=3, minor=9, micro=6, releaselevel='final', serial=0)

I'm running this locally on macOS 11.5 (x86_64), but original issue was seen on Ubuntu 20.04.2 (GitHub Actions). The MetPy test that now segfaults passes fine with Scipy 1.7.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.spatial

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions