Skip to content

The type of ob_exports in PyByteArrayObject become Py_ssize_t. #82646

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
shihai1991 opened this issue Oct 13, 2019 · 6 comments
Closed

The type of ob_exports in PyByteArrayObject become Py_ssize_t. #82646

shihai1991 opened this issue Oct 13, 2019 · 6 comments
Labels
3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@shihai1991
Copy link
Member

BPO 38465
Nosy @serhiy-storchaka, @shihai1991
PRs
  • bpo-38465: Convert the type of ob_exports in PyByteArrayObject to Py_ssize_t #16746
  • 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 = <Date 2019-10-21.06:32:44.797>
    created_at = <Date 2019-10-13.14:57:15.852>
    labels = ['interpreter-core', 'type-feature', '3.9']
    title = 'The type of ob_exports in PyByteArrayObject become Py_ssize_t.'
    updated_at = <Date 2019-10-21.06:32:44.795>
    user = 'https://github.com/shihai1991'

    bugs.python.org fields:

    activity = <Date 2019-10-21.06:32:44.795>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-10-21.06:32:44.797>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2019-10-13.14:57:15.852>
    creator = 'shihai1991'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38465
    keywords = ['patch']
    message_count = 6.0
    messages = ['354586', '354587', '354866', '354913', '355023', '355024']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'shihai1991']
    pr_nums = ['16746']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue38465'
    versions = ['Python 3.9']

    @shihai1991
    Copy link
    Member Author

    for a code example:
    v = []
    b = bytearray(0xffff)
    for i in range(2**31+1)
        # the ob_exports would be overflow in 32 bit machine when i = 2**31.
        v.append(memoryview(b))
    

    IMHO, i thought converting the type of ob_exports to Py_ssize_t is fine.

    PS: I have no actual user scenario.

    @shihai1991 shihai1991 added 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Oct 13, 2019
    @shihai1991
    Copy link
    Member Author

    sorry, typo error.
    # the ob_exports would be overflow in 32 bit machine when i = 2**31.
    -->
    # the ob_exports would be overflow in 64 bit machine when i = 2**31.

    @serhiy-storchaka
    Copy link
    Member

    See also array and mmap.

    @shihai1991
    Copy link
    Member Author

    Thanks, Serhiy, you are right.

    @serhiy-storchaka
    Copy link
    Member

    New changeset 06cd5b6 by Serhiy Storchaka (Hai Shi) in branch 'master':
    bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16746)
    06cd5b6

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your contribution hai shi!

    @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) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants