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

Memory leak in comparison of sqlite.Row objects #82356

Closed
serhiy-storchaka opened this issue Sep 15, 2019 · 5 comments
Closed

Memory leak in comparison of sqlite.Row objects #82356

serhiy-storchaka opened this issue Sep 15, 2019 · 5 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@serhiy-storchaka
Copy link
Member

BPO 38175
Nosy @berkerpeksag, @serhiy-storchaka, @miss-islington
PRs
  • bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. #16155
  • [3.8] bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155) #16193
  • [3.7] bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155) #16194
  • [2.7] bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155). #16215
  • 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-09-17.06:56:48.525>
    created_at = <Date 2019-09-15.07:29:06.991>
    labels = ['3.8', '3.7', 'library', '3.9', 'performance']
    title = 'Memory leak in comparison of sqlite.Row objects'
    updated_at = <Date 2019-09-17.06:56:48.524>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2019-09-17.06:56:48.524>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-09-17.06:56:48.525>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2019-09-15.07:29:06.991>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38175
    keywords = ['patch']
    message_count = 5.0
    messages = ['352465', '352558', '352601', '352602', '352614']
    nosy_count = 4.0
    nosy_names = ['ghaering', 'berker.peksag', 'serhiy.storchaka', 'miss-islington']
    pr_nums = ['16155', '16193', '16194', '16215']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue38175'
    versions = ['Python 2.7', 'Python 3.7', 'Python 3.8', 'Python 3.9']

    @serhiy-storchaka
    Copy link
    Member Author

    There is a memory leak in comparison of sqlite.Row objects when row descriptors are different. There were not tests for this case.

    Also, the code compares the result of PyObject_RichCompare() with Py_True and Py_False. It is better to avoid such code, because technically PyObject_RichCompare() can return an arbitrary value, although in this particular case description can only be tuple or None (or NULL, but this is other issue).

    Also, there is a test for inequality of hash codes. Since hashes depend on hashes of strings, they value is random, and there is a small chance of failure. Hashes should not be tested for inequality.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir performance Performance or resource usage labels Sep 15, 2019
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 8debfa5 by Serhiy Storchaka in branch 'master':
    bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)
    8debfa5

    @miss-islington
    Copy link
    Contributor

    New changeset f04299d by Miss Islington (bot) in branch '3.8':
    bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)
    f04299d

    @miss-islington
    Copy link
    Contributor

    New changeset 4ac1be2 by Miss Islington (bot) in branch '3.7':
    bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)
    4ac1be2

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset be257bc by Serhiy Storchaka in branch '2.7':
    [2.7] bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155). (GH-16215)
    be257bc

    @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.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes performance Performance or resource usage stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants