Skip to content

ImportError: _ssl.so: undefined symbol: _PyModule_Add#108525

@0x2b3bfa0

Description

@0x2b3bfa0

Bug report

Environment

$ unameLinux $ python --version{,}Python 3.11.4 (tags/v3.11.4:d2340ef257, Aug 26 2023, 22:42:28) [GCC 12.2.0]

Description

Importing the ssl shared library from a Python 3.11.5 build from a Python 3.11.4 binary produces an ImportError due to an undefined symbol. Isn't CPython's ABI supposed to be fully compatible between patch releases?

CPython’s Application Binary Interface (ABI) is forward- and backwards-compatible across a minor release.

Example

FROM debian RUN apt update\ && apt install --yes build-essential git libssl-dev zlib1g-dev RUN git clone --branch v3.11.4 https://github.com/python/cpython 3.11.4\ && cd 3.11.4 && ./configure && make RUN git clone --branch v3.11.5 https://github.com/python/cpython 3.11.5\ && cd 3.11.5 && ./configure && make RUN mv 3.11.5/build/lib.linux-x86_64-3.11/_ssl.cpython-311-x86_64-linux-gnu.so\ 3.11.4/build/lib.linux-x86_64-3.11/_ssl.cpython-311-x86_64-linux-gnu.so RUN 3.11.4/python -m ssl

Error

Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "//3.11.2/Lib/ssl.py", line 100, in <module> import _ssl # if we can't import it, let the error propagate ^^^^^^^^^^^ ImportError: //3.11.2/build/lib.linux-x86_64-3.11/_ssl.cpython-311-x86_64-linux-gnu.so: undefined symbol: _PyModule_Add 

Observations

It looks like fced79f is the breaking commit, as per git bisect results.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions