FreeCAD 0.16.5565 (Git)で誤った選択の角度拘束を試みるとSIGSEGV
FreeCAD 0.16.5565 (Git)のスケッチャーワークベンチにおいて、線分の寸法拘束と線分を選択した状態で、角度拘束を試みるとSIGSEGVとなる。
確認方法
- FreeCADを起動する。
- 新規作成をクリックする。
- スケッチャーワークベンチをロードする。
- 新規スケッチを作成する。
- 線分を数本描く。
- 線分の端点にベースラインからの垂直拘束をする。
- ベースラインからの垂直拘束を1つと、線分を1つ選択した状態にする。
- 角度拘束を行う。
- SIGSEGVが発生して終了する。
GDBの出力
Program received signal SIGSEGV, Segmentation fault. 0x00007fff7211ea2a in CmdSketcherConstrainAngle::activated (this=0x2670ec0, iMsg=0) at /home/maho-maho/FreeCAD/FreeCAD/src/Mod/Sketcher/Gui/CommandConstraints.cpp:2620 2620 if (geom1->getTypeId() == Part::GeomLineSegment::getClassTypeId() && (gdb) l 2615 2616 if (isEdge(GeoId2,PosId2)) { // line to line angle 2617 2618 const Part::Geometry *geom1 = Obj->getGeometry(GeoId1); 2619 const Part::Geometry *geom2 = Obj->getGeometry(GeoId2); 2620 if (geom1->getTypeId() == Part::GeomLineSegment::getClassTypeId() && 2621 geom2->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { 2622 const Part::GeomLineSegment *lineSeg1 = dynamic_cast<const Part::GeomLineSegment*>(geom1); 2623 const Part::GeomLineSegment *lineSeg2 = dynamic_cast<const Part::GeomLineSegment*>(geom2); 2624 info args this = 0x2670ec0 iMsg = 0 #0 0x00007fff7211ea2a in CmdSketcherConstrainAngle::activated(int) (this=0x2670ec0, iMsg=0) at /home/maho-maho/FreeCAD/FreeCAD/src/Mod/Sketcher/Gui/CommandConstraints.cpp:2620 #1 0x00007ffff7369253 in Gui::Command::invoke(int) (this=0x2670ec0, i=0) at /home/maho-maho/FreeCAD/FreeCAD/src/Gui/Command.cpp:289 #2 0x00007ffff735cb93 in Gui::Action::onActivated() (this=0x283faf0) at /home/maho-maho/FreeCAD/FreeCAD/src/Gui/Action.cpp:93 #3 0x00007ffff736242b in Gui::Action::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x283faf0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fffffffc130) at /home/maho-maho/FreeCAD/FreeCAD/build/src/Gui/moc_Action.cpp:49 #4 0x00007ffff4def1ec in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x28a4e00, m=m@entry=0x7ffff5e01540 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffc130) at kernel/qobject.cpp:3567 #5 0x00007ffff5305fd2 in QAction::triggered(bool) (this=this@entry=0x28a4e00, _t1=false) at .moc/release-shared/moc_qaction.cpp:276 #6 0x00007ffff5307b57 in QAction::activate(QAction::ActionEvent) (this=0x28a4e00, event=<optimized out>) at kernel/qaction.cpp:1257 #7 0x00007ffff56e38e3 in QAbstractButtonPrivate::click() (this=this@entry=0x28bbf00) at widgets/qabstractbutton.cpp:530 #8 0x00007ffff56e3a34 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) (this=0x28bc1c0, e=0x7fffffffc860) at widgets/qabstractbutton.cpp:1123 #9 0x00007ffff57a5b1a in QToolButton::mouseReleaseEvent(QMouseEvent*) (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:723 #10 0x00007ffff535fdc8 in QWidget::event(QEvent*) (this=0x28bc1c0, event=0x7fffffffc860) at kernel/qwidget.cpp:8775 #11 0x00007ffff530c9bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x7521d0, receiver=receiver@entry=0x28bc1c0, e=e@entry=0x7fffffffc860) at kernel/qapplication.cpp:4570 #12 0x00007ffff531363f in QApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0x28bc1c0, e=0x7fffffffc860) at kernel/qapplication.cpp:4113 #13 0x00007ffff72d710c in Gui::GUIApplication::notify(QObject*, QEvent*) (this= 0x7fffffffd440, receiver=0x28bc1c0, event=0x7fffffffc860) at /home/maho-maho/FreeCAD/FreeCAD/src/Gui/Application.cpp:1552 #14 0x00007ffff4dda1cd in QCoreApplication::notifyInternal(QObject*, QEvent*) (this=0x7fffffffd440, receiver=receiver@entry=0x28bc1c0, event=event@entry=0x7fffffffc860) at kernel/qcoreapplication.cpp:955 #15 0x00007ffff5312c9f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231 #16 0x00007ffff5312c9f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) (receiver=receiver@entry=0x28bc1c0, event=event@entry=0x7fffffffc860, alienWidget=alienWidget@entry=0x28bc1c0, nativeWidget=nativeWidget@entry=0x27ea470, buttonDown=buttonDown@entry=0x7ffff5e3a578 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3178 #17 0x00007ffff538c9a2 in QETWidget::translateMouseEvent(_XEvent const*) (this=this@entry=0x27ea470, event=event@entry=0x7fffffffcbc0) at kernel/qapplication_x11.cpp:4632 #18 0x00007ffff538c24c in QApplication::x11ProcessEvent(_XEvent*) (this=0x7fffffffd440, event=event@entry=0x7fffffffcbc0) at kernel/qapplication_x11.cpp:3626 #19 0x00007ffff53b4ba2 in x11EventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x76f720, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146 #20 0x00007fffeddf0c3d in g_main_context_dispatch (context=0x76e3a0) at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:3122 #21 0x00007fffeddf0c3d in g_main_context_dispatch (context=context@entry=0x76e3a0) at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:3737 #22 0x00007fffeddf0f20 in g_main_context_iterate (context=context@entry=0x76e3a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:3808 #23 0x00007fffeddf0fcc in g_main_context_iteration (context=0x76e3a0, may_block=1) at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:3869 #24 0x00007ffff4e0985e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x752840, flags=...) at kernel/qeventdispatcher_glib.cpp:450 #25 0x00007ffff53b4c66 in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204 #26 0x00007ffff4dd8d21 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffcfa0, flags=...) at kernel/qeventloop.cpp:149 #27 0x00007ffff4dd9085 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffcfa0, flags=...) at kernel/qeventloop.cpp:204 #28 0x00007ffff4ddeb09 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1227 #29 0x00007ffff72d1b5a in Gui::Application::runApplication() () at /home/maho-maho/FreeCAD/FreeCAD/src/Gui/Application.cpp:1852 #30 0x00000000004059fc in main(int, char**) (argc=1, argv=0x7fffffffddf8) at /home/maho-maho/FreeCAD/FreeCAD/src/Main/MainGui.cpp:235
望ましい挙動
これはユーザ誤操作である。ゆえに本来ありえない操作なので、適切な例外処理にてエラーメッセージを表示させることが望ましい。
環境
OS: Ubuntu 15.04 Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.16.5565 (Git) Build type: Debug Branch: master Hash: bd1fc886fe71fae148d955108feac804324e002b Python version: 2.7.9 Qt version: 4.8.6 Coin version: 4.0.0a OCC version: 6.8.0.oce-0.17