Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37121

Re: Messing with the GC

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Messing with the GC
Date 2013-01-20 17:14 -0500
References <alvpvkFthuoU1@mid.uni-berlin.de> <am317sFljunU1@mid.uni-berlin.de>
Newsgroups comp.lang.python
Message-ID <mailman.708.1358720118.2939.python-list@python.org> (permalink)

Show all headers | View raw


On 1/20/2013 3:09 PM, Jens Thoms Toerring wrote:

>      thank you for the explanations. I had overlooked the
> cyclic nature of what I had produced here and, of course,
> the GC can't be blamed for not collecting objects that are
> part of a cycle. The other question about the last refe-
> rence to an object vanishing within a method call (which,
> as I now clearly understand, can't happen and wouldn't make
> much sense) was triggered by a segmentation fault I get
> when I do something similar in PySide, so I was getting
> worried if it might be due to a GC issue. Now I know its
> got to be something different;-)

Perhaps the hardest part of writing C extensions to CPython directly in 
C (versus something like Cython) is properly balancing increfs and 
decrefs. An incref without a later decref can lead to a memory leak. A 
decref without a preceding incref (so CPython thinks the object can be 
deleted, when it should not be) can lead to segfaults. So I would report 
PySide code leading to segfaults to the PySide people.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Messing with the GC jt@toerring.de (Jens Thoms Toerring) - 2013-01-19 14:47 +0000
  Re: Messing with the GC Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-19 16:24 +0000
    Re: Messing with the GC Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-19 16:34 +0000
  Re: Messing with the GC Terry Reedy <tjreedy@udel.edu> - 2013-01-19 11:40 -0500
  Re: Messing with the GC Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-19 16:44 +0000
  Re: Messing with the GC jt@toerring.de (Jens Thoms Toerring) - 2013-01-20 20:09 +0000
    Re: Messing with the GC Terry Reedy <tjreedy@udel.edu> - 2013-01-20 17:14 -0500
      Re: Messing with the GC jt@toerring.de (Jens Thoms Toerring) - 2013-01-21 01:02 +0000

csiph-web