[QGIS-Developer] Calling for assistance - Windows MVSC builds not catching GEOS exceptions?

Nyall Dawson nyall.dawson at gmail.com
Fri Mar 2 01:33:39 PST 2018


Hi all,

While investigating Anita's "most annoying issue",
https://issues.qgis.org/issues/14752 I've tracked this down to certain
calls to geos functions crashing on Windows builds alone.

The situation is that the geos exception handler, throwGEOSException
is correctly called, which triggers a  "throw GEOSException" call. The
exception *should* be caught... indeed it's wrapped in suitable
try/catch blocks, and it works correctly on all other platforms. But
not on the msvc  Windows builds.

For some reason the msvc builds just ignore the catch and crash with
an unhandled exception. It's very odd, and I can't work out why it
works correctly for some GEOSExceptions yet not others. My searching
hasn't turned up any tricky issues with msvc exception handling
either...

It's reproducable using the qgis_expressiontest unit test -- when
running on Windows this will crash with a call to
QgsGeos::lineLocatePoint, where an exception thrown within
GEOSProject_r is not correctly caught.

Long story short - I'm out of ideas here, yet it's quite a serious
issue which has plagued QGIS since at least 2.14.

Do we have any msvc gurus with any idea what could be the cause of this?

Nyall


















[1]


More information about the QGIS-Developer mailing list