[pygtk] segmentation fault

John Finlay finlay at moeraki.com
Mon Oct 3 03:05:42 WST 2005

Daniel Brodie wrote:

>I am getting a segmentation fault with some very odd circumstances. I
>keep on trying to reduce to exactly what the case is, but its proving to
>be a little more difficult then I thought.
>I have a class that inherits from a TreModelFilter and has a child model
>(in my actual app there is also a sort model on top of that, but that
>got removed for debugging). There is a method in the subclass that adds
>all the data to the child model.
>Now everything worked great until I added to the filter model a
>visible_func. Now for some reason the app segfaults somewhere in the
>middle of adding all the data (more or less the same area everytime). I
>know there isn't a problem with adding the data, because I used this
>model in a treeview and other serious accesses and I had no problem. The
>only thing I am really doing is just returning True for some values and
>False for other values in the model. Heck, I even used a random function
>to do the sorting to see if its a problem with my sorting algorithm and
>it still segments. If I always return True or False then everything is
>I created a small test app, where the only thing it really does is
>create the model, and just call the method that adds all the data to the
>child model. So I know it is somewhere there but I don't know what is
>causing it or how to fix it.
>Any tips? How does one even approach such a bug?
Run it under gdb and generate a backtrace as a starter. Also try it 
without any subclassing.


More information about the pygtk mailing list