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

SQLite: segfault if backup called on closed database #85981

Closed
pdmccormick mannequin opened this issue Sep 19, 2020 · 8 comments
Closed

SQLite: segfault if backup called on closed database #85981

pdmccormick mannequin opened this issue Sep 19, 2020 · 8 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@pdmccormick
Copy link
Mannequin

pdmccormick mannequin commented Sep 19, 2020

BPO 41815
Nosy @ambv, @pdmccormick, @miss-islington, @aeros
PRs
  • bpo-41815: SQLite: segfault if backup called on closed database #22322
  • [3.9] bpo-41815: SQLite: segfault if backup called on closed database (GH-22322) #22344
  • [3.8] bpo-41815: SQLite: segfault if backup called on closed database (GH-22322) #22345
  • Files
  • fix.patch
  • 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 2020-09-21.22:07:57.371>
    created_at = <Date 2020-09-19.16:08:19.437>
    labels = ['3.10', '3.8', '3.9', 'type-crash']
    title = 'SQLite: segfault if backup called on closed database'
    updated_at = <Date 2020-10-05.16:10:19.853>
    user = 'https://github.com/pdmccormick'

    bugs.python.org fields:

    activity = <Date 2020-10-05.16:10:19.853>
    actor = 'lukasz.langa'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-09-21.22:07:57.371>
    closer = 'aeros'
    components = []
    creation = <Date 2020-09-19.16:08:19.437>
    creator = 'pdmccormick'
    dependencies = []
    files = ['49464']
    hgrepos = []
    issue_num = 41815
    keywords = ['patch']
    message_count = 8.0
    messages = ['377176', '377201', '377203', '377204', '377287', '377289', '377290', '378052']
    nosy_count = 6.0
    nosy_names = ['ghaering', 'lukasz.langa', 'python-dev', 'pdmccormick', 'miss-islington', 'aeros']
    pr_nums = ['22322', '22344', '22345']
    priority = 'normal'
    resolution = None
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue41815'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @pdmccormick
    Copy link
    Mannequin Author

    pdmccormick mannequin commented Sep 19, 2020

    Attempting to backup a closed database will trigger segfault:

    target = sqlite.connect(':memory:')
    source = sqlite.connect(":memory:")
    source.close()
    source.backup(target)
    

    @pdmccormick pdmccormick mannequin added 3.7 (EOL) end of life 3.10 only security fixes 3.8 only security fixes 3.9 only security fixes type-crash A hard crash of the interpreter, possibly with a core dump labels Sep 19, 2020
    @aeros
    Copy link
    Contributor

    aeros commented Sep 20, 2020

    With this being a segfault that's simple to replicate under normal circumstances, I've elevated the priority to release blocker. I'll wait on the release manager (Lukasz) for explicit approval for backporting to 3.9 and 3.8, with both branches being in the release candidate phase.

    (The attached PR looks to be ready to be merged as well, after a Misc/NEWS entry is added by the author. See #22322 (review) for details.)

    @aeros aeros added release-blocker and removed 3.7 (EOL) end of life labels Sep 20, 2020
    @pdmccormick
    Copy link
    Mannequin Author

    pdmccormick mannequin commented Sep 20, 2020

    Updated sample script, thanks to @aeros for catching the omission:

    import sqlite3
    target = sqlite3.connect(':memory:')
    source = sqlite3.connect(':memory:')
    source.close()
    source.backup(target)
    

    @miss-islington
    Copy link
    Contributor

    New changeset bfee9fa by Peter McCormick in branch 'master':
    bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
    bfee9fa

    @miss-islington
    Copy link
    Contributor

    New changeset ca2d99d by Miss Islington (bot) in branch '3.8':
    bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
    ca2d99d

    @miss-islington
    Copy link
    Contributor

    New changeset 4ee30c4 by Miss Islington (bot) in branch '3.9':
    bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
    4ee30c4

    @aeros
    Copy link
    Contributor

    aeros commented Sep 21, 2020

    I've received approval from Lukasz to backport to 3.9 and 3.8, and have now merged the PRs.

    It could use a post-commit review from a core dev that has some additional experience with SQLite3, but it can be de-escalated from release blocker.

    @ambv
    Copy link
    Contributor

    ambv commented Oct 5, 2020

    New changeset bd55c46 by Łukasz Langa (Miss Islington (bot)) in branch '3.9':
    bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
    bd55c46

    @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.8 only security fixes 3.9 only security fixes 3.10 only security fixes type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants