Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS3 implementation thread assertion failure #8

Closed
ccrook opened this issue Feb 11, 2018 · 1 comment
Closed

QGIS3 implementation thread assertion failure #8

ccrook opened this issue Feb 11, 2018 · 1 comment

Comments

@ccrook
Copy link
Owner

ccrook commented Feb 11, 2018

QGIS3 implementation under development. Currently failing with
" ASSERT failure in QgsFeatureRenderer::renderFeature: "renderFeature called in a different thread - use a cloned renderer instead"

Looking at QgsFeatureRenderer code it appears this is caused by a two calls to QgsFeatureRenderer::startRender from different threads, or from a call to renderFeature without a corresponding call to startRender.

https://qgis.org/api/classQgsFeatureRenderer.html#af01839c584bf5fc58e259adaa318c0bd

Python plugin code for startRender is at:

https://github.com/ccrook/QGIS-VectorFieldRenderer-Plugin/blob/qgis3_wip/VectorFieldRenderer/VectorFieldRenderer.py#L412

The plugin does not override renderFeature, but does override startRender, stopRender, and symbolsForFeature.

Sample project attached below. Steps to reproduce are select test.csv layer, open properties/symbology
select VectorField renderer, set X attribute to dx and Y attribute to dy, then Ok.

Running gdb qgis.bin gives following abbreviated stack trace:

Fatal: ASSERT failure in QgsFeatureRenderer::renderFeature: "renderFeature called in a different thread - use a
 cloned renderer instead", file ../../src/core/symbology/qgsrenderer.cpp, line 121
QGIS died on signal -1Warning: QPainter::end: Painter not active, aborted
Stacktrace (piped through c++filt):
/usr/bin/qgis.bin(+0xca4d)[0x555555560a4d]
/usr/bin/qgis.bin(+0xcf5a)[0x555555560f5a]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(+0x914c6)[0x7ffff4ae64c6]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QMessageLogger::warning(char const*, ...) const+0xac)[0x7ffff4ae728c]
/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5(QPainter::end()+0x35e)[0x7ffff52635ee]
/usr/lib/libqgis_core.so.2.99.0(QgsSymbolLayerUtils::symbolPreviewPixmap(QgsSymbol*, QSize, int, QgsRenderConte
xt*)+0x167)[0x7ffff5f18955]
/usr/lib/libqgis_core.so.2.99.0(QgsSymbolLegendNode::minimumIconSize(QgsRenderContext*) const+0xd3)[0x7ffff5f92
f13]
/usr/lib/libqgis_core.so.2.99.0(QgsLayerTreeModel::invalidateLegendMapBasedData()+0x1b3)[0x7ffff5f87879]
/usr/lib/libqgis_core.so.2.99.0(+0x49044b)[0x7ffff5f9044b]
/usr/lib/libqgis_core.so.2.99.0(+0x48f747)[0x7ffff5f8f747]
/usr/lib/libqgis_core.so.2.99.0(+0x48df9f)[0x7ffff5f8df9f]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QMetaObject::activate(QObject*, int, int, void**)+0x66f)[0x7ffff4d09b
af]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QTimer::timerEvent(QTimerEvent*)+0x28)[0x7ffff4d165c8]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QObject::event(QEvent*)+0xa3)[0x7ffff4d0abb3]
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0x8c)[0x7fff
f55ce05c]
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(QApplication::notify(QObject*, QEvent*)+0x256)[0x7ffff55d3516]
/usr/lib/libqgis_core.so.2.99.0(QgsApplication::notify(QObject*, QEvent*)+0x9b)[0x7ffff611b319]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QCoreApplication::notifyInternal(QObject*, QEvent*)+0xdb)[0x7ffff4cdb
38b]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QTimerInfoList::activateTimers()+0x52d)[0x7ffff4d305ed]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(+0x2dbaf1)[0x7ffff4d30af1]
../../src/core/qgsmessagelog.cpp: 27: (logMessage) [695ms] 2018-02-11T23:26:03 Qt[1] QPainter::end: Painter not
 active, aborted
Warning: QPainter::end: Painter not active, aborted
Stacktrace (piped through c++filt):
/usr/bin/qgis.bin(+0xca4d)[0x555555560a4d]
/usr/bin/qgis.bin(+0xcf5a)[0x555555560f5a]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(+0x914c6)[0x7ffff4ae64c6]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QMessageLogger::warning(char const*, ...) const+0xac)[0x7ffff4ae728c]
/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5(QPainter::end()+0x35e)[0x7ffff52635ee]
/usr/lib/libqgis_core.so.2.99.0(QgsSymbolLayerUtils::symbolPreviewPixmap(QgsSymbol*, QSize, int, QgsRenderConte
xt*)+0x167)[0x7ffff5f18955]
/usr/lib/libqgis_core.so.2.99.0(QgsSymbolLegendNode::minimumIconSize(QgsRenderContext*) const+0xd3)[0x7ffff5f92
f13]
/usr/lib/libqgis_core.so.2.99.0(QgsLayerTreeModel::invalidateLegendMapBasedData()+0x1b3)[0x7ffff5f87879]
/usr/lib/libqgis_core.so.2.99.0(+0x49044b)[0x7ffff5f9044b]
/usr/lib/libqgis_core.so.2.99.0(+0x48f747)[0x7ffff5f8f747]
/usr/lib/libqgis_core.so.2.99.0(+0x48df9f)[0x7ffff5f8df9f]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QMetaObject::activate(QObject*, int, int, void**)+0x66f)[0x7ffff4d09b
af]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QTimer::timerEvent(QTimerEvent*)+0x28)[0x7ffff4d165c8]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QObject::event(QEvent*)+0xa3)[0x7ffff4d0abb3]
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0x8c)[0x7fff
f55ce05c]
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(QApplication::notify(QObject*, QEvent*)+0x256)[0x7ffff55d3516]
/usr/lib/libqgis_core.so.2.99.0(QgsApplication::notify(QObject*, QEvent*)+0x9b)[0x7ffff611b319]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QCoreApplication::notifyInternal(QObject*, QEvent*)+0xdb)[0x7ffff4cdb
38b]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(QTimerInfoList::activateTimers()+0x52d)[0x7ffff4d305ed]
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5(+0x2dbaf1)[0x7ffff4d30af1]

Using ubuntu 16.04 nightly-ubuntugis .. details from About are

QGIS version 2.99.0-Master QGIS code revision 779fe1a
Compiled against Qt 5.5.1 Running against Qt 5.5.1
Compiled against GDAL/OGR 2.2.2 Running against GDAL/OGR 2.2.2
Compiled against GEOS 3.5.1-CAPI-1.9.1 Running against GEOS 3.5.1-CAPI-1.9.1 r4246
PostgreSQL Client Version 9.5.2 SpatiaLite Version 4.3.0a
QWT Version 6.1.2 PROJ.4 Version 492
QScintilla2 Version 2.9.1 This copy of QGIS writes debugging output.

vectest.zip

@ccrook
Copy link
Owner Author

ccrook commented Feb 14, 2018

Resolved. Simple code bug of not including self in call to base class function :-(

@ccrook ccrook closed this as completed Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant