My C module crashes

From: Egil Moeller (redhog_at_takeit.se)
Date: 02/28/05


To: help@python.org, python-list@python.org
Date: Mon, 28 Feb 2005 18:52:29 +0100

Hi!

I've written a C-module for Python, and it works as intended, but
obviously does something wrong with its memmory management (refference
counting), as it causes Python to segfault now and then (randomly,
whey :S)

The module source code is available at
http://grimoire.takeit.se/files/CReader.c

The code isn't _that_ long, so someone experienced with writing Python C
modules should probably not have that hard a time finding what I do
wrong :)

Thanks in advance,
Egil Möller



Relevant Pages

  • Re: JRuby performance questions answered
    ... other scripting languages use Reference counting. ... Why doesn’t Python use a more traditional garbage collection scheme? ... resources without explicitly releasing them may run out of resources ...
    (comp.lang.ruby)
  • Re: Securing a future for anonymous functions in Python
    ... > from amongst Python's other English-based keywords. ... terminology like "counting numbers" even if those words sound more ... For the same reason I don't have any problem with "lambda", ... there's no such discussion over far more abstruse Python features like ...
    (comp.lang.python)
  • Re: multiline comments
    ... python more than I missed the nested comments in C++. ... less than to achieve that since I only use three keys, counting the ... Ctrl-Space to start the block). ...
    (comp.lang.python)
  • Re: list subsetting
    ... More than counting, I am interested in list subsetting in a simple ... Say I have a list of lists and I want to pull ... I wonder if python can keep it simple despite ... being a general purpose programming language, ...
    (comp.lang.python)
  • Re: My C module crashes
    ... > obviously does something wrong with its memmory management (refference ... > counting), as it causes Python to segfault now and then (randomly, ... called and print the refcount of the return value. ... of the list elements etc. ...
    (comp.lang.python)