Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PyType_FromSpec wrong behavior with multiple Py_tp_members #80712

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

Closed
eduardo-elizondo mannequin opened this issue Apr 4, 2019 · 3 comments
Closed

PyType_FromSpec wrong behavior with multiple Py_tp_members #80712

eduardo-elizondo mannequin opened this issue Apr 4, 2019 · 3 comments

Comments

@eduardo-elizondo
Copy link
Mannequin

eduardo-elizondo mannequin commented Apr 4, 2019

BPO 36531
Nosy @eduardo-elizondo, @iritkatriel
PRs
  • bpo-36531: Only count number of members once in PyType_FromSpec #12691
  • 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 = None
    closed_at = None
    created_at = <Date 2019-04-04.23:53:40.353>
    labels = []
    title = 'PyType_FromSpec wrong behavior with multiple Py_tp_members'
    updated_at = <Date 2020-10-16.22:20:42.440>
    user = 'https://github.com/eduardo-elizondo'

    bugs.python.org fields:

    activity = <Date 2020-10-16.22:20:42.440>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2019-04-04.23:53:40.353>
    creator = 'eelizondo'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36531
    keywords = ['patch']
    message_count = 2.0
    messages = ['339468', '378769']
    nosy_count = 2.0
    nosy_names = ['eelizondo', 'iritkatriel']
    pr_nums = ['12691']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36531'
    versions = []

    @eduardo-elizondo
    Copy link
    Mannequin Author

    eduardo-elizondo mannequin commented Apr 4, 2019

    If a user accidentally defined more than one Py_tp_members in the spec, PyType_FromSpec will ignore all but the last use case. However, the number of members count will cause the type to allocate more memory than needed. This leads to weird behavior and crashes.

    The solution is a one line fix to just restart the count if multiple Py_tp_members are defined.

    @iritkatriel
    Copy link
    Member

    Can this be closed? Or did you keep it open in order to add a unit test?

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @erlend-aasland erlend-aasland added the pending The issue will be closed if no feedback is provided label May 20, 2022
    @kumaraditya303
    Copy link
    Contributor

    Fixed by #93471

    @AA-Turner AA-Turner removed the pending The issue will be closed if no feedback is provided label Jun 19, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants