Bug report #14752

GEOS exceptions crash QGIS on windows

Added by Anita Graser almost 8 years ago. Updated almost 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Labelling
Affected QGIS version:3.0.0 Regression?:Yes
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:22709

Description

The same project that works fine in qgis-dev and qgis-rel-dev (tested on Windows) crashes qgis 2.14.2. The dump file is attached.

It also used to crash 2.14.1 while the then qgis-rel-dev version worked. Therefore, back then, I assumed the issue had been fixed ... but it seems to be much more mysterious.

crashproject.zip (4.03 MB) Anita Graser, 2016-05-01 07:31 AM

qgis-20160501-162647-4308-8588-f5763f0.zip (4.19 MB) Anita Graser, 2016-05-01 07:32 AM

bugminidump.zip (4.15 MB) Anita Graser, 2016-08-02 12:00 AM

geos_error.png (252 KB) Anita Graser, 2017-05-28 08:17 PM

qgis-20170528-201313-2640-11424-a916bf4.zip (3.25 MB) Anita Graser, 2017-05-28 08:21 PM


Related issues

Related to QGIS Application - Bug report #18235: QGIS 3.00 standalone 64 bit installer running on win 10 p... Closed 2018-02-26

Associated revisions

Revision e05a5a93
Added by Nyall Dawson about 6 years ago

[pal] Use QgsGeometry::makeValid instead of buffer(0) to repair geometries

Possibly refs #14752

Revision 23457336
Added by Nyall Dawson about 6 years ago

[pal] Use QgsGeometry::makeValid instead of buffer(0) to repair geometries

Possibly refs #14752

(cherry-picked from e05a5a9)

Revision ad1fef9f
Added by Nyall Dawson almost 6 years ago

Workaround crash in msvc when raising a GEOS exception

In some circumstances MSVC tries to raise it's own internal
exception when we try to raise a GEOSException. This results
in a hard crash of QGIS.

To workaround this, we cautiously try to raise a GEOSException
on msvc builds, catching all other raised exceptions if
throwing the GEOSException triggers them. This at least allows
us to gracefully handle the geos error without crashing QGIS
(although the detailed GEOS error message is not available
when this situation occurs... but that's still better than
a crash!).

If you want to try to find a better fix for this, the
testqgsexpression.cpp test suite will demonstrate the issue.

Without this fix the test will crash on the "line_interpolate_point point"
test.

Refs #14752

History

#2 Updated by Nyall Dawson almost 8 years ago

I can't reproduce (using Linux)

#3 Updated by Anita Graser almost 8 years ago

Another user reported the issue to me, so it's not a local issue on my machine. Maybe Win-specific.

#4 Updated by Giovanni Manghi almost 8 years ago

  • Category set to Project Loading/Saving

This is what I see on Windows:

  • seems ok up to 2.12 (tested 2.8, 2.10 and 2.12)
  • 2.14.3, project opens, no crash, empty canvas
  • master, project opens, no crash, map cannot be zoomed or panned.

#5 Updated by Giovanni Manghi almost 8 years ago

  • master, project opens, no crash, map cannot be zoomed or panned.

weird, tested again and is ok on master (still not ok on 2.14.3, but no crash also).

#6 Updated by Giovanni Manghi almost 8 years ago

  • Status changed from Open to Feedback

#7 Updated by Anita Graser almost 8 years ago

  • Status changed from Feedback to Closed

The crash seems gone in 2.14.3 (OSGeo4W version). The project even shows up correctly on canvas (not empty as Giovanni mentioned).

In master, the canvas appeared empty when I first tried opening it. Used "zoom to extent" and it displayed fine. When I closed and reopenend again, everything looked ok from the beginning.

Bit strange ... Will reopen if crashes reoccur.

#8 Updated by Anita Graser over 7 years ago

The issue seems to have resurfaced in 2.16.1-2, causing crashes and the attached minidump (provided by K Trinko).

#9 Updated by Andreas Neumann over 7 years ago

I can confirm the crash on loading in 2.16.3 (build #7d00cae). But the project opens fine in QGIS 2.x master (2.17, build #6e4dbc0)

However, even with 2.17, if one zooms in, rendering can be very slow. Maybe an issue with the glow/shade effects when zooming in? But that is a different issue ... Also there seem to be projection/clipping issues when zooming around ? Definitely something weird in this project.

I tested on Win 7 with the Win64 builds.

#10 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to Yes

#11 Updated by Giovanni Manghi almost 7 years ago

  • Priority changed from Severe/Regression to High

#12 Updated by Giovanni Manghi almost 7 years ago

  • Easy fix? set to No

#13 Updated by Anita Graser almost 7 years ago

  • Description updated (diff)

Update: OSGeo4W's 2.14.15 still crashes, OSGeo4W's 2.18.9 works for me but others still report issues with the stand-alone installers.

#14 Updated by Anita Graser almost 7 years ago

  • File Screenshot 2017-05-28 21.13.34.png added

I've narrowed it down to the point city layer. When 2.14 tries to render that layer, it crashes.

There is a GEOS Exception: IllegalArgumentException: RobustDeterminant encountered non-finite numbers.

#15 Updated by Anita Graser almost 7 years ago

  • File deleted (Screenshot 2017-05-28 21.13.34.png)

#16 Updated by Anita Graser almost 7 years ago

#18 Updated by Anita Graser almost 7 years ago

  • Affected QGIS version changed from 2.14.2 to 2.14.15

I've further narrowed it down to activating "Discourage labels from covering features" for the city labels. If this is deactivated, the crashing stops.

#19 Updated by Giovanni Manghi almost 7 years ago

Anita Graser wrote:

I've further narrowed it down to activating "Discourage labels from covering features" for the city labels. If this is deactivated, the crashing stops.

Anita for sake of clarity would you agree if I then create a new issue ticket with just this fundamental piece of information (and the necessary dataset)?

#20 Updated by Giovanni Manghi almost 7 years ago

Anita Graser wrote:

I've further narrowed it down to activating "Discourage labels from covering features" for the city labels. If this is deactivated, the crashing stops.

Hi Anita,
made some test of my own.

2.14.15 crashes on project load, as well as 2.18.9.

2.18.9 nightly does not crash on project load.

BUT

I tried load the point layer in 2.18.9 nightly in a blank project, enable labels without the "Discourage labels from covering features" option and if you zoom in/out quickly with the mouse wheel is easy enough to make it crashes too...

all from osgeo4w.

#21 Updated by Anita Graser almost 7 years ago

Giovanni Manghi wrote:

Anita for sake of clarity would you agree if I then create a new issue ticket with just this fundamental piece of information (and the necessary dataset)?

Sure, please do.

#22 Updated by Giovanni Manghi almost 7 years ago

Anita Graser wrote:

Giovanni Manghi wrote:

Anita for sake of clarity would you agree if I then create a new issue ticket with just this fundamental piece of information (and the necessary dataset)?

Sure, please do.

this was before "I tried load the point layer in 2.18.9 nightly in a blank project, enable labels without the "Discourage labels from covering features" option and if you zoom in/out quickly with the mouse wheel is easy enough to make it crashes too..." :)

if the source of the problem was 100% that option would had made sense to create a new simpler and clearer ticket, as it does not seems the case I think that is better to keep the ticket as it is.

#23 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Reopened to Feedback

Tried again on master... and here with MT enabled it seems to not crash... what about others?

#24 Updated by Anita Graser over 6 years ago

  • Affected QGIS version changed from 2.14.15 to 2.18.13

2.14.19 and 2.18.13 crash for me.

2.99 does not crash, but the project CRS and some layer CRS are not restored correctly :(

Seems like I don't have any version that opens the project correctly anymore.

#25 Updated by Giovanni Manghi over 6 years ago

2.99 does not crash, but the project CRS and some layer CRS are not restored correctly :(

but this could be another issue. I set manually the project CRS to 3857 and it works/shows fine for me, what about there?

#26 Updated by Anita Graser over 6 years ago

Yes, I can set the correct CRS manually, and so far 2.99 doesn't seem to crash ... but we've observed this behavior with previous master versions as well.

#27 Updated by Anita Graser over 6 years ago

  • Status changed from Feedback to Open
  • Subject changed from Opening project crashes 2.14.2 but works in qgis-rel-dev to "Discourage labels from covering features" causes crashes
  • Category changed from Project Loading/Saving to Labelling

#28 Updated by Anita Graser about 6 years ago

  • Affected QGIS version changed from 2.18.13 to 3.0.0

#29 Updated by Anita Graser about 6 years ago

  • Related to Bug report #18235: QGIS 3.00 standalone 64 bit installer running on win 10 pro 64 bit crashes when opening global-connections project from the book Qgis map design by grasser& petersen added

#30 Updated by Nyall Dawson about 6 years ago

  • Subject changed from "Discourage labels from covering features" causes crashes to GEOS exceptions crash QGIS on windows

#31 Updated by Nyall Dawson almost 6 years ago

  • Status changed from Open to Feedback

Please test latest 3.2 master

#32 Updated by Anita Graser almost 6 years ago

Master currently doesn't crash but - considering the history of this bug - I'll only believe that it's gone when the 3.2 release opens the project without issues.

#33 Updated by Anita Graser almost 6 years ago

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

Looks like the 3.2 release is ok and does not crash. Thanks!

Also available in: Atom PDF