Bug report #13674

Crash when deleting features with node tool (2.12)

Added by Ivan Katanović over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Digitising
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:21707

Description

Qgis crashes whn you try to delete feature with node tool.

Steps to reproduce:
1.Start editing layer
2.Choose Node Tool and start deleting nodes from feature
3.When you try to delete last node of feature, Qgis crashes

As I recall the same thing was happening in 2.10.

Below is the Backtrace:

Program received signal SIGFPE, Arithmetic exception.
0x00007ffff7801e32 in QgsMapToolNodeTool::safeSelectVertex (this=this@entry=0xdd3160, vertexNr=vertexNr@entry=0) at /tmp/buildd/qgis-2.12.0+23wily/src/app/nodetool/qgsmaptoolnodetool.cpp:591
591     /tmp/buildd/qgis-2.12.0+23wily/src/app/nodetool/qgsmaptoolnodetool.cpp: No such file or directory.
(gdb) bt
#0  0x00007ffff7801e32 in QgsMapToolNodeTool::safeSelectVertex (this=this@entry=0xdd3160, vertexNr=vertexNr@entry=0) at /tmp/buildd/qgis-2.12.0+23wily/src/app/nodetool/qgsmaptoolnodetool.cpp:591
#1  0x00007ffff7802e95 in QgsMapToolNodeTool::keyPressEvent (this=0xdd3160, e=0x7fffffffcb20) at /tmp/buildd/qgis-2.12.0+23wily/src/app/nodetool/qgsmaptoolnodetool.cpp:542
#2  0x00007ffff70ebd2c in QgsMapCanvas::keyPressEvent (this=0xb8eea0, e=0x7fffffffcb20) at /tmp/buildd/qgis-2.12.0+23wily/src/gui/qgsmapcanvas.cpp:1198
#3  0x00007ffff52af8c3 in QWidget::event (this=this@entry=0xb8eea0, event=event@entry=0x7fffffffcb20) at kernel/qwidget.cpp:8435
#4  0x00007ffff567870e in QFrame::event (this=this@entry=0xb8eea0, e=e@entry=0x7fffffffcb20) at widgets/qframe.cpp:557
#5  0x00007ffff56fdf4b in QAbstractScrollArea::event (this=0xb8eea0, e=0x7fffffffcb20) at widgets/qabstractscrollarea.cpp:996
#6  0x00007ffff525acdc in QApplicationPrivate::notify_helper (this=this@entry=0x8765b0, receiver=receiver@entry=0xb8eea0, e=e@entry=0x7fffffffcb20) at kernel/qapplication.cpp:4570
#7  0x00007ffff5262f63 in QApplication::notify (this=this@entry=0x7fffffffda50, receiver=receiver@entry=0xb8eea0, e=e@entry=0x7fffffffcb20) at kernel/qapplication.cpp:4011
#8  0x00007ffff65321bb in QgsApplication::notify (this=0x7fffffffda50, receiver=0xb8eea0, event=0x7fffffffcb20) at /tmp/buildd/qgis-2.12.0+23wily/src/core/qgsapplication.cpp:269
#9  0x00007ffff5f1185d in QCoreApplication::notifyInternal (this=0x7fffffffda50, receiver=receiver@entry=0xb8eea0, event=event@entry=0x7fffffffcb20) at kernel/qcoreapplication.cpp:955
#10 0x00007ffff5259146 in QCoreApplication::sendSpontaneousEvent (event=event@entry=0x7fffffffcb20, receiver=receiver@entry=0xb8eea0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#11 qt_sendSpontaneousEvent (receiver=receiver@entry=0xb8eea0, event=event@entry=0x7fffffffcb20) at kernel/qapplication.cpp:5568
#12 0x00007ffff5302cc3 in QKeyMapper::sendKeyEvent (keyWidget=keyWidget@entry=0xb8eea0, grab=grab@entry=false, type=QEvent::KeyPress, code=16777223, modifiers=..., text=..., autorepeat=false, count=1, nativeScanCode=119, 
    nativeVirtualKey=65535, nativeModifiers=16) at kernel/qkeymapper_x11.cpp:1866
#13 0x00007ffff53031d2 in QKeyMapperPrivate::translateKeyEvent (this=0x7fffffffd090, keyWidget=0xb8eea0, event=0x0, grab=<optimized out>) at kernel/qkeymapper_x11.cpp:1836
#14 0x00007ffff52db2c1 in QApplication::x11ProcessEvent (this=0x7fffffffda50, event=event@entry=0x7fffffffd090) at kernel/qapplication_x11.cpp:3641
#15 0x00007ffff5305b52 in x11EventSourceDispatch (s=0x877d00, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#16 0x00007fffedc5fff7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007fffedc60250 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007fffedc602fc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007ffff5f421ee in QEventDispatcherGlib::processEvents (this=0x8687d0, flags=...) at kernel/qeventdispatcher_glib.cpp:450
#20 0x00007ffff5305c26 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#21 0x00007ffff5f100d1 in QEventLoop::processEvents (this=this@entry=0x7fffffffd470, flags=...) at kernel/qeventloop.cpp:149
#22 0x00007ffff5f10445 in QEventLoop::exec (this=this@entry=0x7fffffffd470, flags=...) at kernel/qeventloop.cpp:204
#23 0x00007ffff5f16429 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1227
#24 0x00007ffff5258f2c in QApplication::exec () at kernel/qapplication.cpp:3828
#25 0x00000000004069cd in main (argc=1, argv=<optimized out>) at /tmp/buildd/qgis-2.12.0+23wily/src/app/main.cpp:1229


Related issues

Related to QGIS Application - Bug report #13661: Node tool should not allow to delete nodes and leave just... Closed 2015-10-23

Associated revisions

Revision ba1de8b5
Added by Nyall Dawson over 8 years ago

Fix crash when deleting last node in a geometry (fix #13674)

Revision 1449078c
Added by Nyall Dawson over 8 years ago

Fix crash when deleting last node in a geometry (fix #13674)

(cherry-picked from ba1de8b5aa82f26c9127d12897ce42f49a265cb2)

History

#1 Updated by Saber Razmjooei over 8 years ago

  • Affected QGIS version changed from 2.10.1 to master
  • Operating System deleted (linux)
  • Priority changed from High to Severe/Regression

Confirmed in master.
Another ticket was also mentioning that user is able to delete all the nodes for the polygon. The delete node should warn user to use Delete feature when nodes are 3 in polygon and 2 in line layers.

#2 Updated by Nyall Dawson over 8 years ago

That's not correct - the node tool has been designed to allow temporary creation of invalid geometries (was broken in 2.10 though).

What I think should happen is that removing the last node results in a null geoemtry for the feature. So the feature remains, but with no geom.

#3 Updated by Saber Razmjooei over 8 years ago

  • Category set to Digitising

Makes sense to have geometry-less feature. Maybe a warning to tell user about this when pressing save will be a good option.

#4 Updated by Nyall Dawson over 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF