Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 612070

Summary: sci-geosciences/qgis-2.18.4: crash without USE webkit
Product: Gentoo Linux Reporter: Andreas Plesch <andreasplesch>
Component: Current packagesAssignee: Sci-geo Project <sci-geosciences>
Status: RESOLVED FIXED    
Severity: major    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://hub.qgis.org/issues/14881
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: zipped qgis build log
zipped 2.18.7 build log without PyQt4
zipped PyQt4 build log

Description Andreas Plesch 2017-03-08 16:59:52 UTC
The webkit USE option should be activated by default. Currently, without webkit USE, qgis crashes when opening (double clicking) Get script (or models) from on-line collection in the Processing tool box. With webkit USE, it works fine.

Here is the console output before the segmentation fault:

Warning: Object::connect: No such signal QWebPage::loadProgress(int)
Warning: Object::connect: No such signal QWebPage::unsupportedContent(QNetworkReply*)
Warning: Object::connect: No such signal QWebFrame::titleChanged(QString)
Warning: Object::connect: No such signal QWebPage::loadProgress(int)
Warning: Object::connect: No such signal QWebFrame::titleChanged(QString)
Warning: Object::connect: No such signal QWebFrame::iconChanged()
Warning: Object::connect: No such signal QWebFrame::urlChanged(QUrl)
Warning: Object::connect: No such signal QWebPage::loadStarted()
Warning: Object::connect: No such signal QWebPage::loadProgress(int)
Warning: Object::connect: No such signal QWebPage::statusBarMessage(QString)
Warning: Object::connect: No such signal QWebPage::linkClicked(QUrl)
Warning: Object::connect: No such signal QWebPage::selectionChanged()
Warning: Object::connect: No such signal QWebPage::microFocusChanged()
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Warning: QMetaObject::invokeMethod: No such method QWebPage::repaintRequested(QRect)
Segmentation fault
Comment 1 Andreas Sturmlechner gentoo-dev 2017-04-09 21:39:06 UTC
Please check if this is possibly fixed by 2.18.6.
Comment 2 Andreas Plesch 2017-04-11 18:42:30 UTC
I am trying to emerge 2.18.6 but have slot conflicts probably related to requiring qt5. I could resolve some but still have 

dev-python/sip:0
dev-python/sip-4.18:0/11::gentoo, installed) pulled in by
    >=dev-python/sip-4.16.6:0/11
...
required by (dev-python/PyQt4-4.11.4-r1:0/0::gentoo, installed)

conflicts with
dev-python/sip-4.19.1:0/12::gentoo, ebuild scheduled by
>=dev-python/sip-4.19:= ...
dev-python/qscintilla-python-2.9.4-r1:0/0::gentoo

I thought 2.18.6 is still using qt4 and the switch to qt5 will occur with 3.0 ? I have plugins and python scripts for qgis which use qt4.
Comment 3 Andreas Sturmlechner gentoo-dev 2017-04-11 22:44:48 UTC
That conflict would go away by upgrading to PyQt4-4.12 which has been stable for some time (did you mask it for some reason?).

There is no guarantee that your plugins continue to work with the switch to PyQt5, unfortunately, but it would be a valuable test.

Qt5 has been an option for some time on 2.18 branch, and as upstream is backporting fixes from master it is now buildable and runs fine. There has been a fair number of issues wrt keeping it working with PyQt4 and recent sip versions, and right now it does not seem to even build with Qt-4.8.7, which made the Qt5 option even more relevant.
Comment 4 Andreas Plesch 2017-04-12 20:44:28 UTC
Many plugins use PyQt4, not sure what the plan is for those with QGis3. Probably they all have to be upgraded by the authors.

I had to give emerge these three at the same time to avoid circular blockers:

emerge qgis pykde4 PyQt4

Then qgis 2.18.6 compiled (trying without webkit use flag). But it segfaults after showing the splash screen, apparently while loading Python support:

(gdb) run
Starting program: /usr/bin/qgis 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe4688700 (LWP 18498)]
[New Thread 0x7fffd94b7700 (LWP 18499)]
[New Thread 0x7fffcf40b700 (LWP 18515)]
[New Thread 0x7fffce9b8700 (LWP 18526)]
Warning: QCss::Parser - Failed to load file  "/style.qss"
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory
Warning: QLayout: Attempting to add QLayout "" to QgsPanelWidgetStack "mWidgetStack", which already has a layout
[New Thread 0x7fffcd96c700 (LWP 18550)]
[New Thread 0x7fffccf59700 (LWP 18555)]

Program received signal SIGSEGV, Segmentation fault.
0x00007fffb687aac7 in ?? () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
(gdb) bt  
#0  0x00007fffb687aac7 in ?? () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
#1  0x00007ffff7de83aa in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7de84bb in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7deca98 in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff7de8254 in ?? () from /lib64/ld-linux-x86-64.so.2
#5  0x00007ffff7dec119 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007fffef4c6fd9 in ?? () from /lib64/libdl.so.2
#7  0x00007ffff7de8254 in ?? () from /lib64/ld-linux-x86-64.so.2
#8  0x00007fffef4c7589 in ?? () from /lib64/libdl.so.2
#9  0x00007fffef4c7071 in dlopen () from /lib64/libdl.so.2
#10 0x00007fffb71a0eff in _PyImport_GetDynLoadFunc () from /usr/lib64/libpython2.7.so.1.0
#11 0x00007fffb7189f3e in _PyImport_LoadDynamicModule () from /usr/lib64/libpython2.7.so.1.0
#12 0x00007fffb7188149 in ?? () from /usr/lib64/libpython2.7.so.1.0
#13 0x00007fffb718863f in ?? () from /usr/lib64/libpython2.7.so.1.0
#14 0x00007fffb7188dc2 in PyImport_ImportModuleLevel () from /usr/lib64/libpython2.7.so.1.0
#15 0x00007fffb716c94f in ?? () from /usr/lib64/libpython2.7.so.1.0
#16 0x00007fffb70defd3 in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#17 0x00007fffb716e457 in PyEval_CallObjectWithKeywords () from /usr/lib64/libpython2.7.so.1.0
#18 0x00007fffb717249e in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#19 0x00007fffb717798d in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
#20 0x00007fffb7177a92 in PyEval_EvalCode () from /usr/lib64/libpython2.7.so.1.0
#21 0x00007fffb71907cf in ?? () from /usr/lib64/libpython2.7.so.1.0
#22 0x00007fffb7191605 in PyRun_StringFlags () from /usr/lib64/libpython2.7.so.1.0
#23 0x00007fffb7471e0b in ?? () from /usr/lib64/libqgispython.so.2.18.6
#24 0x00007fffb7474116 in ?? () from /usr/lib64/libqgispython.so.2.18.6
#25 0x00007fffb7478ad8 in ?? () from /usr/lib64/libqgispython.so.2.18.6
#26 0x00007fffb7479151 in ?? () from /usr/lib64/libqgispython.so.2.18.6
#27 0x00007ffff74ebe53 in QgisApp::loadPythonSupport() () from /usr/lib64/libqgis_app.so.2.18.6
#28 0x00007ffff74ee17e in QgisApp::QgisApp(QSplashScreen*, bool, bool, QWidget*, QFlags<Qt::WindowType>) () from /usr/lib64/libqgis_app.so.2.18.6
#29 0x00000000004065c4 in ?? ()
#30 0x00007ffff4570790 in __libc_start_main () from /lib64/libc.so.6
#31 0x000000000040a1d9 in _start ()
(gdb)
Comment 5 Andreas Plesch 2017-04-13 13:28:38 UTC
Let me know if I should open another bug for 2.18.6 .
Comment 6 François Valenduc 2017-04-17 19:50:34 UTC
I also get a very similar error with QGIS 2.18.6:

Warning: QLayout: Attempting to add QLayout "" to QgsPanelWidgetStack "mWidgetStack", which already has a layout
[New Thread 0x7fff67ffd700 (LWP 27182)]
[New Thread 0x7fff677fc700 (LWP 27183)]

Program received signal SIGSEGV, Segmentation fault.
0x00007fff4d40e997 in ?? () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
(gdb) bt
#0  0x00007fff4d40e997 in ?? () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
#1  0x00007ffff7de848a in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7de859b in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7decbb0 in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff7de8334 in ?? () from /lib64/ld-linux-x86-64.so.2
#5  0x00007ffff7dec229 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007fffeccf8fd9 in ?? () from /lib64/libdl.so.2
#7  0x00007ffff7de8334 in ?? () from /lib64/ld-linux-x86-64.so.2
#8  0x00007fffeccf9589 in ?? () from /lib64/libdl.so.2
#9  0x00007fffeccf9071 in dlopen () from /lib64/libdl.so.2
#10 0x00007fff4df4126f in _PyImport_GetDynLoadFunc () from /usr/lib64/libpython2.7.so.1.0
#11 0x00007fff4df2954e in _PyImport_LoadDynamicModule () from /usr/lib64/libpython2.7.so.1.0
#12 0x00007fff4df27611 in ?? () from /usr/lib64/libpython2.7.so.1.0
#13 0x00007fff4df27b35 in ?? () from /usr/lib64/libpython2.7.so.1.0
#14 0x00007fff4df28385 in PyImport_ImportModuleLevel () from /usr/lib64/libpython2.7.so.1.0
#15 0x00007fff4df0aba8 in ?? () from /usr/lib64/libpython2.7.so.1.0
#16 0x00007fff4de7a1d3 in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#17 0x00007fff4df0c877 in PyEval_CallObjectWithKeywords () from /usr/lib64/libpython2.7.so.1.0
#18 0x00007fff4df10cf3 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#19 0x00007fff4df167e0 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
#20 0x00007fff4df168d9 in PyEval_EvalCode () from /usr/lib64/libpython2.7.so.1.0
#21 0x00007fff4df3006f in ?? () from /usr/lib64/libpython2.7.so.1.0
#22 0x00007fff4df30f74 in PyRun_StringFlags () from /usr/lib64/libpython2.7.so.1.0
#23 0x00007fff4e21b995 in QgsPythonUtilsImpl::runStringUnsafe (this=0x184ea30, command=..., single=true)
    at /var/tmp/notmpfs/portage/sci-geosciences/qgis-2.18.6-r1/work/qgis-2.18.6/src/python/qgspythonutilsimpl.cpp:306
#24 0x00007fff4e21ba9f in QgsPythonUtilsImpl::runString (this=0x184ea30, command=..., msgOnError=..., single=true)
    at /var/tmp/notmpfs/portage/sci-geosciences/qgis-2.18.6-r1/work/qgis-2.18.6/src/python/qgspythonutilsimpl.cpp:318
#25 0x00007fff4e21a235 in QgsPythonUtilsImpl::checkSystemImports (this=0x184ea30) at /var/tmp/notmpfs/portage/sci-geosciences/qgis-2.18.6-r1/work/qgis-2.18.6/src/python/qgspythonutilsimpl.cpp:144
#26 0x00007fff4e21b1c4 in QgsPythonUtilsImpl::initPython (this=0x184ea30, interface=0x1d82820)
    at /var/tmp/notmpfs/portage/sci-geosciences/qgis-2.18.6-r1/work/qgis-2.18.6/src/python/qgspythonutilsimpl.cpp:222
#27 0x00007ffff72a094a in QgisApp::loadPythonSupport (this=0xe19a70) at /var/tmp/notmpfs/portage/sci-geosciences/qgis-2.18.6-r1/work/qgis-2.18.6/src/app/qgisapp.cpp:8876
#28 0x00007ffff72637d5 in QgisApp::QgisApp (this=0xe19a70, splash=0xba8a80, restorePlugins=true, skipVersionCheck=false, parent=0x0, fl=...)
    at /var/tmp/notmpfs/portage/sci-geosciences/qgis-2.18.6-r1/work/qgis-2.18.6/src/app/qgisapp.cpp:903
#29 0x000000000040b237 in main (argc=1, argv=0x7fffffffddc8) at /var/tmp/notmpfs/portage/sci-geosciences/qgis-2.18.6-r1/work/qgis-2.18.6/src/app/main.cpp:1090
(gdb)
Comment 7 Andreas Sturmlechner gentoo-dev 2017-04-24 19:35:39 UTC
Qt5WebKit is unconditional for the time being in >=qgis-2.18.7, at least it is *not as* unmaintained as Qt4WebKit.
Comment 8 Andreas Plesch 2017-04-25 16:58:38 UTC
I reemerged 2.18.6 with the webkit USE. It compiled fine but then segfaulted in exactly the same way.

I suspect qgis now should not try to load PyQt4/QtCore.so but rather PyQt5/QtCore.so ?

I am trying to get rid of PyQt4 but qscintilla-python-2.9.4-r1 depends on it:

$ equery d dev-python/PyQt4
 * These packages depend on dev-python/PyQt4:
dev-python/qscintilla-python-2.9.4-r1 (qt4 ? >=dev-python/PyQt4-4.11.3[X,python_targets_python2_7(-)?,python_targets_python3_4(-)?,python_targets_python3_5(-)?,-python_single_target_python2_7(-),-python_single_target_python3_4(-),-python_single_target_python3_5(-)])

even with a -qt4 use.

I think I have to go back to qgis 2.18.4.
Comment 9 Andreas Sturmlechner gentoo-dev 2017-04-25 17:22:00 UTC
I have PyQt4 installed as well and it does not segfault. However, how do you build QGIS? Does that mean you have USE=-python but QGIS still builds python bindings?

Please try 2.18.7 and attach the build.log.
Comment 10 Andreas Plesch 2017-04-25 17:48:24 UTC
Created attachment 470908 [details]
zipped qgis build log
Comment 11 Andreas Plesch 2017-04-25 17:49:14 UTC
(In reply to Andreas Plesch from comment #10)
> Created attachment 470908 [details]
> zipped qgis build log

I could unmerge PyQt4 after all since emerge --depclean did not complain about qscintilla-python depending on it [equery d seems to be not quite accurate].

I then reemerged qgis 2.18.6-r1 without PyQt4 being available and without problems.

However, now qgis still wants to load PyQt4

Couldn't load PyQt.
Python support will be disabled.


Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named PyQt4


Python version:
2.7.12 (default, Apr 24 2017, 15:30:47) 
[GCC 4.9.4]
Comment 12 Andreas Plesch 2017-04-25 17:50:38 UTC
Thanks. Ah. 2.18.7 just became available on my mirror. Let me rebuild.
Comment 13 Andreas Plesch 2017-04-25 17:57:01 UTC
(In reply to Andreas Plesch from comment #11)
> (In reply to Andreas Plesch from comment #10)
> > Created attachment 470908 [details]
> > zipped qgis build log
> 
> I could unmerge PyQt4 after all since emerge --depclean did not complain
> about qscintilla-python depending on it [equery d seems to be not quite
> accurate].
> 
> I then reemerged qgis 2.18.6-r1 without PyQt4 being available and without
> problems.
> 

Let me add that qgis now does not segfault anymore, so there is some problem with our PyQt4 and qgis 2.18.6.

> However, now qgis still wants to load PyQt4
> 
> Couldn't load PyQt.
> Python support will be disabled.
> 
> 
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named PyQt4
> 
> 
> Python version:
> 2.7.12 (default, Apr 24 2017, 15:30:47) 
> [GCC 4.9.4]
Comment 14 Andreas Plesch 2017-04-25 18:03:21 UTC
Created attachment 470910 [details]
zipped 2.18.7 build log without PyQt4

2.18.7 emerged and compiled without problems without PyQt4. However, there is still the same message:

Couldn't load PyQt.
Python support will be disabled.


Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named PyQt4


Python version:
2.7.12 (default, Apr 24 2017, 15:30:47) 
[GCC 4.9.4]

QGIS version:
2.18.7 'Las Palmas', exported

Let me reinstall PyQt4, and try again.
Comment 15 Andreas Plesch 2017-04-25 18:18:00 UTC
Ok, I emerged (emerge PyQt4) but now get the same segfault when starting qgis:

(gdb) bt                                                                                                                                                                                                                                       
#0  0x00007fff4e172ac7 in ?? () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so                                                                                                                                                        
#1  0x00007ffff7de83aa in ?? () from /lib64/ld-linux-x86-64.so.2                                                                                                                                                                               
#2  0x00007ffff7de84bb in ?? () from /lib64/ld-linux-x86-64.so.2                                                                                                                                                                               
#3  0x00007ffff7deca98 in ?? () from /lib64/ld-linux-x86-64.so.2                                                                                                                                                                               
#4  0x00007ffff7de8254 in ?? () from /lib64/ld-linux-x86-64.so.2                                                                                                                                                                               
#5  0x00007ffff7dec119 in ?? () from /lib64/ld-linux-x86-64.so.2                                                                                                                                                                               
#6  0x00007fffed0befd9 in ?? () from /lib64/libdl.so.2                                                                                                                                                                                         
#7  0x00007ffff7de8254 in ?? () from /lib64/ld-linux-x86-64.so.2                                                                                                                                                                               
#8  0x00007fffed0bf589 in ?? () from /lib64/libdl.so.2                                                                                                                                                                                         
#9  0x00007fffed0bf071 in dlopen () from /lib64/libdl.so.2                                                                                                                                                                                     
#10 0x00007fff4eca30bf in _PyImport_GetDynLoadFunc () from /usr/lib64/libpython2.7.so.1.0                                                                                                                                                      
#11 0x00007fff4ec8b36e in _PyImport_LoadDynamicModule () from /usr/lib64/libpython2.7.so.1.0                                                                                                                                                   
#12 0x00007fff4ec89431 in ?? () from /usr/lib64/libpython2.7.so.1.0                                                                                                                                                                            
#13 0x00007fff4ec89955 in ?? () from /usr/lib64/libpython2.7.so.1.0                                                                                                                                                                            
#14 0x00007fff4ec8a1a5 in PyImport_ImportModuleLevel () from /usr/lib64/libpython2.7.so.1.0                                                                                                                                                    
#15 0x00007fff4ec6cc08 in ?? () from /usr/lib64/libpython2.7.so.1.0
#16 0x00007fff4ebdc203 in PyObject_Call () from /usr/lib64/libpython2.7.so.1.0
#17 0x00007fff4ec6e8d7 in PyEval_CallObjectWithKeywords () from /usr/lib64/libpython2.7.so.1.0
#18 0x00007fff4ec7080f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.7.so.1.0
#19 0x00007fff4ec78630 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.7.so.1.0
#20 0x00007fff4ec78729 in PyEval_EvalCode () from /usr/lib64/libpython2.7.so.1.0
#21 0x00007fff4ec91e4f in ?? () from /usr/lib64/libpython2.7.so.1.0
#22 0x00007fff4ec92d54 in PyRun_StringFlags () from /usr/lib64/libpython2.7.so.1.0
#23 0x00007fff4efc6dfb in ?? () from /usr/lib64/libqgispython.so.2.18.7
#24 0x00007fff4efc9106 in ?? () from /usr/lib64/libqgispython.so.2.18.7
#25 0x00007fff4efcdac8 in ?? () from /usr/lib64/libqgispython.so.2.18.7
#26 0x00007fff4efce141 in ?? () from /usr/lib64/libqgispython.so.2.18.7
#27 0x00007ffff74eb593 in QgisApp::loadPythonSupport() () from /usr/lib64/libqgis_app.so.2.18.7
#28 0x00007ffff74ed8cc in QgisApp::QgisApp(QSplashScreen*, bool, bool, QWidget*, QFlags<Qt::WindowType>) () from /usr/lib64/libqgis_app.so.2.18.7
#29 0x00000000004065b4 in ?? ()
#30 0x00007ffff44c3790 in __libc_start_main () from /lib64/libc.so.6
#31 0x000000000040a1c9 in _start ()

I attach the PyQt4 build log.

Not sure what else to try.
Comment 16 Andreas Plesch 2017-04-25 18:18:50 UTC
Created attachment 470912 [details]
zipped PyQt4 build log
Comment 17 Andreas Plesch 2017-04-25 18:30:09 UTC
Here are my use options for PyQt4 and qgis:

localhost portage # equery u PyQt4
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for dev-python/PyQt4-4.12:
 U I
 + + X                        : Build bindings for the QtGui module
 - - compat                   : Install the deprecated pyqtconfig module for backward compatibility
 + + dbus                     : Build bindings for the QtDBus module
 - - debug                    : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 + + declarative              : Build bindings for the QtDeclarative module
 - - designer                 : Build bindings for the QtDesigner module and enable the designer plugin
 - - doc                      : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
 - - examples                 : Install examples, usually source code
 - - help                     : Build bindings for the QtHelp module
 + + kde                      : Select media-libs/phonon as Phonon variant (needed for KDE)
 - - multimedia               : Build bindings for the QtMultimedia module
 + + opengl                   : Build bindings for the QtOpenGL module
 + + phonon                   : Build bindings for the phonon module
 + + python_targets_python2_7 : Build with Python 2.7
 + + python_targets_python3_4 : Build with Python 3.4
 + + script                   : Build bindings for the QtScript module
 - - scripttools              : Build bindings for the QtScriptTools module
 + + sql                      : Build bindings for the QtSql module
 + + svg                      : Build bindings for the QtSvg module
 - - testlib                  : Build bindings for the QtTest module
 + + webkit                   : Build bindings for the QtWebKit module
 - - xmlpatterns              : Build bindings for the QtXmlPatterns module
localhost portage # equery u qgis 
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sci-geosciences/qgis-2.18.7:
 U I
 - - designer                 : Build custom widgets for dev-qt/designer
 - - examples                 : Install examples, usually source code
 + + georeferencer            : Determines whether georeferencer plugin should be built
 - - grass                    : Add support for sci-geosciences/grass
 - - mapserver                : Determines whether mapserver should be built
 - - oracle                   : Enable Oracle Database support
 + + postgres                 : Add support for the postgresql database
 + + python                   : Add optional support/bindings for the Python language
 + + python_targets_python2_7 : Build with Python 2.7
 - - touch                    : Enable support for touch input devices

Anything suspicious ?
Comment 18 Andreas Plesch 2017-04-26 12:23:04 UTC
Sorry, I realized I never provided my emerge --info (because there are no emerge problems):
localhost portage # emerge --info
Portage 2.3.3 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-4.9.4, glibc-2.23-r3, 3.7.10-gentoo-r1 x86_64)
=================================================================
System uname: Linux-3.7.10-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.3
KiB Mem:    32911148 total,   2451616 free
KiB Swap:   33554428 total,  15272652 free
Timestamp of repository gentoo: Tue, 25 Apr 2017 17:30:01 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.24.2::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.26.1::gentoo
sys-devel/gcc:            4.9.4::gentoo, 5.4.0-r3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r3::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

rion
    location: /var/lib/layman/rion
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 skype-eula PUEL @EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=core2"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirrors.med.harvard.edu/gentoo ftp://mirror.datapipe.net/gentoo http://gentoo.mirrors.tds.net/gentoo http://gentoo.cites.uiuc.edu/pub/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cpudetection cracklib crypt cups cxx dbus declarative dri dts dvd dvdr dvdread emboss encode exif fam firefox flac fortran gd gdbm gif glamor gpm gtk iconv imap ipv6 jpeg kde kipi kwallet lcms ldap libnotify mad mjpeg mmx mng modules mp3 mp4 mpeg multilib ncurses nls nptl odbc ogg openconnect opengl openmp pam pango pcre pdf phonon plasma plotutils png policykit postgres ppds python qml qt qt3support qt4 qt5 readline real samba sdl seccomp semantic-desktop session smp spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb v4l v4l2 vorbis widgets wmf wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 19 Andreas Plesch 2017-04-26 13:21:28 UTC
Emerging PyQt4 has this notice when it finishes

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

It sounds like the notice could be related to the segfaulting.

Since I faintly remembered there used to be qgis compilation problem with MAKEOPTS -j4, I reemerged both qgis and PyQt4 with MAKEOPTS -j1. But both still behave the same way.

I am out of ideas and will have to go back to 2.18.4.
Comment 20 Andreas Plesch 2017-04-26 15:17:56 UTC
Since 2.18.4-r1 is not available any more in portage, I had to go back to 2.18.3-r1 . It emerged without issues and I am happy to report that 2.18.3-r1 continues to work with python PyQt4 support on my system.
Comment 21 Andreas Sturmlechner gentoo-dev 2017-08-26 19:26:18 UTC
2.18.12 is in tree. Please test with USE=-webkit especially and re-open if it crashes again.
Comment 22 Andreas Plesch 2017-08-30 19:33:57 UTC
I emerged =2.18.12 but note there is also 2.18.12-r100 which is the default ~amd64 package. Using USE=-webkit it compiled and executed without problems. This bug is resolved.
Emerging with USE=webkit also works fine.