qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.5k stars 2.99k forks source link

Crash on project open when mapcanvas extents = nan #35899

Closed signature-story closed 2 years ago

signature-story commented 4 years ago

If somehow a project's mapcanvas extents are all erroneously set to nan, then when that project is opened QGIS 3.10.2 will crash. Opening the qgs file in a text editor and changing the extents to realistic numbers will allow the project to be opened and subsequently saved and reopened without issue. But without the user savvy to edit the qgs file, there is no way to recover the project.

Reproduce by creating a new project and then saving as a qgs file. Open that qgs file in a text editor and change all mapcanvas extents to nan like this: `

feet
<extent>
  <xmin>nan</xmin>
  <ymin>nan</ymin>
  <xmax>nan</xmax>
  <ymax>nan</ymax>
</extent>

`

Save the file and then try to open it in QGIS. It will crash.

Then open in a text editor and correct the mapcanvas extents to anything realistic. For example: `

feet
<extent>
  <xmin>0</xmin>
  <ymin>0</ymin>
  <xmax>1</xmax>
  <ymax>1</ymax>
</extent>

`

Save the changes, and you should now be able to open the project in QGIS.

A separate issue is how the extents were erroneously set to nan in the first place. That's more difficult for me to verify and report, but basically it occurred when I tried to zoom to view a feature. That feature may have had bad geometries. Not sure. But it locked the viewing area and would not let me pan or zoom. I was able to exit the project, but when re-opening it would crash. Eventually discovered in the extents set to nan in the project file. If I figure out how to reproduce consistently I'll post a separate report with shapefiles.

QGIS version 3.10.2-A Coruña QGIS code revision d4cd3cfe5a Compiled against Qt 5.11.2 Running against Qt 5.11.2 Compiled against GDAL/OGR 3.0.3 Running against GDAL/OGR 3.0.3 Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1 Compiled against SQLite 3.29.0 Running against SQLite 3.29.0 PostgreSQL Client Version 11.5 SpatiaLite Version 4.3.0 QWT Version 6.1.3 QScintilla2 Version 2.10.8 Compiled against PROJ 6.3.0 Running against PROJ Rel. 6.3.0, January 1st, 2020 OS Version Windows 7 SP 1 (6.1) Active python plugins LAStools; profiletool; shapetools; db_manager; MetaSearch; processing

elpaso commented 4 years ago

@signature-story can you attach a crashing project? I tried to replace extent with nan on one o my test projects but it didn't crash.

signature-story commented 4 years ago

Zipped qgs file attached. Crashes for me every time. I created it using the steps outlined in the original post: editing new qgs file in text editor to replace extents with nan.

iCrash.zip

roya0045 commented 4 years ago

@signature-story if you update your qgis is the crash still occuring?

signature-story commented 4 years ago

yes after updating to 3.10.5 the crashes continue to occur.

pblottiere commented 4 years ago

I succeeded in opening the iCrash.qgs project with QGIS master. No crash here on Archlinux.

Pedro-Murteira commented 2 years ago

@signature-story I'm not being able to reproduce this issue on QGIS 3.22.5 and 3.24.1. Can you still reproduce the issue in more recent releases?

github-actions[bot] commented 2 years ago

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue. In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue. If there is no further activity on this issue, it will be closed in a week.

github-actions[bot] commented 2 years ago

While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue. Or, if you have any further questions, there are also further support channels that can help you.