Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS crashes with GEOS Exception: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4 #23431

Closed
qgib opened this issue Aug 31, 2016 · 11 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority Projections/Transformations Related to coordinate reference systems or coordinate transformation
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Aug 31, 2016

Author Name: Tudor Bărăscu (@tudorbarascu)
Original Redmine Issue: 15507
Affected QGIS version: 2.18.7
Redmine category:projection_support
Assignee: Sandro Santilli


The problem has also been encountered in the mailing list https://lists.osgeo.org/pipermail/qgis-developer/2016-May/042692.html

QGIS simply crashes in some projects that have specific geometry although I tested the geometry validity and it's all good.

The error is:

src/core/qgsmessagelog.cpp: 45: (logMessage) [0ms] [thread:0x605ec20] 2016-08-31T21:44:39 GEOS[1] Exception: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4
src/core/geometry/qgsgeos.cpp: 63: (throwGEOSException) [0ms] [thread:0x605ec20] GEOS exception: IllegalArgumentException: RobustDeterminant encountered non-finite numbers

The problem was tested under Spatialite and under Postgis.
I've turned feature simplification off in QGIS to no avail.
I've attached data and you can replicate by taking the following steps:

  • Open the project
  • Change the CRS from 4326 to 3857 (web mercator)
  • Crash

Depending on the styling/labeling, it may not crash.

I can replicate under QGIS 2.14.6 and 2.16.2

Thanks


@qgib
Copy link
Contributor Author

qgib commented Sep 2, 2016

Author Name: Jukka Rahkonen (Jukka Rahkonen)


Source data contains vertices like POINT (25.714286 -90)which are outside the valid area for EPSG:3857 which is "World between 85.06°S and 85.06°N." http://epsg.io/3857. I guess that latitude -90 leads to divide by zero error and it just can't work.

Crash is not the best thing to happen but how to prevent it and throw an error instead?

@qgib
Copy link
Contributor Author

qgib commented Mar 7, 2017

Author Name: Giovanni Manghi (@gioman)


  • category_id was configured as Projection Support
  • priority_id was changed from Normal to High
  • fixed_version_id was configured as Version 2.18
  • version was changed from 2.14.5 to 2.18.4
  • crashes_corrupts_data was changed from 0 to 1
  • operating_system was changed from Debian Stretch to

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0
  • regression was configured as 0

@qgib
Copy link
Contributor Author

qgib commented May 16, 2017

Author Name: Sandro Santilli (@strk)


QGIS simply crashes in some projects that have specific geometry although I tested the geometry validity and it's all good.

The error is:

src/core/qgsmessagelog.cpp: 45: (logMessage) [0ms] [thread:0x605ec20] 2016-08-31T21:44:39 GEOS[1] Exception: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4
src/core/geometry/qgsgeos.cpp: 63: (throwGEOSException) [0ms] [thread:0x605ec20] GEOS exception: IllegalArgumentException: RobustDeterminant encountered non-finite numbers

The problem was tested under Spatialite and under Postgis.
I've turned feature simplification off in QGIS to no avail.
I've attached data and you can replicate by taking the following steps:

  • Open the project
  • Change the CRS from 4326 to 3857 (web mercator)
  • Crash

Depending on the styling/labeling, it may not crash.

I can replicate under QGIS 2.14.6 and 2.16.2

Thanks
to The problem has also been encountered in the mailing list https://lists.osgeo.org/pipermail/qgis-developer/2016-May/042692.html

QGIS simply crashes in some projects that have specific geometry although I tested the geometry validity and it's all good.

The error is:

src/core/qgsmessagelog.cpp: 45: (logMessage) [0ms] [thread:0x605ec20] 2016-08-31T21:44:39 GEOS[1] Exception: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4
src/core/geometry/qgsgeos.cpp: 63: (throwGEOSException) [0ms] [thread:0x605ec20] GEOS exception: IllegalArgumentException: RobustDeterminant encountered non-finite numbers

The problem was tested under Spatialite and under Postgis.
I've turned feature simplification off in QGIS to no avail.
I've attached data and you can replicate by taking the following steps:

  • Open the project
  • Change the CRS from 4326 to 3857 (web mercator)
  • Crash

Depending on the styling/labeling, it may not crash.

I can replicate under QGIS 2.14.6 and 2.16.2

Thanks

@qgib
Copy link
Contributor Author

qgib commented May 16, 2017

Author Name: Sandro Santilli (@strk)


Can still be reproduced as of fd7b52d (current release-2_18 branch)


  • version was changed from 2.18.4 to 2.18.7

@qgib
Copy link
Contributor Author

qgib commented May 16, 2017

Author Name: Sandro Santilli (@strk)


Pull request ready: #4563


  • pull_request_patch_supplied was changed from 0 to 1

@qgib
Copy link
Contributor Author

qgib commented May 16, 2017

Author Name: Sandro Santilli (@strk)


NOTE: the pull request referenced above is for the 2.18 release.

I've tried to reproduce this bug on master branch and obtained a different behavior: no crash but nothing rendered (while the patch to 2.18 branch also gives a working rendering)

@qgib
Copy link
Contributor Author

qgib commented May 16, 2017

Author Name: Sandro Santilli (@strk)


Applied in changeset 126cf5f.


  • status_id was changed from In Progress to Closed
  • done_ratio was changed from 0 to 100

@qgib
Copy link
Contributor Author

qgib commented May 16, 2017

Author Name: Sandro Santilli (@strk)


I'm reopening to get this also fixed in the master branch, where the crash is not present but the features disappear from the map completely instead, logging the "IllegalArgumentException: Invalid number of points in LinearRing found" message.


  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented May 16, 2017

Author Name: Sandro Santilli (@strk)


4ed096b forward-ports the test to master (but no fix was needed there to avoid the crash)

@qgib
Copy link
Contributor Author

qgib commented May 16, 2017

Author Name: Sandro Santilli (@strk)


Actually, as the crash is fixed, I'm closing this again.
It's better to have a separate issue for the lack of GUI error message (is an enhancement)
and for the rendering issue (it's not a crash).


  • status_id was changed from Reopened to Closed
  • resolution was changed from to fixed/implemented

@qgib qgib closed this as completed May 16, 2017
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Projections/Transformations Related to coordinate reference systems or coordinate transformation Crash/Data Corruption labels May 25, 2019
@qgib qgib added this to the Version 2.18 milestone May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority Projections/Transformations Related to coordinate reference systems or coordinate transformation
Projects
None yet
Development

No branches or pull requests

1 participant