Bug report #1089

Crash when zooming in on rendered composer map

Added by Steven Bell - over 12 years ago. Updated about 11 years ago.

Status:Closed
Priority:Low
Assignee:Marco Hugentobler
Category:-
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11149

Description

Qgis crashes when I zoom in on a composer map in render mode. To reproduce the problem:

-Open a new project
-Add a vector layer
-Open the print composer
-Add a map to the canvas
-Set the map to render mode
-Zoom in

I was able to reproduce the bug with multiple vector datasets, including archsites.shp.

The bug was introduced in r8440.

I got different backtraces when using different layers; there might actually be more than one bug involved.

#0  0xb765a3d1 in QPainter::isActive () from /usr/lib/libQtGui.so.4
#3905  0xb765fca5 in QPainter::save () from /usr/lib/libQtGui.so.4
#3906  0xb7663d1c in ?? () from /usr/lib/libQtGui.so.4
#3907  0xb766624c in QPainter::drawRects () from /usr/lib/libQtGui.so.4
#3908  0xb7666795 in QPainter::drawImage () from /usr/lib/libQtGui.so.4
#3909  0xb7163cab in QPainter::drawImage ()
   from /usr/local/lib/libqgis_core.so.0.11
#3910  0xb715f04b in [[QgsVectorLayer]]::drawFeature ()
   from /usr/local/lib/libqgis_core.so.0.11
#3911  0xb715f8b2 in [[QgsVectorLayer]]::draw ()
   from /usr/local/lib/libqgis_core.so.0.11
#3912  0xb712875d in [[QgsMapRender]]::render ()
   from /usr/local/lib/libqgis_core.so.0.11
#3913  0x08228c99 in [[QgsComposerMap]]::draw ()
#10 0x08229456 in [[QgsComposerMap]]::paint ()
#3914 0xb7aeb021 in ?? () from /usr/lib/libQtGui.so.4
#3915 0xb7aee55e in ?? () from /usr/lib/libQtGui.so.4
#3916 0xb7aeffc3 in QGraphicsScene::drawItems () from /usr/lib/libQtGui.so.4
#3917 0xb7b022ac in QGraphicsView::drawItems () from /usr/lib/libQtGui.so.4
...

On some occasions, I got several warning messages before the program crashed:

Warning: QPainter::begin: A paint device can only be painted by one painter at a time.
Warning: QPaintEngine::setSystemClip: Should not be changed while engine is active
Warning: QPaintEngine::setSystemClip: Should not be changed while engine is active
Warning: QPainter::clipPath: Painter not active

#0  0xb76320dc in QPainter::worldMatrixEnabled () from /usr/lib/libQtGui.so.4
#3905  0xb758df04 in QWidgetPrivate::paintSiblingsRecursive ()
   from /usr/lib/libQtGui.so.4
#3906  0xb758d406 in QWidgetPrivate::drawWidget () from /usr/lib/libQtGui.so.4
#3907  0xb76eee9d in ?? () from /usr/lib/libQtGui.so.4
#3908  0xb76ef627 in ?? () from /usr/lib/libQtGui.so.4
#3909  0xb759318f in QWidget::event () from /usr/lib/libQtGui.so.4
#3910  0xb78e57e5 in QMainWindow::event () from /usr/lib/libQtGui.so.4
#3911  0xb753bc0c in QApplicationPrivate::notify_helper ()
   from /usr/lib/libQtGui.so.4
#3912  0xb7540898 in QApplication::notify () from /usr/lib/libQtGui.so.4
#3913  0xb7e6b6a9 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#10 0xb75bec91 in QWidgetPrivate::dirtyWidget_sys ()
   from /usr/lib/libQtGui.so.4
#3914 0xb76ed6b0 in ?? () from /usr/lib/libQtGui.so.4
#3915 0xb76ef399 in QWidget::repaint () from /usr/lib/libQtGui.so.4
#3916 0xb7589548 in QWidget::repaint () from /usr/lib/libQtGui.so.4
#3917 0xb787b7bd in ?? () from /usr/lib/libQtGui.so.4
#3918 0xb787ba3b in QAbstractButton::mouseReleaseEvent ()
   from /usr/lib/libQtGui.so.4
#3919 0xb7954bdc in QToolButton::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#3920 0xb75934a4 in QWidget::event () from /usr/lib/libQtGui.so.4
#3921 0xb787aaff in QAbstractButton::event () from /usr/lib/libQtGui.so.4
#3922 0xb79544b4 in QToolButton::event () from /usr/lib/libQtGui.so.4
#3923 0xb753bc0c in QApplicationPrivate::notify_helper ()
   from /usr/lib/libQtGui.so.4
#3924 0xb7540cd5 in QApplication::notify () from /usr/lib/libQtGui.so.4
#3925 0xb7e6b6a9 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#3926 0xb753de21 in QApplicationPrivate::sendMouseEvent ()
   from /usr/lib/libQtGui.so.4
#3927 0xb75a7ccd in ?? () from /usr/lib/libQtGui.so.4
#3928 0xb75a66b1 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#3929 0xb75cf3ba in ?? () from /usr/lib/libQtGui.so.4
#3930 0xb6184bf8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#3931 0xb6187e5e in ?? () from /usr/lib/libglib-2.0.so.0
#3932 0x08332090 in ?? ()
#3933 0x00000000 in ?? ()

History

#1 Updated by Steven Bell - over 12 years ago

The first backtrace, with drawImage(), occurs when using a point shapefile.
This backtrace below occurred following the same procedure, but using a polygon shapefile:

#0  0xb75dc3d1 in QPainter::isActive () from /usr/lib/libQtGui.so.4
#3905  0xb75de5f8 in QPainter::clipPath () from /usr/lib/libQtGui.so.4
#3906  0xb7684b0e in ?? () from /usr/lib/libQtGui.so.4
#3907  0xb75e029a in ?? () from /usr/lib/libQtGui.so.4
#3908  0xb75e0320 in ?? () from /usr/lib/libQtGui.so.4
#3909  0xb75e100a in QPainter::restore () from /usr/lib/libQtGui.so.4
#3910  0xb7a71fd7 in QGraphicsScene::drawItems () from /usr/lib/libQtGui.so.4
#3911  0xb7a842ac in QGraphicsView::drawItems () from /usr/lib/libQtGui.so.4
#3912  0xb7a8f197 in QGraphicsView::paintEvent () from /usr/lib/libQtGui.so.4
#3913  0xb753d57b in QWidget::event () from /usr/lib/libQtGui.so.4
#10 0xb7872063 in QFrame::event () from /usr/lib/libQtGui.so.4
#3914 0xb7905c0f in QAbstractScrollArea::viewportEvent ()
   from /usr/lib/libQtGui.so.4
#3915 0xb7a8b7cf in QGraphicsView::viewportEvent () from /usr/lib/libQtGui.so.4
#3916 0xb7906f95 in ?? () from /usr/lib/libQtGui.so.4
#3917 0xb7e15a21 in QCoreApplicationPrivate::sendThroughObjectEventFilters ()
   from /usr/lib/libQtCore.so.4
...

#2 Updated by Marco Hugentobler over 12 years ago

This is a side effect introduced with the rendercontext branch

#3 Updated by Marco Hugentobler about 12 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Qt 4.4 and higher seems to have problems if processEvents() is called in the paint event of an item.
I changed the code of QgsComposerMap such that cache() is not called any more from inside the items paint event. Render mode is disabled and user needs to press 'update preview' button to re-render the map after zoom.

I hope this workaround solves the problem. If not, feel free to reopen the bug

#4 Updated by Anonymous about 11 years ago

Milestone Version 1.0.0 deleted

Also available in: Atom PDF