Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py_tp_dictoffset / Py_tp_finalize are unsettable in stable API #82321

Closed
DinoV opened this issue Sep 12, 2019 · 9 comments
Closed

Py_tp_dictoffset / Py_tp_finalize are unsettable in stable API #82321

DinoV opened this issue Sep 12, 2019 · 9 comments
Assignees
Labels
3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@DinoV
Copy link
Contributor

DinoV commented Sep 12, 2019

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']

    @DinoV
    Copy link
    Contributor Author

    DinoV commented Sep 12, 2019

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

    @DinoV DinoV added the 3.9 only security fixes label Sep 12, 2019
    @DinoV DinoV self-assigned this Sep 12, 2019
    @DinoV DinoV added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Sep 12, 2019
    @DinoV
    Copy link
    Contributor Author

    DinoV commented Sep 19, 2019

    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

    @DinoV DinoV closed this as completed Sep 19, 2019
    @encukou
    Copy link
    Member

    encukou commented Sep 24, 2019

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

    @encukou encukou reopened this Sep 24, 2019
    @encukou
    Copy link
    Member

    encukou commented Sep 25, 2019

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

    @shihai1991
    Copy link
    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

    @encukou
    Copy link
    Member

    encukou commented Sep 25, 2019

    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]
    

    @eduardo-elizondo
    Copy link
    Mannequin

    eduardo-elizondo mannequin commented Sep 27, 2019

    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

    @eduardo-elizondo
    Copy link
    Mannequin

    eduardo-elizondo mannequin commented Oct 3, 2019

    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

    @encukou
    Copy link
    Member

    encukou commented Oct 8, 2019

    Thank you all!

    @encukou encukou closed this as completed Oct 8, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants