Crash when selecting all in combo view

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jnweiger
Posts: 3
Joined: Fri Sep 07, 2018 1:43 am

Crash when selecting all in combo view

Post by jnweiger »

With 0.19pre versions running on Ubuntu 18.04, CTRL-A to select all elements of the document tree produces a segfault.

sudo apt list freecad-daily
freecad-daily/bionic,bionic,now 0.19~pre2~201911101129~ubuntu18.04.1 all [installed]
freecad-daily
-> File -> New
-> Part Design WB -> Create new sketch.
-> Click open the Model view,
-> Click on the Body, Press CTRL->A

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f9587afbf20]
#1  0x7f958b1c3112 in Gui::TreeWidget::onItemSelectionChanged() from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x1a2
#2  0x7f9588708645 in QMetaObject::activate(QObject*, int, int, void**) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x865
#3  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x4170d0) [0x7f958971a0d0]
#4  0x7f9588708645 in QMetaObject::activate(QObject*, int, int, void**) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x865
#5  0x7f9588685627 in QItemSelectionModel::selectionChanged(QItemSelection const&, QItemSelection const&) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x37
#6  0x7f9588689ec0 in QItemSelectionModel::emitSelectionChanged(QItemSelection const&, QItemSelection const&) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x80
#7  0x7f958868d093 in QItemSelectionModel::select(QItemSelection const&, QFlags<QItemSelectionModel::SelectionFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x273
#8  0x7f958970efa1 in QTreeViewPrivate::select(QModelIndex const&, QModelIndex const&, QFlags<QItemSelectionModel::SelectionFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x6c1
#9  0x7f958970f855 in QTreeView::selectAll() from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0xf5
#10  0x7f95896a54dd in QAbstractItemView::keyPressEvent(QKeyEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x85d
#11  0x7f9589713eeb in QTreeView::keyPressEvent(QKeyEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x6b
#12  0x7f958b1c77b1 in Gui::TreeWidget::keyPressEvent(QKeyEvent*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x51
#13  0x7f9589496877 in QWidget::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0xa27
#14  0x7f95895374de in QFrame::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1e
#15  0x7f9589540623 in QAbstractScrollArea::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x383
#16  0x7f95896aa87b in QAbstractItemView::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0xbb
#17  0x7f958945783c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x9c
#18  0x7f9589460642 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x17e2
#19  0x7f958b05aaa8 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x88
#20  0x7f95886d99c8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x118
#21  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x1b07c5) [0x7f95894b37c5]
#22  0x7f958945783c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x9c
#23  0x7f958945f104 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x2a4
#24  0x7f958b05aaa8 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x88
#25  0x7f95886d99c8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x118
#26  0x7f9588c980f0 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x180
#27  0x7f9588c9d035 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x115
#28  0x7f9588c742eb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0xab
#29  /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5(+0x9f260) [0x7f9578de9260]
#30  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2e7) [0x7f9582df6417]
#31  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4c650) [0x7f9582df6650]
#32  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7f9582df66dc]
#33  0x7f958873297f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x5f
#34  0x7f95886d79fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x13a
#35  0x7f95886e0aa4 in QCoreApplication::exec() from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x94
#36  0x7f958afd13f2 in Gui::Application::runApplication() from /usr/lib/freecad-daily-python3/lib/libFreeCADGui.so+0x1542
#37  freecad-daily(main+0x702) [0x556c579576f2]
#38  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f9587adeb97]
#39  freecad-daily(_start+0x2a) [0x556c579583ea]
This does not happen in 0.18.04 -- there all elements of the document become selected, as expected.
aapo
Posts: 624
Joined: Mon Oct 29, 2018 6:41 pm

Re: Crash when selecting all in combo view

Post by aapo »

jnweiger wrote: Sun Nov 10, 2019 11:17 pm With 0.19pre versions running on Ubuntu 18.04, CTRL-A to select all elements of the document tree produces a segfault.
Confirmed. FreeCAD crashed every time I tried this.


OS: Debian GNU/Linux bullseye/sid (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18724 (Git)
Build type: Unknown
Branch: master
Hash: d2032da93d3ee81c46b4962765b1a78d1f07ce59
Python version: 3.7.5
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)


Code: Select all

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x3a100) [0x7ff5ae14f100]
#1  0x7ff5b1ca78d3 in QTreeWidgetItem::setSelected(bool) from /software/FreeCAD/freecad-build/lib/libFreeCADGui.so+0x15
#2  0x7ff5b1da79be in Gui::TreeWidget::onItemSelectionChanged() from /software/FreeCAD/freecad-build/lib/libFreeCADGui.so+0x208
#3  /software/FreeCAD/freecad-build/lib/libFreeCADGui.so(+0x10d2615) [0x7ff5b1db6615]
#4  0x7ff5ae76f3c8 in QMetaObject::activate(QObject*, int, int, void**) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x7b8
#5  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x440c62) [0x7ff5af41fc62]
#6  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x446659) [0x7ff5af425659]
#7  0x7ff5ae76f3c8 in QMetaObject::activate(QObject*, int, int, void**) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x7b8
#8  0x7ff5ae701350 in QItemSelectionModel::selectionChanged(QItemSelection const&, QItemSelection const&) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x40
#9  0x7ff5ae7065c4 in QItemSelectionModel::emitSelectionChanged(QItemSelection const&, QItemSelection const&) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x464
#10  0x7ff5ae709177 in QItemSelectionModel::select(QItemSelection const&, QFlags<QItemSelectionModel::SelectionFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x227
#11  0x7ff5af414a58 in QTreeViewPrivate::select(QModelIndex const&, QModelIndex const&, QFlags<QItemSelectionModel::SelectionFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x6a8
#12  0x7ff5af415521 in QTreeView::selectAll() from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x101
#13  0x7ff5af3a5e9d in QAbstractItemView::keyPressEvent(QKeyEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x85d
#14  0x7ff5af419ceb in QTreeView::keyPressEvent(QKeyEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x6b
#15  0x7ff5b1d9b8e0 in Gui::TreeWidget::keyPressEvent(QKeyEvent*) from /software/FreeCAD/freecad-build/lib/libFreeCADGui.so+0x1e2
#16  0x7ff5af182d92 in QWidget::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x852
#17  0x7ff5af22ea2e in QFrame::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1e
#18  0x7ff5af231601 in QAbstractScrollArea::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x251
#19  0x7ff5af3ac523 in QAbstractItemView::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x143
#20  0x7ff5b1d9b5af in Gui::TreeWidget::event(QEvent*) from /software/FreeCAD/freecad-build/lib/libFreeCADGui.so+0x23
#21  0x7ff5af140c32 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x82
#22  0x7ff5af14a8c6 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0xa66
#23  0x7ff5b1bca15f in Gui::GUIApplication::notify(QObject*, QEvent*) from /software/FreeCAD/freecad-build/lib/libFreeCADGui.so+0xff
#24  0x7ff5ae744a92 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x182
#25  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x1c1efe) [0x7ff5af1a0efe]
#26  0x7ff5af140c32 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x82
#27  0x7ff5af14a190 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x330
#28  0x7ff5b1bca15f in Gui::GUIApplication::notify(QObject*, QEvent*) from /software/FreeCAD/freecad-build/lib/libFreeCADGui.so+0xff
#29  0x7ff5ae744a92 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x182
#30  0x7ff5aeb1ef83 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x163
#31  0x7ff5aeb24271 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x231
#32  0x7ff5aeafeeeb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0xbb
#33  /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5(+0x71d0a) [0x7ff5a84edd0a]
#34  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x27d) [0x7ff5ac64fead]
#35  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x50130) [0x7ff5ac650130]
#36  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2f) [0x7ff5ac6501bf]
#37  0x7ff5ae79a7f1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x61
#38  0x7ff5ae74371b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x12b
#39  0x7ff5ae74b1c2 in QCoreApplication::exec() from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x92
#40  0x7ff5b1abb24b in Gui::Application::runApplication() from /software/FreeCAD/freecad-build/lib/libFreeCADGui.so+0x248d
#41  bin/FreeCAD(main+0xb1e) [0x56243e6da158]
#42  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7ff5ae13bbbb]
#43  bin/FreeCAD(_start+0x2a) [0x56243e6d94ca]
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Crash when selecting all in combo view

Post by vocx »

jnweiger wrote: Sun Nov 10, 2019 11:17 pm With 0.19pre versions running on Ubuntu 18.04, CTRL-A to select all elements of the document tree produces a segfault.
Confirmed. It's probably a task for realthunder.

Code: Select all

Thread 1 "FreeCAD" received signal SIGSEGV, Segmentation fault.
0x00007ffff6ce82c1 in QTreeWidgetItem::setSelected (this=0x4104000000, aselect=false)
    at /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtreewidget.h:395
395	{ if (view) view->setItemSelected(this, aselect); }
(gdb) bt
#0  0x00007ffff6ce82c1 in QTreeWidgetItem::setSelected(bool) (this=0x4104000000, aselect=false)
    at /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtreewidget.h:395
#1  0x00007ffff6e03804 in Gui::TreeWidget::onItemSelectionChanged() (this=0x5555559f2560)
    at /opt/freecad-source-vocx/src/Gui/Tree.cpp:2706
#2  0x00007ffff6e1335c in Gui::TreeWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x5555559f2560, _c=QMetaObject::InvokeMetaMethod, _id=17, _a=0x7fffffffba50) at /opt/freecad-build-vocx/src/Gui/moc_Tree.cpp:169
#3  0x00007ffff2c2c645 in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0x5555559f2560, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=9, argv=argv@entry=0x0) at kernel/qobject.cpp:3767
#4  0x00007ffff2c2cd17 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x5555559f2560, m=m@entry=0x7ffff40617c0 <QTreeWidget::staticMetaObject>, local_signal_index=local_signal_index@entry=9, argv=argv@entry=0x0)
    at kernel/qobject.cpp:3629
#5  0x00007ffff3c3aec3 in QTreeWidget::itemSelectionChanged() (this=this@entry=0x5555559f2560) at .moc/moc_qtreewidget.cpp:445
#6  0x00007ffff3c3e0d0 in QTreeWidgetPrivate::_q_selectionChanged(QItemSelection const&, QItemSelection const&) (this=<optimized out>, selected=..., deselected=...) at itemviews/qtreewidget.cpp:2333
#7  0x00007ffff2c2c645 in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0x55555639e2e0, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffbbf0) at kernel/qobject.cpp:3767
#8  0x00007ffff2c2cd17 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x55555639e2e0, m=m@entry=0x7ffff30b59e0 <QItemSelectionModel::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffbbf0)
    at kernel/qobject.cpp:3629
#9  0x00007ffff2ba9627 in QItemSelectionModel::selectionChanged(QItemSelection const&, QItemSelection const&) (this=this@entry=0x55555639e2e0, _t1=..., _t2=...) at .moc/moc_qitemselectionmodel.cpp:479
#10 0x00007ffff2bae4d5 in QItemSelectionModel::emitSelectionChanged(QItemSelection const&, QItemSelection const&) (this=this@entry=0x55555639e2e0, newSelection=..., oldSelection=...) at itemmodels/qitemselectionmodel.cpp:1902
---Type <return> to continue, or q <return> to quit---
#11 0x00007ffff2bb1093 in QItemSelectionModel::select(QItemSelection const&, QFlags<QItemSelectionModel::SelectionFlag>) (this=0x55555639e2e0, selection=..., command=...) at itemmodels/qitemselectionmodel.cpp:1336
#12 0x00007ffff3c32fa1 in QTreeViewPrivate::select(QModelIndex const&, QModelIndex const&, QFlags<QItemSelectionModel::SelectionFlag>) (this=this@entry=0x555556431030, topIndex=..., bottomIndex=..., command=..., command@entry=...) at itemviews/qtreeview.cpp:3880
#13 0x00007ffff3c33855 in QTreeView::selectAll() (this=<optimized out>) at itemviews/qtreeview.cpp:2678
#14 0x00007ffff3bc94dd in QAbstractItemView::keyPressEvent(QKeyEvent*) (this=this@entry=0x5555559f2560, event=event@entry=0x7fffffffcc70)
    at itemviews/qabstractitemview.cpp:2481
#15 0x00007ffff3c37eeb in QTreeView::keyPressEvent(QKeyEvent*) (this=0x5555559f2560, event=0x7fffffffcc70)
    at itemviews/qtreeview.cpp:2026
#16 0x00007ffff6df6eeb in Gui::TreeWidget::keyPressEvent(QKeyEvent*) (this=0x5555559f2560, event=0x7fffffffcc70)
    at /opt/freecad-source-vocx/src/Gui/Tree.cpp:1268
#17 0x00007ffff39ba877 in QWidget::event(QEvent*) (this=this@entry=0x5555559f2560, event=event@entry=0x7fffffffcc70)
    at kernel/qwidget.cpp:8933
#18 0x00007ffff3a5b4de in QFrame::event(QEvent*) (this=this@entry=0x5555559f2560, e=e@entry=0x7fffffffcc70) at widgets/qframe.cpp:550
#19 0x00007ffff3a64623 in QAbstractScrollArea::event(QEvent*) (this=this@entry=0x5555559f2560, e=e@entry=0x7fffffffcc70)
    at widgets/qabstractscrollarea.cpp:1168
#20 0x00007ffff3bce87b in QAbstractItemView::event(QEvent*) (this=0x5555559f2560, event=0x7fffffffcc70)
    at itemviews/qabstractitemview.cpp:1680
#21 0x00007ffff6df6bcb in Gui::TreeWidget::event(QEvent*) (this=0x5555559f2560, e=0x7fffffffcc70)
    at /opt/freecad-source-vocx/src/Gui/Tree.cpp:1218
#22 0x00007ffff397b83c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x5555559f2830, receiver=receiver@entry=0x5555559f2560, e=e@entry=0x7fffffffcc70) at kernel/qapplication.cpp:3722
#23 0x00007ffff3984642 in QApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=0x5555559f2560, e=0x7fffffffcc70)
---Type <return> to continue, or q <return> to quit---
    at kernel/qapplication.cpp:3116
#24 0x00007ffff6bf52fc in Gui::GUIApplication::notify(QObject*, QEvent*) (this=
    0x7fffffffd110, receiver=0x5555559f2560, event=0x7fffffffcc70) at /opt/freecad-source-vocx/src/Gui/GuiApplication.cpp:91
#25 0x00007ffff2bfd9c8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5555559f2560, event=0x7fffffffcc70)
    at kernel/qcoreapplication.cpp:1024
#26 0x00007ffff39d77c5 in QWidgetWindow::event(QEvent*) (this=0x5555571652e0, event=0x7fffffffcc70) at kernel/qwidgetwindow.cpp:243
#27 0x00007ffff397b83c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x5555559f2830, receiver=receiver@entry=0x5555571652e0, e=e@entry=0x7fffffffcc70) at kernel/qapplication.cpp:3722
#28 0x00007ffff3983104 in QApplication::notify(QObject*, QEvent*) (this=0x7fffffffd110, receiver=0x5555571652e0, e=0x7fffffffcc70)
    at kernel/qapplication.cpp:3481
#29 0x00007ffff6bf52fc in Gui::GUIApplication::notify(QObject*, QEvent*) (this=0x7fffffffd110, receiver=0x5555571652e0, event=0x7fffffffcc70) at /opt/freecad-source-vocx/src/Gui/GuiApplication.cpp:91
#30 0x00007ffff2bfd9c8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=receiver@entry=0x5555571652e0, event=event@entry=0x7fffffffcc70) at kernel/qcoreapplication.cpp:1024
#31 0x00007ffff31bc0f0 in QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) (event=0x7fffffffcc70, receiver=0x5555571652e0)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#32 0x00007ffff31bc0f0 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) (e=0x7fffd80078e0)
    at kernel/qguiapplication.cpp:2078
#33 0x00007ffff31c1035 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) (e=e@entry=0x7fffd80078e0) at kernel/qguiapplication.cpp:1739
#34 0x00007ffff31982eb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=...)
    at kernel/qwindowsysteminterface.cpp:946
#35 0x00007fffe31d4260 in userEventSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at qeventdispatcher_glib.cpp:77
#36 0x00007fffed546417 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007fffed546650 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007fffed5466dc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007ffff2c5697f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x555555b44520, flags=...)
    at kernel/qeventdispatcher_glib.cpp:423
#40 0x00007ffff2bfb9fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffcf80, flags=..., 
    flags@entry=...) at kernel/qeventloop.cpp:212
#41 0x00007ffff2c04aa4 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1297
#42 0x00007ffff6ac9b5a in Gui::Application::runApplication() () at /opt/freecad-source-vocx/src/Gui/Application.cpp:2137
#43 0x000055555555ca9d in main(int, char**) (argc=1, argv=0x7fffffffdb68) at /opt/freecad-source-vocx/src/Main/MainGui.cpp:299

Code: Select all

OS: Ubuntu 18.04.3 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18733 (Git)
Build type: Debug
Branch: master
Hash: 2637280c1d2cb48e7cd946fa9f2484467edd8b0c
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
realthunder wrote: ping
wmayer wrote: ping
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Crash when selecting all in combo view

Post by realthunder »

jnweiger wrote: Sun Nov 10, 2019 11:17 pm With 0.19pre versions running on Ubuntu 18.04, CTRL-A to select all elements of the document tree produces a segfault.
I have discovered this problem also, and is fixed in one of my branch. May I ask what the user expects when he perform a CTRL+A in the tree view? The default behavior is to select all tree items in all documents. That's hardly useful IMO. My patch now changes the behavior to select only the top level objects in the current active document. Would that be okay? The behavior is not necessary for fixing the crash. It's a usability improvement, or I wish.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Crash when selecting all in combo view

Post by vocx »

realthunder wrote: Fri Nov 15, 2019 10:27 pm ... May I ask what the user expects when he perform a CTRL+A in the tree view? The default behavior is to select all tree items in all documents. That's hardly useful IMO. My patch now changes the behavior to select only the top level objects in the current active document. ...
I think the default behavior of "selecting all" should be respected, as that is what most people expect. But when you say, only the "toplevel objects", do you mean selecting only, for example, the PartDesign Bodies, and not the underlying Sketch? Yes, I guess that is better.

What about when the objects are nested in many layers? For example, various Std Parts with various PartDesign Bodies. Only the Parts are selected, or the Bodies inside as well? What if the Std Part is inside a Std_Group? Should the Std_Group be selected, and not the Std_Part, nor the Bodies?

In general, in many applications there is a "select all" command as standard but people will rarely use it, unless it is to delete. A word processor allows selecting everything, but that is hardly useful unless the user just wants to delete everything, or do something weird like setting the entire font of the document in one go.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: Crash when selecting all in combo view

Post by chrisb »

It seems to be sensible to restrict the selection to the current document, but I find it cumbersome to select only the top level items. A use case for selecting all is in connection with deselecting certain items afterwards, when complete subtrees should be deleted. If only the top level items of Part workbench are selected, then only these are removed.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Crash when selecting all in combo view

Post by realthunder »

vocx wrote: Fri Nov 15, 2019 10:51 pm What about when the objects are nested in many layers? For example, various Std Parts with various PartDesign Bodies. Only the Parts are selected, or the Bodies inside as well? What if the Std Part is inside a Std_Group? Should the Std_Group be selected, and not the Std_Part, nor the Bodies?
The top level refers to the hierarchy defined in 3D, not in the tree view. Std_Group is special as it does not defines any hierarchy in 3D, so its (nested) children and the group itself are considered at the same level. This is similar to a Fusion object. All fused child and the fusion itself are at the same level. Std_Part and Body does creates hierarchy, so only the top level Part or Body will be selected.

chrisb wrote: Fri Nov 15, 2019 11:00 pm It seems to be sensible to restrict the selection to the current document, but I find it cumbersome to select only the top level items. A use case for selecting all is in connection with deselecting certain items afterwards, when complete subtrees should be deleted. If only the top level items of Part workbench are selected, then only these are removed.
Yeah, on second thought, maybe that'll just confuse the user. I'll restrict the selection to current document only.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
jnweiger
Posts: 3
Joined: Fri Sep 07, 2018 1:43 am

Re: Crash when selecting all in combo view

Post by jnweiger »

realthunder wrote: Fri Nov 15, 2019 10:27 pm May I ask what the user expects when he perform a CTRL+A in the tree view? The default behavior is to select all tree items in all documents. That's hardly useful IMO. My patch now changes the behavior to select only the top level objects in the current active document. Would that be okay?
Select all in current docurment would be best.
I'd want to use this for copy/paste or delete.

I'd like to think of it as an efficiency boost. If a select shall include "most except a few", then I'd like to
first: CTRL-A select all, and second: CTRL-Click to deselect some.

I have not yet seen a situation where a deep tree select is needed. So far selecting toplevel objects was perfectly fine for me.
Without proper use cases for both, I'd vote for CTRL-A should be consisted with what SHIFT-Click would do for selecting a range of objects: Select the visible objects. Trees that are expanded have their objects selected, trees that are collapsed have only their toplevel selected.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Crash when selecting all in combo view

Post by easyw-fc »

realthunder wrote: Fri Nov 15, 2019 10:27 pm May I ask what the user expects when he perform a CTRL+A in the tree view? The default behavior is to select all tree items in all documents. That's hardly useful IMO. My patch now changes the behavior to select only the top level objects in the current active document. Would that be okay?
Select all in current document would be best.
This is the default behavior in all software.

may be a slight modification would be:

Code: Select all

CTRL-A
to select top level objects

Code: Select all

Shift CTRL-A
to select all objects in the way it was before link merge
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Crash when selecting all in combo view

Post by realthunder »

PR submitted here.

Tree view select all is to select all objects in the active document. Plus a small optimization to disable tree view auto expansion when select all.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
Post Reply