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

Crash when resizing map window with Qt 4.6 #12774

Closed
qgib opened this issue May 13, 2010 · 23 comments
Closed

Crash when resizing map window with Qt 4.6 #12774

qgib opened this issue May 13, 2010 · 23 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Map and Legend Related to map or legend rendering
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented May 13, 2010

Author Name: Marco Hugentobler (@mhugent)
Original Redmine Issue: 2714
Affected QGIS version: master
Redmine category:map_canvas


Load a large vector file. Resize the main windows several time (or add the attribute table docked). Qgis crashes with Qt 4.6. With 4.5, there was no crash. Maybe this is because of concurrent vector access?



Related issue(s): #13830 (relates)
Redmine related issue(s): 3771


@qgib
Copy link
Contributor Author

qgib commented May 14, 2010

Author Name: Martin Dobias (@wonder-sk)


It seems it's caused by the processEvents() calls in [[QgsVectorLayer]] - the crash happens in Qt libraries. If I comment out the processEvents() calls, the segfault is gone.

My GSoC project should handle this once the rendering will be completely done in worker thread(s), but that will be too late for 1.5. So probably we should just disable these calls (they are already disabled on OS X).

@qgib
Copy link
Contributor Author

qgib commented May 14, 2010

Author Name: Marco Hugentobler (@mhugent)


Looking forward for a clean solution with the worker thread.
For the short term (1.5), maybe it is possible to improve the protection for the render method?

Because disable the calls of processEvents would mean no incremental screen updates and no interruption of the rendering for 1.5? This would make handling of large datasets with QGIS very difficult.

@qgib
Copy link
Contributor Author

qgib commented May 15, 2010

Author Name: Jürgen Fischer (@jef-n)


Replying to [comment:2 mhugent]:

Because disable the calls of processEvents would mean no incremental screen updates and no interruption of the rendering for 1.5? This would make handling of large datasets with QGIS very difficult.

The WMS provider now has the same problem. It seems to be a bug in the new Qt "Animation Framework":http://doc.trolltech.com/4.6/animation-overview.html as the "Qt Bug report #15945":http://bugreports.qt.nokia.com/browse/QTBUG-6897 looks related.

Following change works around the problem:

Index: src/gui/qgsmapcanvas.cpp
===================================================================
--- src/gui/qgsmapcanvas.cpp	(revision 13491)
+++ src/gui/qgsmapcanvas.cpp	(working copy)
@@ -960,7 +960,11 @@
     updateCanvasItemPositions();
 
     updateScale();
+#if QT_VERSION >= 0x40600
+    QTimer::singleShot( 1, this, SLOT( refresh() ) );	// take rendering outside of resizeEvent()
+#else
     refresh();
+#endif
     emit extentsChanged();
   }
   isAlreadyIn = false;

@qgib
Copy link
Contributor Author

qgib commented May 16, 2010

Author Name: Jürgen Fischer (@jef-n)


I applied the workaround in f8b728b (SVN r13501).

@qgib
Copy link
Contributor Author

qgib commented Jun 7, 2010

Author Name: Jürgen Fischer (@jef-n)


workaround fixes the crash.

@qgib
Copy link
Contributor Author

qgib commented Jun 21, 2010

Author Name: marisn - (marisn -)


Replying to [comment:6 jef]:

workaround fixes the crash.
No. It doesn't. Can't get backtrace, as running under GDB frezes whole KDE and core is truncated.

Resizing window with present vector layer still results in segfault. Can be trigerred also by moving around toolbars (cause canvas resize). And this isn't "minor: annoyance"

QGIS trunk 13763

Qt 4.6.3

Gentoo ~AMD64

@qgib
Copy link
Contributor Author

qgib commented Dec 14, 2010

Author Name: marisn - (marisn -)


Issue dissapears when I disable "Use render caching" in Options. Also - to make QGIS crash, one needs to issue multiple redraws - resize layer TOC or window and not simply minimize/maximize it. Seems to be some race condition as next redraw has to start before previous is complete.

QGIS trunk 14908

Gentoo ~AMD64

x11-libs/qt-core-4.7.1-r1:4
x11-libs/qt-dbus-4.7.1:4
x11-libs/qt-gui-4.7.1-r1:4
x11-libs/qt-multimedia-4.7.1:4
x11-libs/qt-opengl-4.7.1:4
x11-libs/qt-qt3support-4.7.1:4
x11-libs/qt-script-4.7.1-r1:4
x11-libs/qt-sql-4.7.1:4
x11-libs/qt-svg-4.7.1:4
x11-libs/qt-test-4.7.1:4
x11-libs/qt-webkit-4.7.1-r1:4
x11-libs/qt-xmlpatterns-4.7.1:4
x11-libs/qtscriptgenerator-0.1.0:0

@qgib
Copy link
Contributor Author

qgib commented Jan 14, 2011

Author Name: Jürgen Fischer (@jef-n)


see also #12944.
a3cfe6f (SVN r15506) might fix this.

@qgib
Copy link
Contributor Author

qgib commented Jan 14, 2011

Author Name: Jürgen Fischer (@jef-n)


Replying to [comment:11 jef]:

see also #12944.
a3cfe6f (SVN r15506) might fix this.
185ec5d (SVN r15051) that is.

@qgib
Copy link
Contributor Author

qgib commented Jan 14, 2011

Author Name: Jürgen Fischer (@jef-n)


see also #12399

@qgib
Copy link
Contributor Author

qgib commented Jan 14, 2011

Author Name: adbosco - (adbosco -)


This looks a lot like the (possible) race condition that causes the crashes on changing symbology, reported on #13440, #13441 and #13451.

@qgib
Copy link
Contributor Author

qgib commented Jan 17, 2011

Author Name: Giovanni Manghi (@gioman)


Replying to [comment:11 jef]:

see also #12944.
a3cfe6f (SVN r15506) might fix this.

The crash when resizing the overview windows is indeed fixed. Unfortunately it seems that there is a secondary problem (let me know if you want me to open a new ticket): resizing the overview windows is very slow, with both the "cache rendering" enabled or disabled. Just tested it with a couple of polygon/line layers (shapes, wfs).

@qgib
Copy link
Contributor Author

qgib commented Jan 17, 2011

Author Name: Giovanni Manghi (@gioman)


it doesn't seems to resize vertically at all.

The crash when resizing the overview windows is indeed fixed. Unfortunately it seems that there is a secondary problem (let me know if you want me to open a new ticket): resizing the overview windows is very slow, with both the "cache rendering" enabled or disabled. Just tested it with a couple of polygon/line layers (shapes, wfs).

@qgib
Copy link
Contributor Author

qgib commented Feb 23, 2011

Author Name: Jürgen Fischer (@jef-n)


should be fixed in 185ec5d (SVN r15051).


  • status_id was changed from Open to Closed
  • resolution was configured as fixed

@qgib
Copy link
Contributor Author

qgib commented Mar 2, 2011

Author Name: Markus Neteler (Markus Neteler)


Having loaded two vector maps (LAEA, no reprojection on the fly), resizing the window leads to a crash. Logs of two events attached.

System: Linux north 2.6.33.7-desktop-2mnb #13929 SMP Mon Sep 20 18:19:20 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

Qt 4.6.2

If it was fixed on trunk, please backport to 1.6 since it is a major showstopper.


  • status_id was changed from Closed to Feedback
  • resolution was changed from fixed to

@qgib
Copy link
Contributor Author

qgib commented Mar 2, 2011

Author Name: Paolo Cavallini (@pcav)


I just got a crash resizing a window on f5b1607 (SVN r15261), so I'm not so sure it is fully fixed in trunk.

@qgib
Copy link
Contributor Author

qgib commented Mar 2, 2011

Author Name: Paolo Cavallini (@pcav)


See also #13002, possibly duplicated

@qgib
Copy link
Contributor Author

qgib commented Apr 17, 2011

Author Name: Anne Ghisla (Anne Ghisla)


I can reproduce this bug with a huge shapefile - 37k points - and resize the main window from a corner twice. It happens anytime, disregarding render caching setting.

f8e10a3 (SVN r15725), Qt 4.7.1

@qgib
Copy link
Contributor Author

qgib commented Apr 19, 2011

Author Name: Marco Hugentobler (@mhugent)


Hopefully fixed with f4d26d6 (tested with Qt 4.7 and 4.6.2 on Linux).


  • status_id was changed from Feedback to Closed
  • resolution was changed from to fixed

@qgib
Copy link
Contributor Author

qgib commented Jun 3, 2013

Author Name: Radim Blazek (@blazek)


I have the same problem with current master with single WMS layer on Debian 5.0 and Qt 4.6.1, backtrace attached.

I am not sure if it is still the same problem, but Qt 4.6 suggests that it could be and other people just upgraded Qt to 4.7 and problem was "resolved".


  • assigned_to_id removed nobody
  • priority_id was changed from Low to Severe/Regression
  • fixed_version_id was changed from Version 1.7.0 to Version 2.0.0
  • pull_request_patch_supplied was configured as 0
  • crashes_corrupts_data was configured as 0
  • version was configured as master
  • 5827 was configured as resize-crash-backtrace.txt
  • category_id was changed from GUI to Map Canvas
  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Jun 20, 2013

Author Name: Matthias Kuhn (@m-kuhn)


Could be related, based on the stack trace.

Can you try to enable backbuffering in Settings => Options => Rendering.

@qgib
Copy link
Contributor Author

qgib commented Jun 20, 2013

Author Name: Jürgen Fischer (@jef-n)


Radim Blazek wrote:

I have the same problem with current master with single WMS layer on Debian 5.0 and Qt 4.6.1, backtrace attached.

I am not sure if it is still the same problem, but Qt 4.6 suggests that it could be and other people just upgraded Qt to 4.7 and problem was "resolved".

lenny is oldoldstable. And if upgrading to Qt 4.7 helps, this might be a Qt problem after all. Should that really be a blocker?

@qgib
Copy link
Contributor Author

qgib commented Jul 8, 2013

Author Name: Jürgen Fischer (@jef-n)


Jürgen Fischer wrote:

lenny is oldoldstable. And if upgrading to Qt 4.7 helps, this might be a Qt problem after all. Should that really be a blocker?

Closing it again.


  • priority_id was changed from Severe/Regression to Normal
  • status_id was changed from Reopened to Closed
  • resolution was changed from fixed to up-/downstream

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Map and Legend Related to map or legend rendering labels May 24, 2019
@qgib qgib added this to the Version 2.0.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
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! Map and Legend Related to map or legend rendering
Projects
None yet
Development

No branches or pull requests

1 participant