Skip to content

BUG: segfault in devdeps CI due to numpy-dev bug #15797

Closed

Description

@neutrinoceros

Description

There's a new crash in devdeps CI, see for instance
https://github.com/astropy/astropy/actions/runs/7362669671/job/20041336702?pr=15795

So far, all I did was checked that I could reproduce locally with numpy dev, which is already good news.
I will take a deeper look on Monday.

Expected behavior

No response

How to Reproduce

# install numpy dev
python -m pip install git+https://github.com/numpy/numpy.git

# build astropy and pyerfa against numpy dev
python -m pip install -e . --no-build-isolation
python -m pip install git+https://github.com/liberfa/pyerfa.git --no-build-isolation

# run tests
pytest astropy

Versions

import platform; print(platform.platform())
import sys; print("Python", sys.version)
import astropy; print("astropy", astropy.__version__)
import numpy; print("Numpy", numpy.__version__)
import erfa; print("pyerfa", erfa.__version__)

# not installed
# import scipy; print("Scipy", scipy.__version__)
# import matplotlib; print("Matplotlib", matplotlib.__version__)
macOS-14.2.1-arm64-arm-64bit
Python 3.12.0 (main, Oct 27 2023, 11:50:57) [Clang 15.0.0 (clang-1500.0.40.1)]
astropy 6.1.dev249+g6568d90661
Numpy 2.0.0.dev0+git20231230.ee3124b
pyerfa 2.0.1.2.dev11+gc498084

Activity

  1. neutrinoceros commented on Dec 31, 2023

    @neutrinoceros
    ContributorAuthor

    I was able to reduce the reproducer to

    import os
    import tempfile
    
    import numpy as np
    
    from astropy.io import fits
    
    r1 = np.array([11.0, 12.0])
    c2 = fits.Column(name="def", format="D", array=r1, bscale=2.3, bzero=0.6)
    x = fits.ColDefs([c2])
    hdu = fits.TableHDU.from_columns(x)
    tmp_file = os.path.join(tempfile.mkdtemp(), "tmp.fits")
    hdu.writeto(tmp_file)
    with fits.open(tmp_file) as hdul:
        b = hdul[1].data
        b.field(0)

    It can probably be reduced even further but as it's very likely to be a regression in numpy dev, I think the next natural step would be to bisect the breaking change.

  2. neutrinoceros commented on Dec 31, 2023

    @neutrinoceros
    ContributorAuthor
  3. neutrinoceros commented on Dec 31, 2023

    @neutrinoceros
    ContributorAuthor

    I managed to boil it down to a pure numpy reproducer

    import numpy as np
    
    carr = np.chararray((2,), itemsize=25)
    carr[:] = [b'  4.52173913043478315E+00', b'  4.95652173913043548E+00']
    carr.replace(b"E", b"D")

    now let's report this upstream

  4. neutrinoceros commented on Dec 31, 2023

    @neutrinoceros
    ContributorAuthor

    (partially) reported upstream as numpy/numpy#25513
    I'll try to add a full debugger backtrace to my report if I can setup my dev env properly.

  5. changed the title [-]BUG: segfault in devdeps CI[/-] [+]BUG: segfault in devdeps CI due to numpy-dev bug[/+] on Dec 31, 2023
  6. mhvk commented on Dec 31, 2023

    @mhvk
    Contributor

    Thanks for the sleuthing!

  7. mhvk commented on Dec 31, 2023

    @mhvk
    Contributor

    Numpy fix (hopefully) in numpy/numpy#25515

  8. neutrinoceros commented on Jan 1, 2024

    @neutrinoceros
    ContributorAuthor

    Awesome, thanks a lot @mhvk !
    I checked and confirm that numpy/numpy#25515 resolves this issue.

  9. pllim commented on Jan 3, 2024

    @pllim
    Member

    I guess we have to wait another week for the wheel? Thanks!

  10. neutrinoceros commented on Jan 4, 2024

    @neutrinoceros
    ContributorAuthor

    I just checked: latest wheels have @mhvk 's fix, so this can be closed.
    Latest runs show different failures (see for instance https://github.com/astropy/astropy/actions/runs/7403671515/job/20143903520?pr=15795). I'll open a new issue for it !

    edit: after more thorough inspection of my notification stack, I think #15807 already describes the very same issues, even if it's not focused on devdeps !

  11. pllim commented on Jan 4, 2024

    @pllim
    Member

    Ah, yes, indeed the segfault is gone. Looks like this line that is needed for something else has turned devdeps into predeps also:

    astropy/tox.ini

    Line 114 in 8737067

    devdeps: python -I -m pip install -v --pre

    So, yes, the predeps fix would also fix devdeps. Thanks for checking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions