[QGIS-trac] [Quantum GIS] #3439: QGIS crashes when reshaping invalid polygon geometry

Quantum GIS qgis at qgis.org
Tue Jan 25 09:16:45 EST 2011


#3439: QGIS crashes when reshaping invalid polygon geometry
---------------------------------------------------------+------------------
   Reporter:  marisn                                     |              Owner:  jef          
       Type:  bug                                        |             Status:  new          
   Priority:  critical: causes crash or data corruption  |          Milestone:  Version 1.7.0
  Component:  Vectors                                    |            Version:  Trunk        
   Keywords:                                             |   Platform_version:               
   Platform:  Gentoo                                     |           Must_fix:  No           
Status_info:  0                                          |  
---------------------------------------------------------+------------------
 GEOS 3.2.2 QGIS r15075

 Steps to reproduce:
  * draw self intersecting polygon;
  * use reshape too to reshape it:
 {{{
 Debug: /home/maris/soft/qgis_trunk/src/providers/ogr/qgsogrprovider.cpp:
 591: (select) Setting spatial filter using POLYGON((556162.68083173
 6356447.94617169, 556162.68083173 6357221.35032134, 557111.30935904
 6357221.35032134, 557111.30935904 6356447.94617169, 556162.68083173
 6356447.94617169))
 ERROR 1: TopologyException: found non-noded intersection between
 LINESTRING (556163 6.35744e+06, 555613 6.35629e+06) and LINESTRING (556271
 6.35654e+06, 555299 6.35676e+06) at 555784 6.35665e+06

 Program received signal SIGSEGV, Segmentation fault.
 GEOSGeomTypeId_r (extHandle=0xb21c30, g1=0x0) at geos_ts_c.cpp:1296
 1296    geos_ts_c.cpp: No such file or directory.
         in geos_ts_c.cpp
 (gdb) bt
 #0  GEOSGeomTypeId_r (extHandle=0xb21c30, g1=0x0) at geos_ts_c.cpp:1296
 #1  0x00007ffff716fff5 in QgsGeometry::reshapeLine (line=0x25af600,
 reshapeLineGeos=0x2505cb0)
     at /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp:5179
 #2  0x00007ffff717086e in QgsGeometry::reshapePolygon (polygon=0x25b6d10,
 reshapeLineGeos=0x2505cb0)
     at /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp:5087
 #3  0x00007ffff7170c2d in QgsGeometry::reshapeGeometry (this=0xcd31d0,
 reshapeWithLine=...)
     at /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp:3280
 #4  0x00000000005a514e in QgsMapToolReshape::canvasReleaseEvent
 (this=0xfbc990, e=<value optimized out>)
     at /home/maris/soft/qgis_trunk/src/app/qgsmaptoolreshape.cpp:104
 #5  0x00007ffff6d28cc8 in QgsMapCanvas::mouseReleaseEvent (this=0xc4f300,
 e=<value optimized out>)
     at /home/maris/soft/qgis_trunk/src/gui/qgsmapcanvas.cpp:921
 #6  0x00007ffff55f0cbd in QWidget::event (this=0xc4f300,
 event=0x7fffffffc510) at kernel/qwidget.cpp:8200
 #7  0x00007ffff59c4db4 in QFrame::event (this=0xc4f300, e=0x7fffffffc510)
 at widgets/qframe.cpp:557
 #8  0x00007ffff5c397d1 in QGraphicsView::viewportEvent (this=0xc4f300,
 event=0x7fffffffc510)
     at graphicsview/qgraphicsview.cpp:2864
 #9  0x00007ffff624c2e9 in
 QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<value
 optimized out>,
     receiver=0xc45930, event=0x7fffffffc510) at
 kernel/qcoreapplication.cpp:847
 #10 0x00007ffff5592b0c in QApplicationPrivate::notify_helper
 (this=0xb58b10, receiver=0xc45930,
     e=0x7fffffffc510) at kernel/qapplication.cpp:4441
 #11 0x00007ffff55987eb in QApplication::notify (this=0x7fffffffd360,
 receiver=0xc45930, e=0x7fffffffc510)
     at kernel/qapplication.cpp:4006
 #12 0x00007ffff714bae6 in QgsApplication::notify (this=<value optimized
 out>, receiver=<value optimized out>,
     event=<value optimized out>) at
 /home/maris/soft/qgis_trunk/src/core/qgsapplication.cpp:88
 #13 0x00007ffff624c94e in QCoreApplication::notifyInternal
 (this=0x7fffffffd360, receiver=0xc45930,
     event=0x7fffffffc510) at kernel/qcoreapplication.cpp:732
 #14 0x00007ffff5596c9c in sendEvent (receiver=0xc45930,
 event=0x7fffffffc510, alienWidget=0xc45930,
     nativeWidget=0xd279f0, buttonDown=<value optimized out>,
 lastMouseReceiver=<value optimized out>,
     spontaneous=true) at
 ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
 #15 QApplicationPrivate::sendMouseEvent (receiver=0xc45930,
 event=0x7fffffffc510, alienWidget=0xc45930,
 }}}

 Depending on self intersecting polygon shape, it migh also show "unknown
 exception" error. After that, it's impossible to stop reshape tool - ESC
 doesn't work, right click just gives exception warning. Only way out is to
 BACKSPACE all nodes till reshaping line contains no more nodes.

 {{{
 Debug: /home/maris/soft/qgis_trunk/src/providers/ogr/qgsogrprovider.cpp:
 591: (select) Setting spatial filter using POLYGON((555697.42989796
 6358290.82324704, 555697.42989796 6359396.54949225, 556446.66516793
 6359396.54949225, 556446.66516793 6358290.82324704, 555697.42989796
 6358290.82324704))
 Debug: /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp: 93:
 (throwGEOSException) GEOS exception encountered: TopologyException: found
 non-noded intersection between LINESTRING (556107 6.35923e+06, 555867
 6.35867e+06) and LINESTRING (556374 6.35902e+06, 556049 6.35918e+06) at
 556078 6.35916e+06
 Debug: /home/maris/soft/qgis_trunk/src/providers/ogr/qgsogrprovider.cpp:
 591: (select) Setting spatial filter using POLYGON((555697.42989796
 6358290.82324704, 555697.42989796 6359783.25156708, 556446.66516793
 6359783.25156708, 556446.66516793 6358290.82324704, 555697.42989796
 6358290.82324704))
 Debug: /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp: 93:
 (throwGEOSException) GEOS exception encountered: TopologyException: found
 non-noded intersection between LINESTRING (556107 6.35923e+06, 555867
 6.35867e+06) and LINESTRING (556374 6.35902e+06, 556049 6.35918e+06) at
 556078 6.35916e+06
 Debug: /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp: 6496:
 (validatePolyline) līnijas 0 segmenti 0 un 4 krustojas 556274.812174,
 6358657.66189
 Debug: /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp: 6496:
 (validatePolyline) līnijas 0 segmenti 2 un 4 krustojas 556072.148796,
 6359200.42703
 Debug: /home/maris/soft/qgis_trunk/src/providers/ogr/qgsogrprovider.cpp:
 591: (select) Setting spatial filter using POLYGON((555697.42989796
 6358290.82324704, 555697.42989796 6359783.25156708, 556446.66516793
 6359783.25156708, 556446.66516793 6358290.82324704, 555697.42989796
 6358290.82324704))
 Debug: /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp: 93:
 (throwGEOSException) GEOS exception encountered: TopologyException: found
 non-noded intersection between LINESTRING (556082 6.35917e+06, 555867
 6.35867e+06) and LINESTRING (556087 6.35916e+06, 556049 6.35918e+06) at
 556078 6.35916e+06
 }}}

 When reshaping self intersecting line, QGIS just fails silently (with
 debug in console). Same should happen on incorrect polygons.

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/3439>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list