[Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Frank Schrüfer
Posts: 34
Joined: Sat Dec 25, 2021 12:23 pm

[Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by Frank Schrüfer »

Hy,

this might be a bug in the qt library version 5.15.2+kde294-5.2 from the OpenSuse tumbleweed repository, but I don't know.

I have a project which is heavily configurable via a spreadsheet. For now I found two parameters which altered will crash FreeCAD. At least most of the time. Astonishingly while I tried to get the second backtrace it one time worked and just produced this output:

Code: Select all

QObject::installEventFilter(): Cannot filter events for objects in a different thread.
The other times different signals occured:

1. one:

Code: Select all

Thread 1 "FreeCAD" received signal SIGBUS, Bus error.
QObject::installEventFilter (this=0x5b7a870, obj=0x53816e0) at kernel/qobject.cpp:2221
2221        if (d->threadData != obj->d_func()->threadData) {
(gdb) bt
#0  QObject::installEventFilter(QObject*) (this=0x5b7a870, obj=0x53816e0) at kernel/qobject.cpp:2221
#1  0x00007ffff2f036aa in QAbstractItemView::commitData(QWidget*) (this=<optimized out>, editor=0x5b7a870)
    at itemviews/qabstractitemview.cpp:2909
#2  0x00007ffed67662a1 in SpreadsheetGui::SheetTableView::commitData(QWidget*) (this=0x2602bc0, editor=0x5b7a870)
    at /home/system/usr/FreeCAD/src/src/Mod/Spreadsheet/Gui/SheetTableView.cpp:478
#3  0x00007ffed676aad5 in SpreadsheetGui::SheetTableView::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    (_o=0x2602bc0, _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7fffffffb180)
    at /home/system/usr/FreeCAD/bin/build/src/Mod/Spreadsheet/Gui/SpreadsheetGui_autogen/include/moc_SheetTableView.cpp:272
#4  0x00007ffff2115488 in doActivate<false>(QObject*, int, void**) (sender=0x53816e0, signal_index=3, argv=0x7fffffffb180)
    at kernel/qobject.cpp:3898
#5  0x00007ffff210e7af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=sender@entry=0x53816e0, m=m@entry=0x7ffff31c8da0 <QAbstractItemDelegate::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffb180) at kernel/qobject.cpp:3946
#6  0x00007ffff2f2143f in QAbstractItemDelegate::commitData(QWidget*) (this=this@entry=0x53816e0, _t1=<optimized out>, _t1@entry=0x5b7a870)
    at .moc/moc_qabstractitemdelegate.cpp:205
#7  0x00007ffff2f21fda in QAbstractItemDelegatePrivate::_q_commitDataAndCloseEditor(QWidget*) (editor=0x5b7a870, this=<optimized out>)
    at itemviews/qabstractitemdelegate.cpp:634
#8  QAbstractItemDelegate::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at .moc/moc_qabstractitemdelegate.cpp:100
#9  0x00007ffff210b28e in QObject::event(QEvent*) (this=0x53816e0, e=0xd13520) at kernel/qobject.cpp:1314
#10 0x00007ffff2c8fb0f in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x53816e0, e=0xd13520)
    at kernel/qapplication.cpp:3632
#11 0x00007ffff6aaf3ce in Gui::GUIApplication::notify(QObject*, QEvent*) (this=0x7fffffffc1d0, receiver=0x53816e0, event=0xd13520)
    at /home/system/usr/FreeCAD/src/src/Gui/GuiApplication.cpp:84
#12 0x00007ffff20deb5a in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x53816e0, event=0xd13520)
    at kernel/qcoreapplication.cpp:1064
#13 0x00007ffff20e1b97 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x684880)
    at kernel/qcoreapplication.cpp:1821
#14 0x00007ffff2136c33 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=s@entry=0x801db0) at kernel/qeventdispatcher_glib.cpp:277
#15 0x00007ffff08ca122 in g_main_dispatch (context=0x7fffe4005010) at ../glib/gmain.c:3417
#16 g_main_context_dispatch (context=0x7fffe4005010) at ../glib/gmain.c:4135
#17 0x00007ffff08ca4b8 in g_main_context_iterate
--Type <RET> for more, q to quit, c to continue without paging--
    (context=context@entry=0x7fffe4005010, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4211
#18 0x00007ffff08ca56f in g_main_context_iteration (context=0x7fffe4005010, may_block=1) at ../glib/gmain.c:4276
#19 0x00007ffff21362b4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x80d6d0, flags=...)
    at kernel/qeventdispatcher_glib.cpp:423
#20 0x00007ffff20dd55b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffb7b0, flags=..., flags@entry=...)
    at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#21 0x00007ffff20e5820 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#22 0x00007ffff695d8ef in Gui::Application::runApplication() () at /home/system/usr/FreeCAD/src/src/Gui/Application.cpp:2277
#23 0x000000000040c43f in main(int, char**) (argc=3, argv=0x7fffffffd408) at /home/system/usr/FreeCAD/src/src/Main/MainGui.cpp:290
(gdb) q
2. one:

Code: Select all

Thread 1 "FreeCAD" received signal SIGSEGV, Segmentation fault.
QObject::installEventFilter (this=0x45bbb40, obj=0x23947850) at kernel/qobject.cpp:2221
2221        if (d->threadData != obj->d_func()->threadData) {
(gdb) bt
#0  QObject::installEventFilter(QObject*) (this=0x45bbb40, obj=0x23947850) at kernel/qobject.cpp:2221
#1  0x00007ffff2f036aa in QAbstractItemView::commitData(QWidget*) (this=<optimized out>, editor=0x45bbb40)
    at itemviews/qabstractitemview.cpp:2909
#2  0x00007ffedab072a1 in SpreadsheetGui::SheetTableView::commitData(QWidget*) (this=0x2208f970, editor=0x45bbb40)
    at /home/system/usr/FreeCAD/src/src/Mod/Spreadsheet/Gui/SheetTableView.cpp:478
#3  0x00007ffedab0bad5 in SpreadsheetGui::SheetTableView::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    (_o=0x2208f970, _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7fffffffb180)
    at /home/system/usr/FreeCAD/bin/build/src/Mod/Spreadsheet/Gui/SpreadsheetGui_autogen/include/moc_SheetTableView.cpp:272
#4  0x00007ffff2115488 in doActivate<false>(QObject*, int, void**) (sender=0x23947850, signal_index=3, argv=0x7fffffffb180)
    at kernel/qobject.cpp:3898
#5  0x00007ffff210e7af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=sender@entry=0x23947850, m=m@entry=0x7ffff31c8da0 <QAbstractItemDelegate::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffb180) at kernel/qobject.cpp:3946
#6  0x00007ffff2f2143f in QAbstractItemDelegate::commitData(QWidget*) (this=this@entry=0x23947850, _t1=<optimized out>, _t1@entry=0x45bbb40)
    at .moc/moc_qabstractitemdelegate.cpp:205
#7  0x00007ffff2f21fda in QAbstractItemDelegatePrivate::_q_commitDataAndCloseEditor(QWidget*) (editor=0x45bbb40, this=<optimized out>)
    at itemviews/qabstractitemdelegate.cpp:634
#8  QAbstractItemDelegate::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at .moc/moc_qabstractitemdelegate.cpp:100
#9  0x00007ffff210b28e in QObject::event(QEvent*) (this=0x23947850, e=0x212b5970) at kernel/qobject.cpp:1314
#10 0x00007ffff2c8fb0f in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x23947850, e=0x212b5970)
    at kernel/qapplication.cpp:3632
#11 0x00007ffff6aaf3ce in Gui::GUIApplication::notify(QObject*, QEvent*) (this=0x7fffffffc1d0, receiver=0x23947850, event=0x212b5970)
    at /home/system/usr/FreeCAD/src/src/Gui/GuiApplication.cpp:84
#12 0x00007ffff20deb5a in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x23947850, event=0x212b5970)
    at kernel/qcoreapplication.cpp:1064
#13 0x00007ffff20e1b97 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x6995e0)
    at kernel/qcoreapplication.cpp:1821
#14 0x00007ffff2136c33 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=s@entry=0x8011b0) at kernel/qeventdispatcher_glib.cpp:277
#15 0x00007ffff08ca122 in g_main_dispatch (context=0x7fffe4005010) at ../glib/gmain.c:3417
#16 g_main_context_dispatch (context=0x7fffe4005010) at ../glib/gmain.c:4135
#17 0x00007ffff08ca4b8 in g_main_context_iterate
--Type <RET> for more, q to quit, c to continue without paging--
    (context=context@entry=0x7fffe4005010, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4211
#18 0x00007ffff08ca56f in g_main_context_iteration (context=0x7fffe4005010, may_block=1) at ../glib/gmain.c:4276
#19 0x00007ffff21362b4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x80c990, flags=...)
    at kernel/qeventdispatcher_glib.cpp:423
#20 0x00007ffff20dd55b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffb7b0, flags=..., flags@entry=...)
    at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#21 0x00007ffff20e5820 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#22 0x00007ffff695d8ef in Gui::Application::runApplication() () at /home/system/usr/FreeCAD/src/src/Gui/Application.cpp:2277
#23 0x000000000040c43f in main(int, char**) (argc=3, argv=0x7fffffffd408) at /home/system/usr/FreeCAD/src/src/Main/MainGui.cpp:290
(gdb)
I'm using todays FreeCAD version from git:

Code: Select all

OS: openSUSE Tumbleweed (KDE//usr/share/xsessions/plasma5)
Word size of FreeCAD: 64-bit
Version: 0.20.28809 (Git)
Build type: Release
Branch: master
Hash: c960622b3d67c635534603c6c1453df1ec8b9e02
Python 3.8.13, Qt 5.15.2, Coin 4.0.0, OCC 7.6.1
Locale: German/Germany (de_DE)
Installed mods: 
  * 3DfindIT 1.2.0
  * AirPlaneDesign 0.4.0
  * BIM 2021.12.0
  * BOLTSFC
  * Beltrami 1.0.6-alpha
  * CADExchanger
  * CommandPanel
  * CubeMenu
  * CurvedShapes 1.0.3
  * Curves 0.4.2
  * Defeaturing
  * Design456
  * DesignSPHysics 0.6.1-2201-31-01
  * DynamicData 2.46.0
  * EM
  * ExplodedAssembly
  * FEM_FrontISTR 0.1.0
  * GDML 1.8.0
  * IconThemes
  * ImportNURBS
  * InventorLoader 1.3.0
  * LCInterlocking
  * Lithophane
  * MakerWorkbench
  * OSE3dPrinter
  * dodo
  * fcgear 1.0.0
  * frame
  * lattice2 1.0.0
  * nurbs
  * ose-piping
  * parts_library
  * pcb
  * Autoload
  * POV-Ray-Rendering
  * Pyramids-and-Polyhedrons
  * pyrate
  * ose-workbench-core-master
  * Glass
  * Help 1.0.0-alpha
  * MeshRemodel 1.8919.0
  * Reinforcement 0.1.0
  * OpticsWorkbench 0.1.0
  * Plot 0.1.0
  * MnesarcoUtils 0.1.0
  * Manipulator 0.1.0
  * Assembly4 0.1.0
  * fasteners 0.3.40
  * Marz 0.3.40
I'd be happy to provide or find out more information.

Thank you for your work,
Frank
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by wmayer »

this might be a bug in the qt library version 5.15.2+kde294-5.2 from the OpenSuse tumbleweed repository,
I think you are right about this. In our code base I cannot see that for a spreadsheet we do anything in a QThread but since a QThread is involved it's probably Qt itself that has started it.
Frank Schrüfer
Posts: 34
Joined: Sat Dec 25, 2021 12:23 pm

Re: [Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by Frank Schrüfer »

wmayer wrote: Sat May 07, 2022 11:05 am I think you are right about this. In our code base I cannot see that for a spreadsheet we do anything in a QThread but since a QThread is involved it's probably Qt itself that has started it.
From the occurence of that mentioned 'Cannot filter events for objects in a different thread' and the fact that multiple Threads get created and exit (see below) I'd intuitively suspect that there's some kind of race-condition involved.

Code: Select all

...
[Thread 0x7ffecb7fe640 (LWP 28069) exited]
[New Thread 0x7ffecb7fe640 (LWP 28070)]
[Thread 0x7ffecb7fe640 (LWP 28070) exited]
[New Thread 0x7ffecb7fe640 (LWP 28071)]
[Thread 0x7ffecb7fe640 (LWP 28071) exited]
[New Thread 0x7ffecb7fe640 (LWP 28072)]
[Thread 0x7ffecb7fe640 (LWP 28072) exited]
[New Thread 0x7ffecb7fe640 (LWP 28073)]
[Thread 0x7ffecb7fe640 (LWP 28073) exited]
[New Thread 0x7ffecb7fe640 (LWP 28074)]
[Thread 0x7ffecb7fe640 (LWP 28074) exited]
[New Thread 0x7ffecb7fe640 (LWP 28075)]
[Thread 0x7ffecb7fe640 (LWP 28075) exited]
[New Thread 0x7ffecb7fe640 (LWP 28076)]
[Thread 0x7ffecb7fe640 (LWP 28076) exited]
[New Thread 0x7ffecb7fe640 (LWP 28077)]
[Thread 0x7ffecb7fe640 (LWP 28077) exited]
[New Thread 0x7ffecb7fe640 (LWP 28078)]
[Thread 0x7ffecb7fe640 (LWP 28078) exited]
[New Thread 0x7ffecb7fe640 (LWP 28079)]
[Thread 0x7ffecb7fe640 (LWP 28079) exited]
QObject::installEventFilter(): Cannot filter events for objects in a different thread.
I'm gonna post a bugreport at a qt forum either today or tomorrow (maybe you know the right forum/place to do that?) and then post a link to it here.

Thanks,
Frank
Frank Schrüfer
Posts: 34
Joined: Sat Dec 25, 2021 12:23 pm

Re: [Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by Frank Schrüfer »

openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by openBrain »

Frank Schrüfer wrote: Sat May 07, 2022 10:31 am Hy,

this might be a bug in the qt library version 5.15.2+kde294-5.2 from the OpenSuse tumbleweed repository, but I don't know.

I have a project which is heavily configurable via a spreadsheet. For now I found two parameters which altered will crash FreeCAD. At least most of the time. Astonishingly while I tried to get the second backtrace it one time worked and just produced this output:
Could you share file and procedure to reproduce ? Thx
Frank Schrüfer
Posts: 34
Joined: Sat Dec 25, 2021 12:23 pm

Re: [Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by Frank Schrüfer »

openBrain wrote: Mon May 09, 2022 8:04 am Could you share file and procedure to reproduce ? Thx
I'd be willing to do that but the limit for attaching files here is 1.46 MiB and the FCStd file is minimum 3.2 MB.
I've already removed some unneccessary things for testing (accessoires) which actually showed that the chance to crash significantly reduced.
The size where it still crashes most of the time is 3.3 MB.

If you have a way for me to give you the file I'd do that.

Thanks,
Frank
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by openBrain »

Frank Schrüfer wrote: Mon May 09, 2022 11:45 am If you have a way for me to give you the file I'd do that.
Here should be fine : https://upload.disroot.org/
Frank Schrüfer
Posts: 34
Joined: Sat Dec 25, 2021 12:23 pm

Re: [Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by Frank Schrüfer »

openBrain wrote: Mon May 09, 2022 12:15 pm Here should be fine : https://upload.disroot.org/
Link: https://upload.disroot.org/r/vmAzZQ60#F ... j7lGkYQqc=

Steps to reproduce:
1. Open spreadsheet CONFIG-ZELLENPACKET
2. Change the value row 29 column D (bs3w) to a value in the range >=0 && <=3
(Some other cells like e.g. 33 D have the same effect)

I confirmed it still crashes with todays version from git but had to try 3 times. I got the impression that stability improved. I saw that the spreadsheet problem inserting/deleting rows was fixed (https://forum.freecadweb.org/viewtopic. ... 8&p=593611 thanks for the fix!), maybe that had a sideeffect.
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by wmayer »

Confirmed a crash.

This is only a warning and appears as yellow text in the console:

Code: Select all

QObject::installEventFilter(): Cannot filter events for objects in a different thread.
So, I am not sure if this is really relevant here. The callstack of the crash is:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x3ef10) [0x7fb3cd256f10]
#1  0x7fb3cf5d43e8 in QWidget::window() const from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x8
#2  0x7fb3cf5d5240 in QWidget::hasFocus() const from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x50
#3  0x7fb3cf7fe736 in QAbstractItemView::closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x66
#4  0x7fb35712c9fe in SpreadsheetGui::SheetTableView::closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint) from /home/user/Projects/build_clang/Mod/Spreadsheet/SpreadsheetGui.so+0x2e
#5  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x3a0a56) [0x7fb3cf7f9a56]
#6  0x7fb3ce85e525 in QMetaObject::activate(QObject*, int, int, void**) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x865
#7  0x7fb3cf813b90 in QAbstractItemDelegate::closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x50
#8  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x3bb958) [0x7fb3cf814958]
#9  0x7fb3ce85f092 in QObject::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0xe2
#10  0x7fb3cf5ad83c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x9c
#11  0x7fb3cf5b5104 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x2a4
#12  0x7fb3d62c82ff in Gui::GUIApplication::notify(QObject*, QEvent*) from /home/user/Projects/build_clang/lib/libFreeCADGui.so+0x34f
#13  0x7fb3ce82f8a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x118
#14  0x7fb3ce83201d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x1ed
#15  /usr/lib/x86_64-linux-gnu/libQt5Core.so.5(+0x2e4233) [0x7fb3ce889233]
#16  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2e7) [0x7fb3caaf8537]
#17  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4c770) [0x7fb3caaf8770]
#18  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7fb3caaf87fc]
#19  0x7fb3ce88885f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x5f
#20  0x7fb3ce82d8da in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x13a
#21  0x7fb3ce836984 in QCoreApplication::exec() from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x94
#22  0x7fb3d6156751 in Gui::Application::runApplication() from /home/user/Projects/build_clang/lib/libFreeCADGui.so+0x4051
Running it a second time doesn't show this warning any more and the callstack is quite different:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x3ef10) [0x7fa25d8d8f10]
#1  0x7fa25eee6872 in QObject::installEventFilter(QObject*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x32
#2  0x7fa25fe7c760 in QAbstractItemView::commitData(QWidget*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0xe0
#3  0x7fa1e77a0518 in SpreadsheetGui::SheetTableView::commitData(QWidget*) from /home/user/Projects/build_clang/Mod/Spreadsheet/SpreadsheetGui.so+0x28
#4  /home/user/Projects/build_clang/Mod/Spreadsheet/SpreadsheetGui.so(+0x17a876) [0x7fa1e77a5876]
#5  0x7fa25eee0525 in QMetaObject::activate(QObject*, int, int, void**) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x865
#6  0x7fa25fe95b1f in QAbstractItemDelegate::commitData(QWidget*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x3f
#7  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x3bb805) [0x7fa25fe96805]
#8  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x3bb958) [0x7fa25fe96958]
#9  0x7fa25eee1092 in QObject::event(QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0xe2
#10  0x7fa25fc2f83c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x9c
#11  0x7fa25fc37104 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x2a4
#12  0x7fa26694a2ff in Gui::GUIApplication::notify(QObject*, QEvent*) from /home/user/Projects/build_clang/lib/libFreeCADGui.so+0x34f
#13  0x7fa25eeb18a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x118
#14  0x7fa25eeb401d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x1ed
#15  /usr/lib/x86_64-linux-gnu/libQt5Core.so.5(+0x2e4233) [0x7fa25ef0b233]
#16  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2e7) [0x7fa25b17a537]
#17  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4c770) [0x7fa25b17a770]
#18  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7fa25b17a7fc]
#19  0x7fa25ef0a85f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x5f
#20  0x7fa25eeaf8da in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x13a
#21  0x7fa25eeb8984 in QCoreApplication::exec() from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x94
#22  0x7fa2667d8751 in Gui::Application::runApplication() from /home/user/Projects/build_clang/lib/libFreeCADGui.so+0x4051
#23  ./bin/FreeCAD() [0x40be03]
#24  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fa25d8bbc87]
#25  ./bin/FreeCAD() [0x40986a]
Running it a third time was successful. This time I didn't do anything after changing the cell but waited until it either finishes or crashes while the other two times I switched several times between the console and FreeCAD.

What I have observed is that the modified cell shows its editor for quite a long time while the recompute is busy and there were for sure some calls of processEvents() in between and also worker threads might have been spawned by e.g. OCC.

So, it must be checked whether all this happens inside SheetTableView::commitData
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [Bug] SIGBUS & SIGSEGV altering spreadsheet parameter

Post by openBrain »

Frank Schrüfer wrote: Mon May 09, 2022 1:06 pm I confirmed it still crashes with todays version from git but had to try 3 times. I got the impression that stability improved. I saw that the spreadsheet problem inserting/deleting rows was fixed (https://forum.freecadweb.org/viewtopic. ... 8&p=593611 thanks for the fix!), maybe that had a sideeffect.
I tried several times and was indeed not able to reproduce with my build

Code: Select all

OS: Ubuntu 21.04 (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.28826 (Git)
Build type: Debug
Branch: master
Hash: ef2db349f8fc7a1bc2b918b505d76bb0b6e1c467
Python 3.9.5, Qt 5.15.2, Coin 4.0.0, OCC 7.5.2
Locale: English/United States (en_US) [ OS: French/France (fr_FR) ]
Post Reply