Bug report #15347
2.16 build failure in python SIP
|Affected QGIS version:||2.16.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||worksforme|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||23279|
Trying to build 2.16.0 on OpenBSD with python 2.7, py-qt4 4.11.4 and py-sip 4.16.8, i always get a python process segfault when pyuic-wrapper.sh is called (with random inputs, in the several .ui files shipped within qgis..)
cd /home/obj/ports/qgis-2.16.0/build-amd64/python/plugins/GdalTools/tools && /usr/obj/ports/qgis-2.16.0/qgis-2.16.0/scripts/pyuic-wrapper.s
h /usr/local/bin/pyuic4 /home/obj/ports/qgis-2.16.0/build-amd64/output/lib /home/obj/ports/qgis-2.16.0/build-amd64/output/python /usr/local
/bin/python2.7 /usr/obj/ports/qgis-2.16.0/qgis-2.16.0/python/plugins/GdalTools/tools/widgetGrid.ui -o /home/obj/ports/qgis-2.16.0/build-amd
Segmentation fault (core dumped)
and everytime the traceback is the same:
#0 0x000019a48cc754d5 in sip_api_get_reference () from /usr/local/lib/python2.7/site-packages/sip.so
#1 0x000019a5230ff325 in varget_QgsFeatureRequest_AllAttributes () from /home/obj/ports/qgis-2.16.0/build-amd64/output/python/qgis/_core.so
#2 0x000019a48cc807a9 in sipVariableDescr_descr_get () from /usr/local/lib/python2.7/site-packages/sip.so
#3 0x000019a4eae723d2 in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#4 0x000019a4eae7733d in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#5 0x000019a4eae77432 in PyEval_EvalCode () from /usr/local/lib/libpython2.7.so.0.0
Of course building 2.14.3 with the same py-qt4/py-sip versions has no issues... so what could have changed in qgis python core that triggers this ? I dont see anything dubious in python/core/qgsfeaturerequest.sip git log, maybe the python 3 migration ongoing work ?
#2 Updated by landry Landry Breuil over 4 years ago
- Assignee set to Nyall Dawson
#4 Updated by landry Landry Breuil over 4 years ago
Well, reverting 1bc17e6 locally allows me to build 2.16.0, and it starts fine...
So the problem seems to lie in assigning a default value to a method argument which isnt "a simple type", or maybe because it's a static member ? I agree with you that this sip stuff is black magic, and i know nothing to python either :)
#5 Updated by landry Landry Breuil over 4 years ago
With 2.16.1 and the commit reverted, qgis crashes at startup on a different sip call stack..
#0 0x0000083fa3a8f4d5 in sip_api_get_reference () from /usr/local/lib/python2.7/site-packages/sip.so
#1 0x00000840a3af367f in varget_QGis_QGIS_VERSION () from /usr/local/share/qgis/python/qgis/_core.so
#2 0x0000083fa3a9a7a9 in sipVariableDescr_descr_get () from /usr/local/lib/python2.7/site-packages/sip.so
That stuff is fragile as hell.
#6 Updated by landry Landry Breuil over 4 years ago
And if i come back to 2.16.0, it now does a SIGBUS at startup, with a different trace, but also related to qgis version check..
#0 0x00000e3754bbfc76 in QString::trimmed () from /usr/local/lib/libQtCore.so.9.0
#1 0x00000e3754b8db61 in QLocalePrivate::stringToLongLong () from /usr/local/lib/libQtCore.so.9.0
#2 0x00000e3754bbda8a in QString::toLongLong () from /usr/local/lib/libQtCore.so.9.0
#3 0x00000e3754bbdb3d in QString::toInt () from /usr/local/lib/libQtCore.so.9.0
#4 0x00000e37623eb952 in QgsPluginRegistry::checkQgisVersion () from /usr/local/lib/libqgis_app.so.1.0
#5 0x00000e37623ec332 in QgsPluginRegistry::isPythonPluginCompatible () from /usr/local/lib/libqgis_app.so.1.0
#6 0x00000e37623ec7f3 in QgsPluginRegistry::loadPythonPlugin () from /usr/local/lib/libqgis_app.so.1.0
#7 0x00000e37623ef193 in QgsPluginRegistry::restoreSessionPlugins () from /usr/local/lib/libqgis_app.so.1.0
#8 0x00000e376219445d in QgisApp::QgisApp () from /usr/local/lib/libqgis_app.so.1.0
#9 0x00000e354a3073ec in main () from /usr/local/bin/qgis
#11 Updated by Jürgen Fischer over 4 years ago
Nyall Dawson wrote:
Maybe the minimum sip version should be bumped as a result..?
trusty has SIP 4.15.5/PyQt4 4.10.4/Qt 4.8.6 and apparently doesn't have these issues (see http://dash.orfeo-toolbox.org/viewConfigure.php?buildid=241408).