Public bug reported:

A few days ago, the development version of the PyGTK application
LottaNZB 0.5 (https://code.edge.launchpad.net/~lottanzb/lottanzb/main)
stopped working because of a segmentation fault during startup. I was
able to track down the problem:

2.16.1-0ubuntu1: Works fine both using Python 2.5 and Python 2.6.
2.16.1-0ubuntu2 when launching the application using Python 2.5: Segmentation 
fault.
2.16.1-0ubuntu2 when launching the application using Python 2.6: Works fine.

I wasn't able to produce a simple demonstration of the Python 2.5
problem yet, but in our code the situation is as follows:

class GObjectSingletonMeta(GObjectMeta):
    """GObject singleton metaclass"""
    
    def __init__(mcs, name, bases, _dict):
        # THIS IS WHERE THE APPLICATION SEGFAULTS.
        GObjectMeta.__init__(mcs, name, bases, _dict)
        mcs.__instance = None
    
    def __call__(mcs, *args, **kwargs):
        """Creates an instance of mcs if it doesn't exist yet"""
        
        if mcs.__instance is None:
            mcs.__instance = GObjectMeta.__call__(mcs, *args, **kwargs)
        
        return mcs.__instance

class App(GObject, kiwi.environ.Application):
    __metaclass__ = GObjectSingletonMeta

    lock = property(type=object)
    
    [...]

It's possible to prevent the application from segfaulting in the
singleton metaclass by *either* removing the Application parent class
from the App class or by removing all GObject properties from the App
class.

I'm using an up-to-date Jaunty amd64 machine. I only exchanged the
python-gobject package for the tests.

I'll try to provide further information about the problem and I wonder
if someone else can reproduce this. You can try to reproduce the problem
by branching the project and running ./run-lottanzb.sh (which will run
the application using Python 2.5 by default).

** Affects: lottanzb
     Importance: Undecided
         Status: New

** Affects: pygobject (Ubuntu)
     Importance: Undecided
         Status: New

-- 
Segfault starting with 2.16.1-0ubuntu2 using Python 2.5
https://bugs.launchpad.net/bugs/334784
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to pygobject in ubuntu.

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to