[PyQt] SIP 4.13.1 crash when using exceptions

Jürgen E. Fischer jef at norbit.de
Fri Feb 3 20:19:50 GMT 2012


Hi there,

we recently started to support exceptions in the sip bindings of Quantum GIS.
Apparently there is a problem in 4.13.1 that causes sip to crash on 32 bit
platform.

The problem seems to be that type_header_code is referenced on a path where
it's not intialized.  The following patch fixes it for me:

--- ../orig/sip4-4.13.1/sipgen/parser.y 2011-12-19 13:29:28.000000000 +0100
+++ sipgen/parser.y     2012-02-03 22:05:25.810230624 +0100
@@ -792,7 +792,8 @@ exception:  TK_EXCEPTION scopedname base

                 /* Complete the definition. */
                 xd->iff->module = currentModule;
-                appendCodeBlock(&xd->iff->hdrcode, $5.type_header_code);
+                if( $5.token == TK_TYPEHEADERCODE )
+                    appendCodeBlock(&xd->iff->hdrcode, $5.type_header_code);
                 xd->pyname = pyname;
                 xd->bibase = $3.bibase;
                 xd->base = $3.base;


See http://hub.qgis.org/issues/4941 for a more detailed description.


Jürgen


-- 
Jürgen E. Fischer         norBIT GmbH               Tel. +49-4931-918175-20
Dipl.-Inf. (FH)           Rheinstraße 13            Fax. +49-4931-918175-50
Software Engineer         D-26506 Norden               http://www.norbit.de

-- 
norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502



More information about the PyQt mailing list