Skip to content

[3.11/main] gh-101579 broke binary compatibility #101635

Closed

Description

@ismail

On a system with

GNU C Library (GNU libc) stable release version 2.26
gcc version 10.3.1 20210422 (Red Hat 10.3.1-1) (GCC)

Using precompiled version of numpy (numpy-1.24.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl), after cf89c16486a4cc297413e17d32082ec4f389d725 I get:

❯❯❯ import numpy
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[1], line 1
----> 1 import numpy

File /local/home/idoenmez/envs/workbench/lib/python3.11/site-packages/numpy/__init__.py:152
    150 from . import fft
    151 from . import polynomial
--> 152 from . import random
    153 from . import ctypeslib
    154 from . import ma

File /local/home/idoenmez/envs/workbench/lib/python3.11/site-packages/numpy/random/__init__.py:180
    126 __all__ = [
    127     'beta',
    128     'binomial',
   (...)
    176     'zipf',
    177 ]
    179 # add these for module-freeze analysis (like PyInstaller)
--> 180 from . import _pickle
    181 from . import _common
    182 from . import _bounded_integers

File /local/home/idoenmez/envs/workbench/lib/python3.11/site-packages/numpy/random/_pickle.py:1
----> 1 from .mtrand import RandomState
      2 from ._philox import Philox
      3 from ._pcg64 import PCG64, PCG64DXSM

File mtrand.pyx:1, in init numpy.random.mtrand()

ValueError: builtins.bool size changed, may indicate binary incompatibility. Expected 32 from C header, got 24 from PyObject

Works fine if I revert the faulty commit.

cc @mdickinson

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Feb 7, 2023
  2. mdickinson commented on Feb 7, 2023

    @mdickinson
    Member

    Hmm, interesting. Thanks for the report! This is something of a false positive from Cython - there was no change to the bool layout, so there should be no actual binary incompatibility. What changed is that sys.getsizeof is more accurate than it was previously.

    I don't think I understand how Cython gets the value 24, though.

    That said, the fix isn't a particularly important one, so I think we can revert for 3.11. I think the fix should stay in the main branch, though.

  3. changed the title [-][3.11/main] cf89c16486a4cc297413e17d32082ec4f389d725 broke binary compatibility[/-] [+][3.11/main] gh-101579 broke binary compatibility[/+] on Feb 7, 2023
  4. mdickinson commented on Feb 7, 2023

    @mdickinson
    Member

    The change for 3.11 was reverted in #101638.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions