Bug report #6440

qgis master [windows,linux] will die opening a project after saving a project

Added by Mathieu Pellerin - nIRV about 9 years ago. Updated about 9 years ago.

Assignee:Marco Hugentobler
Category:Project Loading/Saving
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:15681


Finally managed to come up with easy steps to reproduce a long-standing (memory?) issue with qgis master that results in qgis being hyper slow in loading a project file and often simply crashing before project is fully loaded.

Steps to reproduce this critical issue:
1. Open QGIS
2. Load a project file (if possible, with at least a 20 layers)
3. After loading, click on the "Save Project" button
4. Then, re-load the same project (via menu's recent project or by selection project in file dialogue box, doesn't matter)

Upon loading a project after saving an ongoing project, QGIS becomes increasingly slow at loading each layer of project being loaded, and eventually can crash while loading. I've been seeing this problem with both my windows and linux machine.

Not sure what is causing this; memory corruption in the saving project function? It is a regression from previous versions of QGIS, and a big one at it.

freezing_after_saving.webm - video showing freezing / slow loading of project after saving a project (2.91 MB) Mathieu Pellerin - nIRV, 2012-10-04 09:33 PM


#1 Updated by Giovanni Manghi about 9 years ago

  • Category set to Project Loading/Saving
  • Target version set to Version 2.0.0

#2 Updated by Giuseppe Sucameli about 9 years ago

  • Status changed from Open to Feedback

I'm unable to reproduce the bug on by Ubuntu 11.04.

I've made some changes to project opening and closing in commit bc1bce195e, maybe that commit fixed also this problem and that's the reason I can't reproduce it.

Could you try again with the latest master?

#3 Updated by Mathieu Pellerin - nIRV about 9 years ago

Hmm; I've downloaded latest nightly (both osgeo4w and ubuntu packages), and I can still reproduce the issue. Have you tried loading a project with many layers? A small project won't show the issue to its full extend. Will come up with a video recording of the issue now.

#4 Updated by Mathieu Pellerin - nIRV about 9 years ago

Giuseppe, have a look at the attached video, hope it'll help.

#5 Updated by Nathan Woodrow about 9 years ago

That is a very strange bug. Not confirmed here yet but I have a large project at work I can test with.

#6 Updated by Mathieu Pellerin - nIRV about 9 years ago

- The above video was made using qgis master with all plugins disabled (ruling out a defective plugin causing the issue).
- I've tried a variety of large projects on my computer; all of them will result in slow / freezed loading after saving a project.
- Issue not raster related as projects with no raster layers will be affected by this issue.
- All of my projects are heavily reliant on shapefiles; all of the layers a file-based (i.e. no database or server-based layers).
- I can reproduce this on three different machines (two ubuntu machines, as well as one windows 7 machine)

Giuseppe, just to be clear re my previous comment, I'm still seeing this issue with builds that include the commit your referred to.

#7 Updated by Mathieu Pellerin - nIRV about 9 years ago

I just found out what's happening!

The slowdown / die will occur when loading a project after saving a project within a same session when project being loaded as composer map(s) with rendering set to cache.

So what must be happening is that for some reason, after saving a project, qgis will not suspend composer map(s) rendering when loading project.

#8 Updated by Mathieu Pellerin - nIRV about 9 years ago

Giuseppe, one way to fix this is to insure project's composers are initiated after all layers are loaded (avoiding the composer map(s) cache from being refreshed while loading project upon insertion of each layer). I'm however not familiar enough with the QGIS source code to figure out how it triggers loading of composers when opening the project's xml file.

#9 Updated by Marco Hugentobler about 9 years ago

  • Assignee set to Marco Hugentobler

#10 Updated by Marco Hugentobler about 9 years ago

  • Status changed from Feedback to Closed

Turned out the composers were not properly cleaned up, therefore the composermaps received update notifications.
Should be fixed in master (65141e29eec30e8f70d42d3f6df3b160c5d65c57). Please test and reopen if the issue is still there.

#11 Updated by Mathieu Pellerin - nIRV about 9 years ago

Wouhou! God, that one was not easy to narrow down. Thanks a bunch Marco. Will verify with a nightly build tomorrow.

#12 Updated by Mathieu Pellerin - nIRV about 9 years ago

Confirmed fixed. Kudos.

Also available in: Atom PDF