Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1424 closed bug (fixed)

split feature segfault

Reported by: wonder Owned by: mhugent
Priority: critical: causes crash or data corruption Milestone:
Component: Digitising Version: Trunk
Keywords: split Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

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.

Attachments (1)

hranice_praha.zip (2.9 KB ) - added by wonder 15 years ago.

Download all attachments as: .zip

Change History (9)

by wonder, 15 years ago

Attachment: hranice_praha.zip added

comment:1 by mhugent, 15 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

comment:2 by wonder, 15 years ago

I'm still using geos 2.2.3 from ubuntu.

in reply to:  1 ; comment:3 by msieczka, 15 years ago

Replying to 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?

in reply to:  3 comment:4 by wonder, 15 years ago

Replying to 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 ()
#1  0x08be8f20 in ?? ()
#2  0xb73bdf63 in QgsGeometry::splitPolygonGeometry (this=0x83724e0, splitLine=0x8369698, newGeometries=@0xbf95aeb0) at /home/wonder/qgis/svn/src/core/qgsgeometry.cpp:4909
#3  0xb73be95f in QgsGeometry::splitGeometry (this=0x83724e0, splitLine=@0x85c820c, newGeometries=@0xbf95aeb0, topological=false, topologyTestPoints=@0xbf95aeac)
    at /home/wonder/qgis/svn/src/core/qgsgeometry.cpp:3187
#4  0xb742448c in QgsVectorLayer::splitFeatures (this=0xb1328fd0, splitLine=@0x85c820c, topologicalEditing=false) at /home/wonder/qgis/svn/src/core/qgsvectorlayer.cpp:1721
#5  0x08184f22 in QgsMapToolSplitFeatures::canvasReleaseEvent (this=0x85c81e0, e=0xbf95b4d8) at /home/wonder/qgis/svn/src/app/qgsmaptoolsplitfeatures.cpp:82
#6  0xb72a50b3 in QgsMapCanvas::mouseReleaseEvent (this=0x85118b0, e=0xbf95b4d8) at /home/wonder/qgis/svn/src/gui/qgsmapcanvas.cpp:774

comment:5 by mhugent, 15 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);

comment:6 by mhugent, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in r9712

in reply to:  6 comment:7 by jef, 15 years ago

Replying to mhugent:

Fixed in r9712

But GEOSGetGeometryN() is fine with simple geometries?

comment:8 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.