GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 3.14.0a2 rebuild needed for 0x03070000 limited api c extension · Issue #127191 · python/cpython

3.14.0a2 rebuild needed for 0x03070000 limited api c extension #127191

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
3.14.0a2 rebuild needed for 0x03070000 limited api c extension#127191
Copy link
Labels
3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@MrBitBucket
MrBitBucket
opened on Nov 23, 2024
Issue body actions

Bug report

Bug description:

An existing C api extension compiled with Python 3.7-3.11 behaves differently when run in Python 3.14.0a2. Causing a reference count change where none is expected. The python test code looks like this

from sys import getrefcount
from _rl_accel import unicode2T1

utext = 'This is the end of the world'

class Font:
    def __init__(self,name):
        self.fontName = name
        self.substitutionFonts = []
        self.encName = 'utf8'

font = Font('Helvetica')

defns = 'utext font font.encName font.fontName font.substitutionFonts'.split()
rc0 = [getrefcount(eval(x,globals())) for x in defns]
print(rc0)
unicode2T1(utext,[font]+font.substitutionFonts)
rc1 = [getrefcount(eval(x,globals())) for x in defns]
print(rc1)
if rc1!=rc0:
    print('!!!!! reference counts changed !!!!!')

The C function unicode2T1 is not expected to change any of the refcounts checked, but if built with python 3.7-3.11
we see a decrease in the refcount for font.encName when running in python 3.14.0a2.

If built with python 3.14.0a2 the reference count decrease is not seen in the test. It seems that my code is broken in terms of the abi3 guarantee.

To ease checking I built a bash script to checkout and build the test environments; this can be found here.

I run this like

EARLYPYTHON=~/bin/python311 LATEPYTHON=~/bin/python314 tests/runner.sh

Sorry this example is so large, but at least reportlab is not required. We do have a python version of this code rl_accel.py

CPython versions tested on:

3.9, 3.10, 3.11, 3.12, 3.13, 3.14

Operating systems tested on:

Linux

Related

discuss.python.org/t/3-14-0a2-rebuild-needed-for-0x03070000-limited-api-c-extension/72006

Activity

  1. MrBitBucket
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Nov 23, 2024
  2. MrBitBucket commented on Nov 23, 2024

    @MrBitBucket
    MrBitBucket
    on Nov 23, 2024
    Author
    More actions

    I think this is expected now that the immortality of some/all globals is happening in Python >= 3.12. Probably I just need to build new wheels using a late python.

    Reacted by Erlend E. Aasland
  3. picnixz commented on Nov 23, 2024

    @picnixz
    picnixz
    on Nov 23, 2024
    Member
    More actions

    I'm not sure we can do anything on our side since it affects 3rd party extensions and a security-branch only. However I don't know the exact policy concerning that kind of breaking change hence I'm asking @iritkatriel or @vstinner.

  4. picnixz
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Nov 23, 2024
  5. ZeroIntensity commented on Nov 23, 2024

    @ZeroIntensity
    ZeroIntensity
    on Nov 23, 2024
    Member
    More actions

    As far as I know, the actual reference count of an object is an implementation detail, not part of the stable ABI.

  6. vstinner commented on Nov 25, 2024

    @vstinner
    vstinner
    on Nov 25, 2024
    Member
    More actions

    Can you try to write a reproducer which doesn't depend on third party code?

  7. vstinner commented on Nov 25, 2024

    @vstinner
    vstinner
    on Nov 25, 2024
    Member
    More actions

    Ah, this issue is also discussed at: https://discuss.python.org/t/3-14-0a2-rebuild-needed-for-0x03070000-limited-api-c-extension/72006

  8. picnixz
    added
    3.14bugs and security fixesbugs and security fixes
    buildThe build process and cross-buildThe build process and cross-build
    and removed
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    buildThe build process and cross-buildThe build process and cross-build
    on Dec 15, 2024
  9. erlend-aasland commented on Jan 4, 2025

    @erlend-aasland
    erlend-aasland
    on Jan 4, 2025
    Contributor
    More actions

    Based on the discussion over at DPO, it sounds to me we can close this as "not planned".

  10. erlend-aasland
    added
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Jan 4, 2025
  11. ZeroIntensity commented on Jan 4, 2025

    @ZeroIntensity
    ZeroIntensity
    on Jan 4, 2025
    Member
    More actions

    Yeah, reference counts aren't part of the stable ABI. I wonder if we should add a sys._is_immortal for situations like this, similar to how we have sys._is_interned.

    Reacted by Erlend E. Aasland
  12. erlend-aasland
    closed this as not plannedon Jan 4, 2025
  13. erlend-aasland
    removed
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Jan 4, 2025
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

    3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.