[Qgis-developer] Segmentation fault when trying to add layer - PyQGIS 2.4/2.6 on CentOS 6.6

Alberti, K. (Koko) K.Alberti at uu.nl
Mon Mar 2 07:49:13 PST 2015


Hi all,

I'm trying to use the Layer Tree API introduced in QGIS 2.4 in standalone scripts on CentOS 6.6. Unfortunately there don't seem to be any QGIS 2.4 or 2.6 packages for CentOS, so I attempted to build QGIS myself. I'm using the qt47* packages [2] from the ATRPM repository and built my own PyQt (4.9.1), SIP (4.16.6), and QScintilla (2.8.4). Making QGis 2.4 and 2.6 with GCC (4.4.7) gave errors about "no matching function call for ...", but this was fixed with a patch that someone posted [3]. Python version is 2.6.6.

So, now I have a fresh QGIS 2.6 running which seems to work fine. However, when I try to use a script to open a project file, add a layer, and save it again, a segmentation fault occurs when I call:

    QgsMapLayerRegistry.instance().addMapLayer(layer,True)

This is even before trying to do anything with the Layer Tree API. Please refer to http://pastebin.com/5ksyDk4S for the test script so as to keep this message a bit brief. Using gdb python and then running the test script shows a little more info:

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff07d8eed in QMetaObject::cast(QObject*) const () from /usr/lib64/qt47/libQtCore.so.4

But grasping what's going on at this point is a bit beyond my understanding. The same happens with my QGIS 2.4 build. Anyone have any idea what could be causing this, or any other tips for getting QGIS up and running on CentOS 6?

Thanks so much for any help.

regards,
Koko

[1] http://qgis.org/api/classQgsProject.html#ac7b2f41c3507cbe1e2038eaeafbae1bf
[2] http://packages.atrpms.net/dist/el6/qt4/
[3] https://hub.qgis.org/issues/10762
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150302/f925d52e/attachment.html>


More information about the Qgis-developer mailing list