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

Segfaults in C heap type subclasses #82060

Closed
eduardo-elizondo mannequin opened this issue Aug 17, 2019 · 6 comments
Closed

Segfaults in C heap type subclasses #82060

eduardo-elizondo mannequin opened this issue Aug 17, 2019 · 6 comments

Comments

@eduardo-elizondo
Copy link
Mannequin

eduardo-elizondo mannequin commented Aug 17, 2019

BPO 37879
Nosy @vstinner, @encukou, @eduardo-elizondo
PRs
  • bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type #15323
  • [3.8] bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323) #15966
  • bpo-37879: Fix warnings in _testcapimodule #16004
  • 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-08.12:15:19.200>
    created_at = <Date 2019-08-17.20:47:30.987>
    labels = []
    title = 'Segfaults in C heap type subclasses'
    updated_at = <Date 2019-10-08.12:15:19.199>
    user = 'https://github.com/eduardo-elizondo'

    bugs.python.org fields:

    activity = <Date 2019-10-08.12:15:19.199>
    actor = 'petr.viktorin'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-10-08.12:15:19.200>
    closer = 'petr.viktorin'
    components = []
    creation = <Date 2019-08-17.20:47:30.987>
    creator = 'eelizondo'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37879
    keywords = ['patch']
    message_count = 6.0
    messages = ['349905', '351773', '352067', '352082', '352344', '354194']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'petr.viktorin', 'eelizondo']
    pr_nums = ['15323', '15966', '16004']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37879'
    versions = []

    @eduardo-elizondo
    Copy link
    Mannequin Author

    eduardo-elizondo mannequin commented Aug 17, 2019

    subtype_dealloc is not correctly handling the reference count of c heap type subclasses. It has some builtin assumptions which can result in the type getting its reference count decreased more that it needs to be, leading to its destruction when it should still be alive.

    Also, this bug is a blocker for the full adoption of PEP-384.

    The full details of the bug along with a fix and tests are described in the Github PR.

    @encukou
    Copy link
    Member

    encukou commented Sep 11, 2019

    New changeset ff023ed by Petr Viktorin (Eddie Elizondo) in branch 'master':
    bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323)
    ff023ed

    @encukou
    Copy link
    Member

    encukou commented Sep 12, 2019

    New changeset 5e9caee by Petr Viktorin in branch 'master':
    bpo-37879: Fix warnings in _testcapimodule (GH-16004)
    5e9caee

    @encukou
    Copy link
    Member

    encukou commented Sep 12, 2019

    New changeset 3562ae2 by Petr Viktorin in branch '3.8':
    [3.8] bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323, #60208) (GH-15966)
    3562ae2

    @encukou encukou closed this as completed Sep 12, 2019
    @vstinner
    Copy link
    Member

    I reopen the issue: the change caused a regression on the Refleak buildbot workers: bpo-38150.

    @vstinner vstinner reopened this Sep 13, 2019
    @encukou
    Copy link
    Member

    encukou commented Oct 8, 2019

    Thanks to Stéphane and Eddie for fixing the refleak!

    @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
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants