BUG: numpy.format_float_positional
causes Segmentaion Fault when accepting a large pad_left
#28068
Labels
Milestone
Describe the issue:
I was working on plfuzz, an automatic Python library testing tool, and the tool found that if we pass a large
pad_left
tonumpy.format_float_positional
, NumPy crashes with Segmentation Fault.The documentation says:
It's seams that a large
pad_left
meets the requirement of "non-negative integer", but thenumpy.format_float_positional
crashes.I think this is not a serious bug, but it might be a good idea to fix it so that it is more user-friendly in the event of a user error.
Reproduce the code example:
Error message:
Python and NumPy Versions:
2.2.1
3.13.0 | packaged by Anaconda, Inc. | (main, Oct 7 2024, 21:29:38) [GCC 11.2.0]
Runtime Environment:
[{'numpy_version': '2.2.1',
'python': '3.13.0 | packaged by Anaconda, Inc. | (main, Oct 7 2024, '
'21:29:38) [GCC 11.2.0]',
'uname': uname_result(system='Linux', node='a475b702ecc0', release='5.4.0-150-generic', version='#167~18.04.1-Ubuntu SMP Wed May 24 00:51:42 UTC 2023', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2',
'AVX512F',
'AVX512CD',
'AVX512_SKX',
'AVX512_CLX'],
'not_found': ['AVX512_KNL',
'AVX512_KNM',
'AVX512_CNL',
'AVX512_ICL']}},
{'architecture': 'SkylakeX',
'filepath': '/root/miniconda3/envs/py313/lib/python3.13/site-packages/numpy.libs/libscipy_openblas64_-6bb31eeb.so',
'internal_api': 'openblas',
'num_threads': 64,
'prefix': 'libscipy_openblas',
'threading_layer': 'pthreads',
'user_api': 'blas',
'version': '0.3.28'}]
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: