Bug report #16615

QGIS crashes when opening project file with nonexisting NTV2 grid file location

Added by Mario Miler about 3 years ago. Updated over 2 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Project Loading/Saving
Affected QGIS version:2.18.7 Regression?:No
Operating System:Ubuntu Linux 16.04 Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:24515

Description

When I open a QGIS project created on Windows QGIS installation (see attachment), it crashes QGIS on Linux.

I found out that the reason for that crash is in QGIS project Coordinate system definition in *.qgs file. When there is custom coordinate system definition that uses NTV2 grid file for datum transformation, it crashes QGIS (see line 28 in qgs file from attachment. Probably because that file (D:\\HRNTv2.gsb) does not exit on Linux OS.
For example, if you open a QGIS project file from the attachment, you will find something like this:

<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis projectname="" version="2.18.3">
<title></title>
<autotransaction active="0"/>
<evaluateDefaultValues active="0"/>
<layer-tree-group expanded="1" checked="Qt::Checked" name="">
<customproperties/>
<layer-tree-layer expanded="1" checked="Qt::Checked" id="Novigrad_2008_upu_stancijeta_1_point20170410131027696" name="Novigrad_2008_upu_stancijeta_1_point">
<customproperties/>
</layer-tree-layer>
<layer-tree-layer expanded="1" checked="Qt::Checked" id="Novigrad_2008_upu_stancijeta_1_polygon20170410130908229" name="Novigrad_2008_upu_stancijeta_1_polygon">
<customproperties/>
</layer-tree-layer>
</layer-tree-group>
<relations/>
<mapcanvas>
<units>meters</units>
<extent>
<xmin>5388731.26843392010778189</xmin>
<ymin>5021504.89625283982604742</ymin>
<xmax>5389744.13858615513890982</xmax>
<ymax>5022828.19216307904571295</ymax>
</extent>
<rotation>0</rotation>
<projections>1</projections>
<destinationsrs>
<spatialrefsys>
<proj4>+proj=tmerc +k=0.9999 +lon_0=15 +no_defs +x_0=5500000 +ellps=bessel +nadgrids=D:\\HRNTv2.gsb +units=m +lat_0=0 +wktext +y_0=0</proj4>
<srsid>100000</srsid>
<srid>0</srid>
<authid>USER:100000</authid>
<description>5 zona</description>
<projectionacronym>tmerc</projectionacronym>
<ellipsoidacronym>bessel</ellipsoidacronym>
<geographicflag>false</geographicflag>
</spatialrefsys>
</destinationsrs>

...
...
...

Problem is in the bold text. When I delete that line from .qgs file, it works without any problem. I believe that QGIS crashes because he can not find file D:\\HRNTv2.gsb on my Linux machine. I have that file somewhere else on my computer.

To repoduce this error:
  • unzip attachment
  • open Novigrad_2008_upu_stancijeta_1.qgs file
  • and crash

Thank you for your help and best regards,
Mario

example_qgis_crash.zip (47.8 KB) Mario Miler, 2017-05-24 10:20 PM

History

#1 Updated by Giovanni Manghi about 3 years ago

  • Easy fix? changed from Yes to No
  • Category changed from GUI to Project Loading/Saving
  • Priority changed from Low to High

#2 Updated by Even Rouault over 2 years ago

  • Status changed from Open to Feedback

I cannot reproduce with latest QGIS 2.18.14 or QGIS master on Ubuntu 16.04. If you reproduce, could you give the stacktrace when the crash occurs

#3 Updated by Mario Miler over 2 years ago

Even Rouault wrote:

I cannot reproduce with latest QGIS 2.18.14 or QGIS master on Ubuntu 16.04. If you reproduce, could you give the stacktrace when the crash occurs

Yes, you are right. The problem does not exist on 2.18.14 version. QGIS works normally.

#4 Updated by Giovanni Manghi over 2 years ago

  • Resolution set to fixed/implemented
  • Status changed from Feedback to Closed

Also available in: Atom PDF