Bug report #3439

QGIS crashes when reshaping invalid polygon geometry

Added by marisn - almost 10 years ago. Updated over 9 years ago.

Status:Closed
Priority:Low
Assignee:Jürgen Fischer
Category:Vectors
Affected QGIS version: Regression?:No
Operating System:Gentoo Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:13499

Description

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
    #3905  0x00007ffff716fff5 in [[QgsGeometry]]::reshapeLine (line=0x25af600, reshapeLineGeos=0x2505cb0)
        at /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp:5179
    #3906  0x00007ffff717086e in [[QgsGeometry]]::reshapePolygon (polygon=0x25b6d10, reshapeLineGeos=0x2505cb0)
        at /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp:5087
    #3907  0x00007ffff7170c2d in [[QgsGeometry]]::reshapeGeometry (this=0xcd31d0, reshapeWithLine=...)
        at /home/maris/soft/qgis_trunk/src/core/qgsgeometry.cpp:3280
    #3908  0x00000000005a514e in [[QgsMapToolReshape]]::canvasReleaseEvent (this=0xfbc990, e=<value optimized out>)
        at /home/maris/soft/qgis_trunk/src/app/qgsmaptoolreshape.cpp:104
    #3909  0x00007ffff6d28cc8 in [[QgsMapCanvas]]::mouseReleaseEvent (this=0xc4f300, e=<value optimized out>)
        at /home/maris/soft/qgis_trunk/src/gui/qgsmapcanvas.cpp:921
    #3910  0x00007ffff55f0cbd in QWidget::event (this=0xc4f300, event=0x7fffffffc510) at kernel/qwidget.cpp:8200
    #3911  0x00007ffff59c4db4 in QFrame::event (this=0xc4f300, e=0x7fffffffc510) at widgets/qframe.cpp:557
    #3912  0x00007ffff5c397d1 in QGraphicsView::viewportEvent (this=0xc4f300, event=0x7fffffffc510)
        at graphicsview/qgraphicsview.cpp:2864
    #3913  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
    #3914 0x00007ffff55987eb in QApplication::notify (this=0x7fffffffd360, receiver=0xc45930, e=0x7fffffffc510)
        at kernel/qapplication.cpp:4006
    #3915 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
    #3916 0x00007ffff624c94e in QCoreApplication::notifyInternal (this=0x7fffffffd360, receiver=0xc45930, 
        event=0x7fffffffc510) at kernel/qcoreapplication.cpp:732
    #3917 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
    #3918 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.

Associated revisions

Revision e7958d72
Added by Jürgen Fischer over 9 years ago

fix #3439

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 8196c87d
Added by Jürgen Fischer over 9 years ago

fix #3439

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Jürgen Fischer over 9 years ago

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

fixed in 8196c87d (SVN r15729).

Also available in: Atom PDF