Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: Segmentation fault when misusing masked_object #29299

@BergLucas

Description

@BergLucas

Describe the issue:

Hi,

For a research paper, we carried out a large-scale benchmark of Pynguin, an Automatic Unit Test Generation Tool for Python, to test its new feature that can find Python interpreter crashes. In this benchmark, we found a potential bug in numpy, and we are making this issue to report it.

Reproduce the code example:

from numpy.ma import masked_object

var = masked_object(None, None)
var.fill(var)

var & var

Error message:

Segmentation fault (core dumped)

Sorry, I couldn't dump the GDB traceback. I have a circular import issue with the module numpy.version, and I can't seem to fix it.

Python and NumPy Versions:

2.2.6
3.10.16 | packaged by conda-forge | (main, Apr 8 2025, 20:53:32) [GCC 13.3.0]

Runtime Environment:

[{'numpy_version': '2.2.6',
'python': '3.10.16 | packaged by conda-forge | (main, Apr 8 2025, 20:53:32) '
'[GCC 13.3.0]',
'uname': uname_result(system='Linux', node='lucas-hp', release='6.14.11-300.fc42.x86_64', version='#1 SMP PREEMPT_DYNAMIC Tue Jun 10 16:24:16 UTC 2025', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2'],
'not_found': ['AVX512F',
'AVX512CD',
'AVX512_KNL',
'AVX512_KNM',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL']}},
{'architecture': 'Haswell',
'filepath': '/home/lucas/Documents/results/venvs/numpy-venv-8285b75700b6ef1fd258885a64b0bcfafe5de845aa6d4e0239b399353e26a5df/lib/python3.10/site-packages/numpy.libs/libscipy_openblas64_-56d6093b.so',
'internal_api': 'openblas',
'num_threads': 12,
'prefix': 'libscipy_openblas',
'threading_layer': 'pthreads',
'user_api': 'blas',
'version': '0.3.29'}]

Context for the issue:

It's not a serious problem, but we thought it was important to at least warn you that this behaviour exists, so that you can take the action that suits you best.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions