Description
Describe the issue:
In astropy.time
, we use a custom gufunc
to parse unicode strings into a structure holding time information. With numpy 2.3.0, that breaks, but only if the number of string inputs is larger than 500. Since our gufunc is just passed that number of elements by the iterator, it seems unlikely it is a problem in our code (also, it worked in all previous versions).
Posting this now, before trying to find out which commit broke it, because perhaps the number 500 rings a bell for someone.
Note that this was discovered on windows, but confirmed under linux, so presumably is a general problem - astropy/astropy#18254
Reproduce the code example:
from astropy.time import Time
Time(['J2000.0']*501)
Segmentation fault (core dumped)
Error message:
Python and NumPy Versions:
2.4.0.dev0+git20250609.30a4883
3.13.3 (main, Apr 10 2025, 21:38:51) [GCC 14.2.0]
Runtime Environment:
[{'numpy_version': '2.4.0.dev0+git20250609.30a4883',
'python': '3.13.3 (main, Apr 10 2025, 21:38:51) [GCC 14.2.0]',
'uname': uname_result(system='Linux', node='dolphin', release='6.12.27-amd64', version='#1 SMP PREEMPT_DYNAMIC Debian 6.12.27-1 (2025-05-06)', 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',
'AVX512_SPR']}},
{'architecture': 'Haswell',
'filepath': '/home/mhvk/data/mhvk/packages/astropy/.tox/test-devdeps/lib/python3.13/site-packages/numpy.libs/libscipy_openblas64_-56d6093b.so',
'internal_api': 'openblas',
'num_threads': 4,
'prefix': 'libscipy_openblas',
'threading_layer': 'pthreads',
'user_api': 'blas',
'version': '0.3.29'}]
Context for the issue:
Actual C code of our gufunc at https://github.com/astropy/astropy/blob/main/astropy/time/src/parse_times.c