[PyKDE] Re: PyKDE] SIP 4.0 problems

Tuvi, Selim stuvi at slac.stanford.edu
Sun Apr 11 05:46:01 BST 2004


Phil with SIP 4.0 we ran into GUI stability problems when we compiled PyQt without the -g option (the GUI would sometimes would not respond, maybe /ReleaseGIL/ is required in more places?).

And in the sihippo package used below, when we put /ReleaseGIL/ for the SIP methods that required it then we didn't have to compile it with the -g option.

-Selim

-----Original Message-----
From: Phil Thompson
To: Kunz, Paul F.
Cc: pykde at mats.imk.fraunhofer.de
Sent: 4/10/2004 11:20 AM
Subject: [PyKDE] Re: PyKDE] SIP 4.0 problems

On Friday 09 April 2004 1:47 am, Paul F. Kunz wrote:
>    In this script
>
> import sys
> from qt import *
> from sihippo import *
>
> app = QApplication ( sys.argv )
> ntc = NTupleController.instance()
> nt2 = ntc.createCircularBuffer(2)
> nt2.setLabels(['Time', 'TEM Current'])
> nt2.setTitle('GTIC Test2')
> time_list = range(100)
> amps = [0.0] * 100
> try :
>     nt2.addColumn('Time', time_list)
>     nt2.addColumn('TEM Current', amps)
> except DataSourceException, detail :
>     print detail.what()
>
> the nt2.addColumn() throws and exception in C++.   If SIPed with -e it
> works fine...
>
> [pfkeb at kunz-pbdsl1 sip]$ python cb_addcol.py
> NTuple::addColumn: column has wrong size
> [pfkeb at kunz-pbdsl1 sip]$
>
> But when SIPed with -e -g it yields ...
>
> pfkeb at kunz-pbdsl1 sip]$ python cb_addcol.py
> Segmentation fault (core dumped)
> [pfkeb at kunz-pbdsl1 sip]$
>
> It also worked fine with SIP 3.8 and later.   This is true both for
> Linux and Windows.
>
> The group using this code needs SIP 4.x and the -g option for other
> reasons.
>
>    What might be the cause of this problem.   The .sip file for
> DataSourceException.sip is enclosed.
>
> ---
>
> class DataSourceException
> {
> %TypeHeaderCode
> #include "datasrcs/DataSourceException.h"
> %End
>
>
> public:
>
>   DataSourceException ( const std::string & );
>   const char * what () const throw ();
>
>   char * __str__();
> %MethodCode
>     return PyString_FromString ( sipCpp->what() );
> %End
>
> };

There is a bug in SIP v4 (fixed in tonight's snapshot) that happens only
if 
you specify both the -e and -g flags - but I'm not convinced it would
affect 
the above. (Depends on what the rest of your module is doing I suppose.)

Note that the -g flag isn't tested and was only really there as an
emergency 
fallback in case there were problems with the new GIL management code
(which 
there aren't). You really shouldn't need to use it.

Phil

_______________________________________________
PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde




More information about the PyQt mailing list