Skip to content

Py_tp_dictoffset / Py_tp_finalize are unsettable in stable API #82321

Closed

Description

@DinoV
BPO 38140
Nosy @DinoV, @encukou, @ericsnowcurrently, @eduardo-elizondo, @shihai1991
PRs
  • bpo-38140: Make dict and weakref offsets opaque for C heap types #16076
  • bpo-38140: Document offsets in PyMemberDef #16354
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/DinoV'
    closed_at = <Date 2019-10-08.12:18:12.316>
    created_at = <Date 2019-09-12.14:04:20.667>
    labels = ['interpreter-core', '3.9']
    title = 'Py_tp_dictoffset / Py_tp_finalize are unsettable in stable API'
    updated_at = <Date 2019-10-08.12:18:12.314>
    user = 'https://github.com/DinoV'

    bugs.python.org fields:

    activity = <Date 2019-10-08.12:18:12.314>
    actor = 'petr.viktorin'
    assignee = 'dino.viehland'
    closed = True
    closed_date = <Date 2019-10-08.12:18:12.316>
    closer = 'petr.viktorin'
    components = ['Interpreter Core']
    creation = <Date 2019-09-12.14:04:20.667>
    creator = 'dino.viehland'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38140
    keywords = ['patch']
    message_count = 9.0
    messages = ['352167', '352805', '353089', '353171', '353179', '353191', '353345', '353876', '354195']
    nosy_count = 5.0
    nosy_names = ['dino.viehland', 'petr.viktorin', 'eric.snow', 'eelizondo', 'shihai1991']
    pr_nums = ['16076', '16354']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue38140'
    versions = ['Python 3.9']

    Activity

    1. DinoV commented on Sep 12, 2019

      @DinoV
      ContributorAuthor

      This makes it impossible to port certain types to the stable ABI and remove statics from the interpreter.

    2. self-assigned this
      on Sep 12, 2019
    3. DinoV commented on Sep 19, 2019

      @DinoV
      ContributorAuthor

      New changeset 3368f3c by Dino Viehland (Eddie Elizondo) in branch 'master':
      bpo-38140: Make dict and weakref offsets opaque for C heap types (bpo-16076)
      3368f3c

    4. encukou commented on Sep 24, 2019

      @encukou
      Member

      Thanks for the feature!
      This still needs documentation, however.

    5. encukou commented on Sep 25, 2019

      @encukou
      Member

      New changeset 468f8a6 by Petr Viktorin in branch 'master':
      bpo-38140: Document offsets in PyMemberDef (GH-16354)
      468f8a6

    6. shihai1991 commented on Sep 25, 2019

      @shihai1991
      Member

      Got an compile error, i have not check the detail for now:

      python: Objects/typeobject.c:2867: PyType_FromSpecWithBases: Assertion `memb->type == 19' failed.

      i report it in bpo-38273

    7. encukou commented on Sep 25, 2019

      @encukou
      Member

      This line in _tesctcapimodule.c:
      {"__dictoffset__", T_PYSSIZET, -sizeof(void*), READONLY},

      gives a legitimate-sounding warning on a Windows buildbot:

           d:\buildarea\3.x.ware-win81-release.nondebug\build\modules\_testcapimodule.c(6409): warning C4146: unary minus operator applied to unsigned type, result still unsigned [D:\buildarea\3.x.ware-win81-release.nondebug\build\PCbuild\_testcapi.vcxproj]
      
    8. eduardo-elizondo commented on Sep 27, 2019

      eduardo-elizondomannequin
      Mannequin

      Hey Petr, I'll get to document this and fix the windows warning over the weekend. I'll ping you on Github once it's ready

    9. eduardo-elizondo commented on Oct 3, 2019

      eduardo-elizondomannequin
      Mannequin

      Woops, just realized that you already documented this, thanks! Btw, Victor already merged a fix for the windows compiler warning. This issue can be closed now

    10. encukou commented on Oct 8, 2019

      @encukou
      Member

      Thank you all!

    11. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.9 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions