Skip to content

Fix cython's gc_track and gc_untrack #13896

@nbruin

Description

@nbruin

In a long sage-devel thread we eventually found in this message that a GC during a weakref callback on a Cython class can lead to double deallocation of that class. In Python's Objects/typeobject.c, line 1024 and onwards, there are some comments that indicate that earlier version of Python were bitten by this problem too. The solution is to insert the appropriate PyObject_GC_Untrack and PyObject_GC_Track in cython's deallocation code. This is best fixed in cython itself.

Install only the new spkg at http://boxen.math.washington.edu/home/jdemeyer/spkg/cython-0.17.4.spkg

Upstream: Completely fixed; Fix reported upstream

CC: @simon-king-jena @jpflori

Component: memleak

Author: Robert Bradshaw

Reviewer: Jeroen Demeyer

Merged: sage-5.6.beta3

Issue created by migration from https://trac.sagemath.org/ticket/13896

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions