Bug report #10164

QGIS master crashes on zoom in / zoom out

Added by Pedro Venâncio over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Martin Dobias
Category:-
Affected QGIS version:master Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:18618

Description

Hi,

After a set of tests [0], I believe there is a problem with QGIS master in Precise 32bits.

It is continually crashing with a segmentation fault (core dumped). I just load a layer (raster / shape / postgis) and do some zoom in / zoom out.

$ qgis
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_US]
Warning: QGraphicsScene::addItem: item has already been added to this scene
no need
false; DefaultProxy; ; ; ; *********;
Warning: QGraphicsScene::addItem: item has already been added to this scene
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
breaking!
Segmentation fault (core dumped)

The faster I zoom in / zoom out, more "breaking!" appears, until the Segmentation fault... See here:

https://dl.dropboxusercontent.com/u/5772257/qgis/crash.ogv
https://dl.dropboxusercontent.com/u/5772257/qgis/crash_nightly.ogv

I've been looking at the tests during compilation, and the segmentation fault appears in qgis_zoomtest:

      Start 43: qgis_shapebursttest
43/92 Test #43: qgis_shapebursttest ..................***Failed    2.12 sec
      Start 44: qgis_zoomtest
44/92 Test #44: qgis_zoomtest ........................***Exception: SegFault 18.12 sec
      Start 45: qgis_projectionissues
45/92 Test #45: qgis_projectionissues ................   Passed   28.29 sec

Looking at the results of the last few weeks in CDash QGIS, this test failed in all builds on Ubuntu 12.04 32bit (and apparently also in Debian Jessie 32bits and Debian Unstable 32bits):

http://dash.orfeo-toolbox.org/testSummary.php?project=8&name=qgis_zoomtest&date=2014-05-01

[0] http://osgeo-org.1560.x6.nabble.com/QGIS-master-crashes-on-zoom-in-zoom-out-td5137254.html

Associated revisions

Revision e6b337e3
Added by Martin Dobias over 6 years ago

Trying to fix #10164 (crash on zoom in/out)

This happens due to infinite recursion when syncing extent between
map canvas and map renderer. Not entirely sure why, seems to happen
only on 32bit systems.

History

#1 Updated by Nathan Woodrow over 6 years ago

  • Assignee set to Martin Dobias

#2 Updated by Martin Dobias over 6 years ago

Pedro, are you able to compile QGIS in debug mode and run QGIS in debugger, so that we can get the backtrace? That would help a lot!

#3 Updated by Pedro Venâncio over 6 years ago

Hi Martin,

I tried now with today's nightly build and still crashing, as in http://dash.orfeo-toolbox.org/testSummary.php?project=8&name=qgis_zoomtest&date=2014-06-03

How can I compile and run QGIS in debug mode? Are there instructions somewhere?

Thank you Martin!

#4 Updated by Pedro Venâncio over 6 years ago

Hi again,

I did some tests, compiled with debug mode option, but I dont know if I'm using debug mode correctly. Please see here:

[email protected]:~/sextante_github$ gdb /usr/bin/qgis.bin
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying" 
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/bin/qgis.bin...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/qgis.bin 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_US]
Warning: QGraphicsScene::addItem: item has already been added to this scene
[New Thread 0xb57cdb40 (LWP 17131)]
[New Thread 0xb4eccb40 (LWP 17132)]
PSQLConnection
Warning: QSqlQuery::exec: database not open
Warning: QSqlQuery::exec: database not open
LAYERa
LAYERb
QueryType
OPERATOR
SPATIALREL
false; DefaultProxy; ; ; ; *********; 
DEBUG:MetaSearch:Setting up i18n
DEBUG:MetaSearch:Locale name: en
DEBUG:MetaSearch:Translation loaded: /usr/share/qgis/python/plugins/MetaSearch/locale/en/LC_MESSAGES/ui.qm
[New Thread 0xa7bcab40 (LWP 17182)]
[New Thread 0xa71ffb40 (LWP 17183)]
[New Thread 0xa67ffb40 (LWP 17184)]
[Thread 0xa7bcab40 (LWP 17182) exited]
[Thread 0xa71ffb40 (LWP 17183) exited]
Warning: Loading a style file that was saved with an older version of qgis (saved in 2.2.0-Valmiera, loaded in 2.3.0-Master). Problems may occur.
[New Thread 0xa71ffb40 (LWP 17187)]
[Thread 0xa67ffb40 (LWP 17184) exited]

Program received signal SIGSEGV, Segmentation fault.
0x02e65cc7 in QgsMapCanvas::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_gui.so.2.3.0
(gdb) 
(gdb) continue 
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x02e65cc7 in QgsMapCanvas::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_gui.so.2.3.0
(gdb) continue 
Continuing.
[Thread 0xb4eccb40 (LWP 17132) exited]
[Thread 0xa71ffb40 (LWP 17187) exited]
[Thread 0xb57cdb40 (LWP 17131) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
[email protected]:~$ gdb /usr/bin/qgis.bin
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying" 
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/bin/qgis.bin...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/qgis.bin 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_US]
Warning: QGraphicsScene::addItem: item has already been added to this scene
[New Thread 0xb57cdb40 (LWP 19694)]
[New Thread 0xb4eccb40 (LWP 19695)]
PSQLConnection
Warning: QSqlQuery::exec: database not open
Warning: QSqlQuery::exec: database not open
LAYERa
LAYERb
QueryType
OPERATOR
SPATIALREL
false; DefaultProxy; ; ; ; *********; 
DEBUG:MetaSearch:Setting up i18n
DEBUG:MetaSearch:Locale name: en
DEBUG:MetaSearch:Translation loaded: /usr/share/qgis/python/plugins/MetaSearch/locale/en/LC_MESSAGES/ui.qm
[New Thread 0xa4011b40 (LWP 19707)]
[New Thread 0xa36ffb40 (LWP 19708)]
[New Thread 0xa2cffb40 (LWP 19709)]
[New Thread 0xa22ffb40 (LWP 19710)]
[Thread 0xa36ffb40 (LWP 19708) exited]
[Thread 0xa2cffb40 (LWP 19709) exited]
[Thread 0xa22ffb40 (LWP 19710) exited]
[New Thread 0xa22ffb40 (LWP 19711)]
[New Thread 0xa2cffb40 (LWP 19712)]
[New Thread 0xa36ffb40 (LWP 19713)]
[Thread 0xa36ffb40 (LWP 19713) exited]
[Thread 0xa22ffb40 (LWP 19711) exited]
[Thread 0xa4011b40 (LWP 19707) exited]
[New Thread 0xa4011b40 (LWP 19714)]
[New Thread 0xa22ffb40 (LWP 19716)]
[New Thread 0xa36ffb40 (LWP 19717)]
[New Thread 0xa18ffb40 (LWP 19718)]
[New Thread 0xa0effb40 (LWP 19719)]
[New Thread 0xa04ffb40 (LWP 19720)]
[New Thread 0x9fcfeb40 (LWP 19721)]
[Thread 0xa2cffb40 (LWP 19712) exited]
[Thread 0xa04ffb40 (LWP 19720) exited]
[Thread 0x9fcfeb40 (LWP 19721) exited]
[Thread 0xa36ffb40 (LWP 19717) exited]
[Thread 0xa0effb40 (LWP 19719) exited]
[Thread 0xa4011b40 (LWP 19714) exited]
[Thread 0xa18ffb40 (LWP 19718) exited]
[New Thread 0xa18ffb40 (LWP 19722)]
[New Thread 0xa4011b40 (LWP 19723)]
[New Thread 0xa0effb40 (LWP 19724)]
[New Thread 0xa36ffb40 (LWP 19725)]
[Thread 0xa0effb40 (LWP 19724) exited]
[Thread 0xa18ffb40 (LWP 19722) exited]
[Thread 0xa22ffb40 (LWP 19716) exited]
[Thread 0xa36ffb40 (LWP 19725) exited]
[New Thread 0xa36ffb40 (LWP 19726)]
[Thread 0xa36ffb40 (LWP 19726) exited]
[New Thread 0xa36ffb40 (LWP 19728)]
[Thread 0xa4011b40 (LWP 19723) exited]
[New Thread 0xa4011b40 (LWP 19729)]
[New Thread 0xa22ffb40 (LWP 19730)]
[Thread 0xa22ffb40 (LWP 19730) exited]
[Thread 0xa36ffb40 (LWP 19728) exited]
[New Thread 0xa36ffb40 (LWP 19766)]
[Thread 0xa36ffb40 (LWP 19766) exited]
[New Thread 0xa36ffb40 (LWP 19768)]
[Thread 0xa4011b40 (LWP 19729) exited]

Program received signal SIGSEGV, Segmentation fault.
0x028b2f14 in QgsMapRenderer::adjustExtentToSize() ()
   from /usr/lib/libqgis_core.so.2.3.0
(gdb) where
#0  0x028b2f14 in QgsMapRenderer::adjustExtentToSize() ()
   from /usr/lib/libqgis_core.so.2.3.0
#1  0x028b3340 in QgsMapRenderer::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_core.so.2.3.0
#2  0x02e6038b in QgsMapCanvasRendererSync::onExtentC2R() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#3  0x02f03a1d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#4  0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#5  0x02f03c75 in QgsMapCanvas::extentsChanged() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#6  0x02e65d25 in QgsMapCanvas::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_gui.so.2.3.0
#7  0x02e671d3 in QgsMapCanvasRendererSync::onExtentR2C() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#8  0x02f03a2d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#9  0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#10 0x02ab5a25 in QgsMapRenderer::extentsChanged() ()
   from /usr/lib/libqgis_core.so.2.3.0
#11 0x028b3310 in QgsMapRenderer::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_core.so.2.3.0
#12 0x02e6038b in QgsMapCanvasRendererSync::onExtentC2R() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#13 0x02f03a1d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#14 0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#15 0x02f03c75 in QgsMapCanvas::extentsChanged() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#16 0x02e65d25 in QgsMapCanvas::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_gui.so.2.3.0
#17 0x02e671d3 in QgsMapCanvasRendererSync::onExtentR2C() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#18 0x02f03a2d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#19 0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#20 0x02ab5a25 in QgsMapRenderer::extentsChanged() ()
   from /usr/lib/libqgis_core.so.2.3.0
#21 0x028b3310 in QgsMapRenderer::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_core.so.2.3.0
#22 0x02e6038b in QgsMapCanvasRendererSync::onExtentC2R() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#23 0x02f03a1d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#24 0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#25 0x02f03c75 in QgsMapCanvas::extentsChanged() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#26 0x02e65d25 in QgsMapCanvas::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_gui.so.2.3.0
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x028b2f14 in QgsMapRenderer::adjustExtentToSize() ()
   from /usr/lib/libqgis_core.so.2.3.0
(gdb) where
#0  0x028b2f14 in QgsMapRenderer::adjustExtentToSize() ()
   from /usr/lib/libqgis_core.so.2.3.0
#1  0x028b3340 in QgsMapRenderer::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_core.so.2.3.0
#2  0x02e6038b in QgsMapCanvasRendererSync::onExtentC2R() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#3  0x02f03a1d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#4  0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#5  0x02f03c75 in QgsMapCanvas::extentsChanged() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#6  0x02e65d25 in QgsMapCanvas::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_gui.so.2.3.0
#7  0x02e671d3 in QgsMapCanvasRendererSync::onExtentR2C() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#8  0x02f03a2d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#9  0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#10 0x02ab5a25 in QgsMapRenderer::extentsChanged() ()
   from /usr/lib/libqgis_core.so.2.3.0
#11 0x028b3310 in QgsMapRenderer::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_core.so.2.3.0
#12 0x02e6038b in QgsMapCanvasRendererSync::onExtentC2R() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#13 0x02f03a1d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#14 0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#15 0x02f03c75 in QgsMapCanvas::extentsChanged() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#16 0x02e65d25 in QgsMapCanvas::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_gui.so.2.3.0
#17 0x02e671d3 in QgsMapCanvasRendererSync::onExtentR2C() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#18 0x02f03a2d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#19 0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#20 0x02ab5a25 in QgsMapRenderer::extentsChanged() ()
   from /usr/lib/libqgis_core.so.2.3.0
#21 0x028b3310 in QgsMapRenderer::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_core.so.2.3.0
#22 0x02e6038b in QgsMapCanvasRendererSync::onExtentC2R() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#23 0x02f03a1d in ?? () from /usr/lib/libqgis_gui.so.2.3.0
#24 0x032976b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#25 0x02f03c75 in QgsMapCanvas::extentsChanged() ()
   from /usr/lib/libqgis_gui.so.2.3.0
#26 0x02e65d25 in QgsMapCanvas::setExtent(QgsRectangle const&) ()
   from /usr/lib/libqgis_gui.so.2.3.0
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) continue 
Continuing.
[Thread 0xa36ffb40 (LWP 19768) exited]
[Thread 0xb4eccb40 (LWP 19695) exited]
[Thread 0xb57cdb40 (LWP 19694) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)

#5 Updated by Martin Dobias over 6 years ago

Great, thanks a lot Pedro, this helped to identify where the crash happens (although I'm not entirely sure about the cause).

#6 Updated by dr - over 6 years ago

Confirm this behavior on the same Ubuntu version.

#7 Updated by Pedro Venâncio over 6 years ago

Great Martin,

If you need I do more tests here, guide me in the process, because it is the first time I am using the debugger.

Thanks!

#8 Updated by Martin Dobias over 6 years ago

  • Status changed from Open to Closed

#9 Updated by Martin Dobias over 6 years ago

Please try again and report whether the fix helped - as I cannot reproduce the problem, I am not 100% sure.

#10 Updated by Pedro Venâncio over 6 years ago

Excellent Martin!!! Passed the test during the compilation [0] and is running smoothly!!!

Thank you very much!!!

[0] http://dash.orfeo-toolbox.org/testSummary.php?project=8&name=qgis_zoomtest&date=2014-06-05

Also available in: Atom PDF