This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Segfaults in C heap type subclasses
Type: Stage: resolved
Components: Versions:
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eelizondo, petr.viktorin, vstinner
Priority: normal Keywords: patch

Created on 2019-08-17 20:47 by eelizondo, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15323 merged eelizondo, 2019-08-17 20:48
PR 15966 merged petr.viktorin, 2019-09-11 14:30
PR 16004 merged petr.viktorin, 2019-09-11 18:50
Messages (6)
msg349905 - (view) Author: Eddie Elizondo (eelizondo) * Date: 2019-08-17 20:47
`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 PEP384.

The full details of the bug along with a fix and tests are described in the Github PR.
msg351773 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2019-09-11 09:17
New changeset ff023ed36ea260ab64be5895f1f1f087c798987a by Petr Viktorin (Eddie Elizondo) in branch 'master':
bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323)
msg352067 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2019-09-12 09:12
New changeset 5e9caeec76119a0d61c25f1466c27b7dbd5115bd by Petr Viktorin in branch 'master':
bpo-37879: Fix warnings in _testcapimodule (GH-16004)
msg352082 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2019-09-12 09:44
New changeset 3562ae25402aad36583bc27d4d82c67554323d5e 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, GH-16004) (GH-15966)
msg352344 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-09-13 15:11
I reopen the issue: the change caused a regression on the Refleak buildbot workers: bpo-38150.
msg354194 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2019-10-08 12:15
Thanks to Stéphane and Eddie for fixing the refleak!
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82060
2019-10-08 12:15:19petr.viktorinsetstatus: open -> closed
resolution: fixed
messages: + msg354194
2019-09-13 15:11:41vstinnersetstatus: closed -> open

nosy: + vstinner
messages: + msg352344

resolution: fixed -> (no value)
2019-09-12 13:27:20petr.viktorinsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-09-12 09:44:49petr.viktorinsetmessages: + msg352082
2019-09-12 09:12:56petr.viktorinsetmessages: + msg352067
2019-09-11 18:50:02petr.viktorinsetpull_requests: + pull_request15629
2019-09-11 14:30:47petr.viktorinsetpull_requests: + pull_request15599
2019-09-11 09:17:17petr.viktorinsetnosy: + petr.viktorin
messages: + msg351773
2019-08-17 20:48:44eelizondosetkeywords: + patch
stage: patch review
pull_requests: + pull_request15040
2019-08-17 20:47:30eelizondocreate