Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1089 closed bug (fixed)

Crash when zooming in on rendered composer map

Reported by: StevenB Owned by: mhugent
Priority: critical: causes crash or data corruption Milestone:
Component: Printing Version: Trunk
Keywords: composer render clip zoom Cc:
Must Fix for Release: No Platform: Debian
Platform Version: Awaiting user input: no

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
#1  0xb765fca5 in QPainter::save () from /usr/lib/libQtGui.so.4
#2  0xb7663d1c in ?? () from /usr/lib/libQtGui.so.4
#3  0xb766624c in QPainter::drawRects () from /usr/lib/libQtGui.so.4
#4  0xb7666795 in QPainter::drawImage () from /usr/lib/libQtGui.so.4
#5  0xb7163cab in QPainter::drawImage ()
   from /usr/local/lib/libqgis_core.so.0.11
#6  0xb715f04b in QgsVectorLayer::drawFeature ()
   from /usr/local/lib/libqgis_core.so.0.11
#7  0xb715f8b2 in QgsVectorLayer::draw ()
   from /usr/local/lib/libqgis_core.so.0.11
#8  0xb712875d in QgsMapRender::render ()
   from /usr/local/lib/libqgis_core.so.0.11
#9  0x08228c99 in QgsComposerMap::draw ()
#10 0x08229456 in QgsComposerMap::paint ()
#11 0xb7aeb021 in ?? () from /usr/lib/libQtGui.so.4
#12 0xb7aee55e in ?? () from /usr/lib/libQtGui.so.4
#13 0xb7aeffc3 in QGraphicsScene::drawItems () from /usr/lib/libQtGui.so.4
#14 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
#1  0xb758df04 in QWidgetPrivate::paintSiblingsRecursive ()
   from /usr/lib/libQtGui.so.4
#2  0xb758d406 in QWidgetPrivate::drawWidget () from /usr/lib/libQtGui.so.4
#3  0xb76eee9d in ?? () from /usr/lib/libQtGui.so.4
#4  0xb76ef627 in ?? () from /usr/lib/libQtGui.so.4
#5  0xb759318f in QWidget::event () from /usr/lib/libQtGui.so.4
#6  0xb78e57e5 in QMainWindow::event () from /usr/lib/libQtGui.so.4
#7  0xb753bc0c in QApplicationPrivate::notify_helper ()
   from /usr/lib/libQtGui.so.4
#8  0xb7540898 in QApplication::notify () from /usr/lib/libQtGui.so.4
#9  0xb7e6b6a9 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#10 0xb75bec91 in QWidgetPrivate::dirtyWidget_sys ()
   from /usr/lib/libQtGui.so.4
#11 0xb76ed6b0 in ?? () from /usr/lib/libQtGui.so.4
#12 0xb76ef399 in QWidget::repaint () from /usr/lib/libQtGui.so.4
#13 0xb7589548 in QWidget::repaint () from /usr/lib/libQtGui.so.4
#14 0xb787b7bd in ?? () from /usr/lib/libQtGui.so.4
#15 0xb787ba3b in QAbstractButton::mouseReleaseEvent ()
   from /usr/lib/libQtGui.so.4
#16 0xb7954bdc in QToolButton::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#17 0xb75934a4 in QWidget::event () from /usr/lib/libQtGui.so.4
#18 0xb787aaff in QAbstractButton::event () from /usr/lib/libQtGui.so.4
#19 0xb79544b4 in QToolButton::event () from /usr/lib/libQtGui.so.4
#20 0xb753bc0c in QApplicationPrivate::notify_helper ()
   from /usr/lib/libQtGui.so.4
#21 0xb7540cd5 in QApplication::notify () from /usr/lib/libQtGui.so.4
#22 0xb7e6b6a9 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#23 0xb753de21 in QApplicationPrivate::sendMouseEvent ()
   from /usr/lib/libQtGui.so.4
#24 0xb75a7ccd in ?? () from /usr/lib/libQtGui.so.4
#25 0xb75a66b1 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#26 0xb75cf3ba in ?? () from /usr/lib/libQtGui.so.4
#27 0xb6184bf8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#28 0xb6187e5e in ?? () from /usr/lib/libglib-2.0.so.0
#29 0x08332090 in ?? ()
#30 0x00000000 in ?? ()

Change History (5)

comment:1 by StevenB, 16 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
#1  0xb75de5f8 in QPainter::clipPath () from /usr/lib/libQtGui.so.4
#2  0xb7684b0e in ?? () from /usr/lib/libQtGui.so.4
#3  0xb75e029a in ?? () from /usr/lib/libQtGui.so.4
#4  0xb75e0320 in ?? () from /usr/lib/libQtGui.so.4
#5  0xb75e100a in QPainter::restore () from /usr/lib/libQtGui.so.4
#6  0xb7a71fd7 in QGraphicsScene::drawItems () from /usr/lib/libQtGui.so.4
#7  0xb7a842ac in QGraphicsView::drawItems () from /usr/lib/libQtGui.so.4
#8  0xb7a8f197 in QGraphicsView::paintEvent () from /usr/lib/libQtGui.so.4
#9  0xb753d57b in QWidget::event () from /usr/lib/libQtGui.so.4
#10 0xb7872063 in QFrame::event () from /usr/lib/libQtGui.so.4
#11 0xb7905c0f in QAbstractScrollArea::viewportEvent ()
   from /usr/lib/libQtGui.so.4
#12 0xb7a8b7cf in QGraphicsView::viewportEvent () from /usr/lib/libQtGui.so.4
#13 0xb7906f95 in ?? () from /usr/lib/libQtGui.so.4
#14 0xb7e15a21 in QCoreApplicationPrivate::sendThroughObjectEventFilters ()
   from /usr/lib/libQtCore.so.4
...

comment:2 by mhugent, 16 years ago

Owner: changed from nobody to mhugent

This is a side effect introduced with the rendercontext branch

comment:3 by timlinux, 16 years ago

Milestone: Version 1.0.0

comment:4 by mhugent, 16 years ago

Resolution: fixed
Status: newclosed

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

comment:5 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.