Bug report #9562

QGIS crashes when opening a composer template with unresolvable paths

Added by Tim Sutton almost 11 years ago. Updated almost 11 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:18148

Description

We are making templates to be used by users on different operating systems. One of our templates has a north arrow image in it e..g.

  <ComposerPicture pictureWidth="11.5387" file="/usr/local/qgis-2.0/share/qgis/svg/arrows/Arrow_05.svg" pictureHeight="11.8732" mapId="-1">
   <ComposerItem width="11.5387" x="187.797" transparency="40" y="26.9237" rotation="0" height="11.8732" positionMode="0" frame="false" outlineWidth="0.3" zValue="9" lastValidViewScaleFactor="5.97987" uuid="{2c35d3f6-2709-4b47-94a9-ec183f96dfc3}" id="" background="true" blendMode="0" positionLock="false">
    <FrameColor alpha="255" red="0" blue="0" green="0"/>
    <BackgroundColor alpha="170" red="255" blue="255" green="255"/>
   </ComposerItem>
  </ComposerPicture>

While the template works well on linux, and the north arrow is simply not shown on OSX (which is acceptable), under windows it causes QGIS to crash.

I'm attaching the minidump for more info.

Note the crash only occurs when opening the template from python.

You can see an example of how we are loading the template here:

https://github.com/AIFDR/inasafe/blob/master/safe_qgis/report/map.py#L232

For more background see:

https://github.com/AIFDR/inasafe/issues/758
https://github.com/AIFDR/inasafe/issues/785

History

#1 Updated by Jürgen Fischer almost 11 years ago

  • Crashes QGIS or corrupts data changed from No to Yes

#2 Updated by Giovanni Manghi almost 11 years ago

  • Target version set to Version 2.2
  • Priority changed from Normal to High

#3 Updated by Nyall Dawson almost 11 years ago

  • Assignee deleted (Nyall Dawson)

#4 Updated by Martin Dobias almost 11 years ago

  • Status changed from Open to Feedback

Could you please attach the minidump file?

What happens on linux if the image does not exist? Crash or just no picture?

What happens if you use a raster image instead of SVG - also a crash?

Would it be possible to have 1. template file, 2. code to run in Python console to replicate the crash? (to make sure it is not something inasafe specific)

#5 Updated by Tim Sutton almost 11 years ago

Hi

I tried to upload the minidump in the original ticket but it seems to have been discarded when the ticket was submitted. I will try to find it and re-attach it, in the meantime I will make a minimal python routine which does the same logic for you to test. We have been investigating here and also have a suspicion that the crash may be caused by composition.setPlotStyle(Composition.Print) when opening the composition in preview mode in composer. Will update this when I have an example snippet to share.

Regards

Tim

#6 Updated by Tim Sutton almost 11 years ago

  • Status changed from Feedback to Closed

Ok after more testing we found that on windows the crash does not occur because of the unresolvable path. We are going to close this ticket and create a new one when we can precisely replicate / describe the cause.

Thanks for your patience.

Tim

Also available in: Atom PDF