Bug report #1424

split feature segfault

Added by Martin Dobias almost 12 years ago. Updated about 11 years ago.

Status:Closed
Priority:Low
Assignee:Marco Hugentobler
Category:Digitising
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11484

Description

When working with shapefiles, one can consistently crash QGIS when trying to split a polygon.

It seems that with PostGIS layer it doesn't crash.

I'm attaching a very simple shapefile with only one polygon where this can be reproduced. Open it, draw a line that intersects the polygon, on right click it will crash.

Using SVN trunk 9690, debug version, running on ubuntu.

hranice_praha.zip (2.9 KB) Martin Dobias, 2008-11-24 08:56 AM

History

#1 Updated by Marco Hugentobler almost 12 years ago

Hi Martin

The example shapefile does not lead to a crash on my system. Which version of geos are you using? I'm using 3.0.0 (also on ubuntu).

Marco

#2 Updated by Martin Dobias almost 12 years ago

I'm still using geos 2.2.3 from ubuntu.

#3 Updated by Maciej Sieczka - almost 12 years ago

Replying to [comment:1 mhugent]:

Hi Martin

The example shapefile does not lead to a crash on my system.

Neither on my - Debian testing amd64, GEOS 3.0.0.

Not sure if that's relevant, but what are your snapping options? Do you rely on snapping settings from the general 'Options' menu or do you set them for that given layer in project properties? If the latter, do you also set 'Topological editing' and 'Avoid intersections'?

Can you post a backtrace?

#4 Updated by Martin Dobias almost 12 years ago

Replying to [comment:3 msieczka]:

Not sure if that's relevant, but what are your snapping options? Do you rely on snapping settings from the general 'Options' menu or do you set them for that given layer in project properties? If the latter, do you also set 'Topological editing' and 'Avoid intersections'?

I use general snapping options, no topological editing, neither avoid intersections. But shouldn't really matter, the crash is somewhere deep inside splitting routines.

Can you post a backtrace?

#0  0x0831c349 in vtable for +cxxabiv1::+si_class_type_info ()
#3905  0x08be8f20 in ?? ()
#3906  0xb73bdf63 in [[QgsGeometry]]::splitPolygonGeometry (this=0x83724e0, splitLine=0x8369698, [email protected]) at /home/wonder/qgis/svn/src/core/qgsgeometry.cpp:4909
#3907  0xb73be95f in [[QgsGeometry]]::splitGeometry (this=0x83724e0, [email protected], [email protected], topological=false, [email protected])
    at /home/wonder/qgis/svn/src/core/qgsgeometry.cpp:3187
#3908  0xb742448c in [[QgsVectorLayer]]::splitFeatures (this=0xb1328fd0, [email protected], topologicalEditing=false) at /home/wonder/qgis/svn/src/core/qgsvectorlayer.cpp:1721
#3909  0x08184f22 in [[QgsMapToolSplitFeatures]]::canvasReleaseEvent (this=0x85c81e0, e=0xbf95b4d8) at /home/wonder/qgis/svn/src/app/qgsmaptoolsplitfeatures.cpp:82
#3910  0xb72a50b3 in [[QgsMapCanvas]]::mouseReleaseEvent (this=0x85118b0, e=0xbf95b4d8) at /home/wonder/qgis/svn/src/gui/qgsmapcanvas.cpp:774

#5 Updated by Marco Hugentobler almost 12 years ago

Ok, I compiled geos 2.2.3 and I also have the crash.
The geos documentation also gives the reason (see below). I'm going to look for a workaround for geos2 (or an ifdef).

/* May be called on all geometries in GEOS 3.x, returns -1 on error and 1
00374 * for non-multi geometries. Older GEOS versions only accept
00375 * GeometryCollections or Multi* geometries here, and are likely to crash
00376 * when feeded simple geometries, so beware if you need compatibility with
00377 * old GEOS versions.
00378 /
00379 extern int GEOS_DLL GEOSGetNumGeometries(const GEOSGeometry
g1);

#6 Updated by Marco Hugentobler almost 12 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

Fixed in 52c76d58 (SVN r9713)

#7 Updated by Jürgen Fischer almost 12 years ago

Replying to [comment:6 mhugent]:

Fixed in 52c76d58 (SVN r9713)

But GEOSGetGeometryN() is fine with simple geometries?

#8 Updated by Anonymous about 11 years ago

Milestone Version 1.0.0 deleted

Also available in: Atom PDF