qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.58k stars 3k forks source link

Crash when rendering an Atlas #30226

Closed AdmiralKew closed 4 years ago

AdmiralKew commented 5 years ago

h2. User Feedback

Crash when rendering an Atlas.

h2. Report Details

Crash ID: 7b73e7fc25731f7a2b46bae1a22955f66921ad8c

Stack Trace

memcmp :
QgsHillshadeRenderer::block :
QgsBrightnessContrastFilter::block :
QgsHueSaturationFilter::block :
QgsRasterResampleFilter::block :
QgsRasterProjector::block :
QgsRasterIterator::readNextRasterPartInternal :
QgsRasterDrawer::draw :
QgsRasterLayerRenderer::render :
QgsMapRendererCustomPainterJob::doRender :
QgsMapRendererCustomPainterJob::start :
QgsMapRendererCustomPainterJob::renderSynchronously :
QgsLayoutItemMap::drawMap :
QgsLayoutItemMap::paint :
QGraphicsScene::dragMoveEvent :
QGraphicsItem::dragMoveEvent :
QGraphicsEffectSource::draw :
QgsLayoutEffect::draw :
QGraphicsScene::drawItems :
QGraphicsScene::drawItems :
QGraphicsScene::render :
QgsLayoutExporter::renderRegion :
QgsLayoutExporter::renderRegionToImage :
QgsLayoutExporter::renderPageToImage :
QgsLayoutExporter::createImage :
QgsLayoutExporter::exportToImage :
QgsLayoutExporter::exportToImage :
QgisAppInterface::actionFeatureAction :
QMetaObject::activate :
QAction::activate :
QMenu::actionGeometry :
QMenu::actionGeometry :
QMenu::mouseReleaseEvent :
QWidget::event :
QMenu::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QMenu::exec :
QToolButton::paintEvent :
QToolButton::showMenu :
QToolButton::~QToolButton :
QMetaObject::activate :
QAbstractButton::clicked :
QAbstractButton::mousePressEvent :
QToolButton::mousePressEvent :
QWidget::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info QGIS Version: 3.6.3-Noosa QGIS code revision: commit:0c5774c068 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.17134

roya0045 commented 5 years ago

Is this for any atlas? Can you reproduce it and give us the steps?

gioman commented 5 years ago

Closing for lack of feedback, please reopen if necessary.

sophiemba commented 5 years ago

I experience this bug as well, I think...

I'll try to go through my steps.

Firstly, I've tried in QGIS3.6, 3.8, 3.4LTR, 3.2 and 2.18 - no luck, all programs crash.

1) adding wfs and postGIS files to QGIS, setting up symbology

2) creating buffer 500 metres for a PostGIS point, stored locally. The buffer is my atlasID.

3) in rule-based styling: 2019-08-27_08h55_03

4) Setting up the printcomposer with a titel, controlled by the atlasID in the buffer (name of institution, address) and atlas setup. 2019-08-27_08h57_38 2019-08-27_08h58_07

5) next step, preview atlas The function starts, but crashes before preview is shown.

Crash ID: 121c7a9dac2bc8b612fb47bfe3ac5e0c59e4c538

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 : QWidgetPrivate::drawWidget : QWidgetPrivate::paintSiblingsRecursive : QWidgetPrivate::drawWidget : QWidgetPrivate::paintSiblingsRecursive : QWidgetPrivate::drawWidget : QApplication::windowIcon : QWidget::event : QApplicationPrivate::notify_helper : QApplication::notify : QgsApplication::notify : QCoreApplication::notifyInternal2 : QCoreApplicationPrivate::sendPostedEvents : QGraphicsScene::~QGraphicsScene : QObject::event : QGraphicsScene::event : QApplicationPrivate::notify_helper : QApplication::notify : QgsApplication::notify : QCoreApplication::notifyInternal2 : QCoreApplicationPrivate::sendPostedEvents : qt_plugin_query_metadata : QEventDispatcherWin32::processEvents : CallWindowProcW : DispatchMessageW : QEventDispatcherWin32::processEvents : qt_plugin_query_metadata : QEventLoop::exec : QCoreApplication::exec : main : BaseThreadInitThunk : RtlUserThreadStart :

QGIS Info QGIS Version: 3.8.2-Zanzibar QGIS code revision: 4470baa1a3 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.14393

BUT....

If I do not preview atlas, but trust my print composer setup - I am able to export atlas to PDF as wanted. Afterwards the print composer shows the last atlas-"page" of my export.

Just to test, I tried to click "preview altas" again after my success of exporting atlas to PDF. QGIS (3.8.2) crashes again: Crash ID: 4c38d98ce7a7af1ec5975f0592b07e306a14efd6

gioman commented 5 years ago

I'll try to go through my steps.

@sophiemba thanks for the detailed steps, can you attach a sample project+data that we can use to replicate the problem?

sophiemba commented 5 years ago

@gioman I've collected the used data, .qgz, .qpt and a produced .pdf.

I have removed my WMS-basemap - pwd was stored in the URL.

I use EPSG:25832 and UTF8.

The zip-file containing it all can be downloaded here: https://www.skyfish.com/sh/6b18a087d658bd64344910e73a4eafdc80f31b5b/399f0521/881230/40801128

Thanks for quick response ! :)

gioman commented 5 years ago

I've collected the used data, .qgz, .qpt and a produced .pdf.

@sophiemba just tried you project here on QGIS 3.8 on Linux, no crash.

sophiemba commented 5 years ago

ugh, mysterious

Just did this 2019-08-27_12h13_28

roya0045 commented 5 years ago

This seems like another windows only issue :/

gioman commented 5 years ago

ugh, mysterious

@sophiemba can you try with a new/clean QGIS profile? thanks.

sophiemba commented 5 years ago

Three test down.

First, tried it on a former project, where I also used the atlas function. No crash. 2019-08-28_07h20_37

Second, completely clean QGIS - added WMS basemap, two public WFS and one postGIS layer (the atlas id). Same data as yesterday (almost - yesterday the atlas id was a buffer calculated on the postGIS layer). No crash. 2019-08-28_07h27_50

Third, tried with the project from yesterday. Immediately crash when asked to perform "preview atlas". 2019-08-28_07h32_33

roya0045 commented 5 years ago

@sophiemba This is a good start, now I'm curious to know if the crashes are tied to the layout that you made, the project, a particular layer or a particular symbology.

You mentioned the rule based rendering,for the buffer, if you disable that, I would assume that the crash still occurs in the layout?

nyalldawson commented 5 years ago

@sophiemba your project download link has expired -- are you able to re-upload for me to investigate?

dkerkow commented 4 years ago

Hi, I think i have the same bug here. For my customer, I created a project template that uses wms layers, raster layers, postgis layers, and virtual layers to compute buffers, and additional memory layers or file layers that are used for creating atlas or single maps from a layout template.

Interestingly, customer reports frequent crashes on his Windows PCs, using different QGIS Versions (I think it happens from 3.4 up to 3.8, 3.10 not testet), but if I try exporting layouts from the same project files on Ubuntu 18.04 with qgis.org and ubuntugis-unstable PPA, I cant replicate the crashes.

I will try to isolate a test case and provide more info.

Here is a Crash ID I got from the customer: f25b4dff86d317211c4f763eb9f7f0b361b450e4

roya0045 commented 4 years ago

@dkerkow can you elaborate on those 'frequent crashes' if its crash on exit those should be solved in 3.10 but I would suggest that he gets 3.10.1 (I'm not sure if its out yet) where the proj6 issues should be ironed out.

Though a more detailed stack trace would be helpful.

dkerkow commented 4 years ago

@roya0045 Ok, I will ask my customer to update to latest 3.10.1 and see if it still happens. I already asked for more detailed debug info, because I only got a screenshot from customer, so no copy/paste from the stacktrace available.

In the meantime, I will try to reproduce with a broken down project file.

strozzascotte commented 4 years ago

I have experienced similar crashes while exporting atlas with QGIS 3.8.2 and 3.11 nightly build in MacOS (I cannot test the same project in 3.10 because of Bad Allocation Error #32564). On Mac, not only QGIS crashes, but the entire computer freezes and restart.

The "do not preview atlas" workaround suggested by @sophiemba doesn't solve the problem, but seems to let the exporting project progress further before crashing (i.e. instead of crashing while exporting the 2nd feature of the atlas it goes on and crashes exporting the 6th of nine).

I do use rule based style and labeling in my project.

I'll try to narrow down the problem to a specific layer or rule and post a simplified project for testing.

rouault commented 4 years ago

Assuming this was due to a WFS layer, and thus closing as a duplicate of #32913