Bug report #15347

2.16 build failure in python SIP

Added by landry Landry Breuil almost 8 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Build/Install
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

Description

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..)

FAILED: python/plugins/GdalTools/tools/ui_widgetGrid.py
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
64/python/plugins/GdalTools/tools/ui_widgetGrid.py
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 ?

History

#1 Updated by landry Landry Breuil over 7 years ago

And fwiw, i managed to build qgis 2.14.4 without issues in the same environment, but it crashes in the exact same way at startup.

#2 Updated by landry Landry Breuil over 7 years ago

  • Assignee set to Nyall Dawson

Looking again at git changelog, i think it's a fallout of 1bc17e6 which was cherry-picked in 2.14 branch - before that, QgsFeatuerRequest.AllAttributes was never used/referenced. Nyall, since you worked on #14985, any idea ? What sip/py-qt4 versions are you using in your environment ?

#3 Updated by Nyall Dawson over 7 years ago

  • Assignee deleted (Nyall Dawson)

Not sure, sorry. I doubt it's a dependency version issue, since it compiles ok even on trusty. This sip stuff is really a whole lot of black magic and very hard the troubleshoot when things go wrong.

#4 Updated by landry Landry Breuil over 7 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 7 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 7 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

#7 Updated by landry Landry Breuil over 7 years ago

And it seems that 'new' failure on qgis version checking is a fallout of c9838cc which was also backported to 2.16 branch. sigh.

#8 Updated by landry Landry Breuil over 7 years ago

  • Assignee set to Jürgen Fischer

And locally reverting c9838cc too allows me to run 2.16.1. Something's wrong somewhere with sip and static non-basic types ? Jürgen, any idea ?

#9 Updated by landry Landry Breuil over 7 years ago

Fwiw, updating sip from 4.16.8 to 4.18.1 seems to fix all the build & runtime issues..

#10 Updated by Nyall Dawson over 7 years ago

Maybe the minimum sip version should be bumped as a result..?

#11 Updated by Jürgen Fischer over 7 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).

#12 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#13 Updated by Jürgen Fischer over 6 years ago

  • Assignee deleted (Jürgen Fischer)

#14 Updated by Jürgen Fischer over 5 years ago

  • Status changed from Open to Closed
  • Description updated (diff)
  • Resolution set to worksforme

Also available in: Atom PDF