Opened 14 years ago
Closed 13 years ago
#2714 closed bug (fixed)
Crash when resizing map window with Qt 4.6
Reported by: | mhugent | Owned by: | nobody |
---|---|---|---|
Priority: | critical: causes crash or data corruption | Milestone: | Version 1.7.0 |
Component: | GUI | Version: | Trunk |
Keywords: | Cc: | ||
Must Fix for Release: | No | Platform: | All |
Platform Version: | Awaiting user input: | no |
Description
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?
Attachments (4)
Change History (26)
comment:1 by , 14 years ago
follow-up: 3 comment:2 by , 14 years ago
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.
comment:3 by , 14 years ago
Replying to 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 as the Qt Bug report #6797 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;
comment:5 by , 14 years ago
Must Fix for Release: | Yes → No |
---|
follow-up: 8 comment:6 by , 14 years ago
Priority: | critical: causes crash or data corruption → minor: annoyance |
---|
workaround fixes the crash.
comment:7 by , 14 years ago
Milestone: | Version 1.5.0 → Version 1.6.0 |
---|
comment:8 by , 14 years ago
Replying to 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
comment:9 by , 13 years ago
Priority: | minor: annoyance → critical: causes crash or data corruption |
---|
by , 13 years ago
Attachment: | qgis_canvas_resize_point_bt added |
---|
Resizing canvas with single point layer and render cache "on"
by , 13 years ago
Attachment: | qgis_canvas_resize_line_bt added |
---|
Resizing canvas with single line layer and render cache "on"
comment:10 by , 13 years ago
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
comment:12 by , 13 years ago
comment:14 by , 13 years ago
follow-up: 16 comment:15 by , 13 years ago
Replying to jef:
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).
comment:16 by , 13 years ago
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).
comment:18 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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 #1 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.
comment:19 by , 13 years ago
I just got a crash resizing a window on r15260, so I'm not so sure it is fully fixed in trunk.
comment:21 by , 13 years ago
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.
r15724, Qt 4.7.1
comment:22 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Hopefully fixed with r15771 (tested with Qt 4.7 and 4.6.2 on Linux).
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).