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

Legend causing a crash #32913

Closed
chrisodell opened this issue Nov 18, 2019 · 10 comments · Fixed by #34004
Closed

Legend causing a crash #32913

chrisodell opened this issue Nov 18, 2019 · 10 comments · Fixed by #34004
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority

Comments

@chrisodell
Copy link

I use a WFS service. https://mapprod3.environment.nsw.gov.au/arcgis/services/Planning/EPI_Primary_Planning_Layers/MapServer/WFSServer?request=GetCapabilities&service=WFS

It works fine until I go into my layout and add a legend. Once the legend is added - the file crashes. Everytime.

Is it the WFS or QGIS causing the problem.

QGIS version
3.8.1-Zanzibar
QGIS code revision
dcd95cc
Compiled against Qt
5.11.2
Running against Qt
5.11.2
Compiled against GDAL/OGR
2.4.1
Running against GDAL/OGR
2.4.1
Compiled against GEOS
3.7.2-CAPI-1.11.0
Running against GEOS
3.7.2-CAPI-1.11.0 b55d2125
PostgreSQL Client Version
9.2.4
SpatiaLite Version
4.3.0
QWT Version
6.1.3
QScintilla2 Version
2.10.8
Compiled against PROJ
5.2.0
Running against PROJ
Rel. 5.2.0, September 15th, 2018
OS Version
Windows 10 (10.0)

Stack Trace

QRasterPaintEngine::transformChanged :
QPainter::translate :
QGraphicsScene::drawForeground :
QGraphicsScene::dragMoveEvent :
QGraphicsItem::dragMoveEvent :
QGraphicsEffectSource::draw :
QgsLayoutEffect::draw :
QGraphicsScene::drawItems :
QGraphicsScene::drawItems :
QGraphicsView::paintEvent :
QgsLayoutView::paintEvent :
QWidget::event :
QFrame::event :
QGraphicsView::viewportEvent :
QCoreApplicationPrivate::sendThroughObjectEventFilters :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QWidgetPrivate::drawWidget :
QWidgetPrivate::paintSiblingsRecursive :
QWidgetPrivate::drawWidget :
QWidgetPrivate::paintSiblingsRecursive :
Qd OS versions**WidgetPrivate::drawWidget :
QWidgetPrivate::paintSiblingsRecursive :
QWidgetPrivate::drawWidget :
QWidgetPrivate::paintSiblingsRecursive :
QWidgetPrivate::paintSiblingsRecursive :
QWidgetPrivate::drawWidget :
QApplication::windowIcon :
QWidgetPrivate::syncBackingStore :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processExposeEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QWindowSystemInterface::flushWindowSystemEvents :
DispatchMessageW :
DispatchMessageW :
GetSystemMetrics :
KiUserCallbackDispatcher :
NtUserDispatchMessage :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.8.1-Zanzibar
QGIS code revision: dcd95cc
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 2.4.1
Running against GDAL: 2.4.1

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.17763

@chrisodell chrisodell added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Nov 18, 2019
@nirvn
Copy link
Contributor

nirvn commented Nov 18, 2019

@chrisodell , can you attach a test project to duplicate the crash?

@chrisodell
Copy link
Author

chrisodell commented Nov 18, 2019

SAMPLE.zip

I've only got the one WFS in here. Its the one that seems to be causing my problems

@nirvn
Copy link
Contributor

nirvn commented Nov 18, 2019

Crash confirmed.

#0  0x00007ffff392ba5f in  () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#1  0x00007ffff3bfb7de in  () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#2  0x00007ffff3bfe7d5 in QPainter::setWorldTransform(QTransform const&, bool) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#3  0x00007ffff42cf32c in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#4  0x00007ffff42d08c1 in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#5  0x00007ffff4291a51 in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6  0x00007ffff43397cd in QGraphicsEffectSource::draw(QPainter*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7  0x00007ffff55f8efc in QgsLayoutEffect::draw(QPainter*) (this=0x55555afd4bf0, painter=0x7fffffffb5f0)
    at /home/webmaster/dev/cpp/QGIS/src/core/layout/qgslayouteffect.cpp:33
#8  0x00007ffff42d1484 in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007ffff42d1af2 in  () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007ffff42f5d89 in QGraphicsView::paintEvent(QPaintEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ffff676e614 in QgsLayoutView::paintEvent(QPaintEvent*) (this=0x55555bf95740, event=0x7fffffffbc50)
    at /home/webmaster/dev/cpp/QGIS/src/gui/layout/qgslayoutview.cpp:1146
#12 0x00007ffff3fdd04e in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007ffff408a782 in QFrame::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007ffff42f47b1 in QGraphicsView::viewportEvent(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ffff35867ab in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff3f9aa75 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ffff3fa3e00 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007ffff50fc30b in QgsApplication::notify(QObject*, QEvent*) (this=0x7fffffffd640, receiver=0x55555bfac610, event=0x7fffffffbc50)
    at /home/webmaster/dev/cpp/QGIS/src/core/qgsapplication.cpp:416
#19 0x00007ffff3586a9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ffff3fd5bba in QWidgetPrivate::sendPaintEvent(QRegion const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff3fd63f9 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
    at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff3fd7113 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ffff3fd610c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
    at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff3fd7113 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007ffff3fd610c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
    at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007ffff3fd7113 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#27 0x00007ffff3fd610c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()

@chrisodell
Copy link
Author

OK. That's a start! Now I'm not sure what is causing it. Any ideas??? it's doing my head in.

@nirvn
Copy link
Contributor

nirvn commented Nov 18, 2019

The crash only occurs if the layer has the filter by map content option switched on.

@nirvn
Copy link
Contributor

nirvn commented Nov 18, 2019

Here's an updated (and simplified) test project:
SAMPLE.zip

Steps to reproduce the crash:

  1. Open the test project
  2. Open the 'Site Map' layout
  3. Let the map item render
  4. Select the legend item, then activate the filter by map content toggle
  5. Select the move item content tool, and pan the map item content
  6. boom QGIS crashes

@nyalldawson , I've been able to narrow the problem down to those conditions / steps, but fail to get any further. Hope this helps out.

@nirvn
Copy link
Contributor

nirvn commented Nov 18, 2019

@nyalldawson , fixing this would likely fix three other reported issues: https://github.com/qgis/QGIS/search?q=QRasterPaintEngine%3A%3AtransformChanged&state=open&type=Issues

@nirvn
Copy link
Contributor

nirvn commented Nov 18, 2019

@nyalldawson , looking into this some more, what appears to be happening here is that somehow QgsMapHitTest::runHitTestLayer runs in its own thread and because it's fetching from a remote provider it doesn't have time to complete its job prior to the legend item rendering based on the filtered symbols being fetched.

@rouault
Copy link
Contributor

rouault commented Jan 23, 2020

Thanks for the reproducer @nirvn

@queenaminali
Copy link

I had the same problem with a fatal crash every time, even on newer versions
I've tried this and maybe it could work for you

  • Turn on all the WFS layers
  • Zoom out as much to view all the WFS objects you may have at your problematic layout
  • Open your layout

Just tell me how it worked. I'm just an QGIS user and this is my first GitHub forum message. No programming idea at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants