Bug 428611 - Cantor crashes after closing tab with working Sage
Summary: Cantor crashes after closing tab with working Sage
Status: RESOLVED FIXED
Alias: None
Product: cantor
Classification: Applications
Component: general (show other bugs)
Version: 20.08
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2020-11-02 19:28 UTC by Łukasz Konieczny
Modified: 2021-02-14 11:49 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 21.04
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Łukasz Konieczny 2020-11-02 19:28:13 UTC
Application: cantor (20.08.2)

Qt Version: 5.14.2
Frameworks Version: 5.74.0
Operating System: Linux 5.8.0-26-generic x86_64
Windowing system: X11
Distribution: Ubuntu 20.10

-- Information about the crash:
- What I was doing when the application crashed:
I tried to use Sage 9.2 installed in /opt/SageMath/ and symlinked in /usr/bin/. Sage doesn't work in Cantor after all (but works in terminal), but the biggest problem is that Cantor crashes when I click to close tab with worksheet. It happens every time.
- Custom settings of the application:
I have manually installed Sage in /opt/ (vanilla version downloaded from Sage website).

The crash can be reproduced every time.

-- Backtrace:
Application: Cantor (cantor), signal: Segmentation fault
Content of s_kcrashErrorMessage: (null)
[KCrash Handler]
#6  0x0000000000000000 in ?? ()
#7  0x00007fa3fb7732e6 in QtPrivate::QSlotObjectBase::call (a=0x7ffd9a19d250, r=0x55b9698c8db0, this=0x55b969a58f70) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#8  doActivate<false> (sender=0x55b9698e6110, signal_index=7, argv=0x7ffd9a19d250) at kernel/qobject.cpp:3870
#9  0x00007fa3fb7732e6 in QtPrivate::QSlotObjectBase::call (a=0x7ffd9a19d390, r=0x55b96a0d2790, this=0x55b96a2aafb0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#10 doActivate<false> (sender=0x55b96989d350, signal_index=8, argv=argv@entry=0x7ffd9a19d390) at kernel/qobject.cpp:3870
#11 0x00007fa3fb76d068 in QMetaObject::activate (sender=sender@entry=0x55b96989d350, m=m@entry=0x7fa3fcdb42c0 <Cantor::Expression::staticMetaObject>, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x7ffd9a19d390) at kernel/qobject.cpp:3930
#12 0x00007fa3fcd77cf5 in Cantor::Expression::statusChanged (this=this@entry=0x55b96989d350, _t1=<optimized out>, _t1@entry=Cantor::Expression::Interrupted) at ./obj-x86_64-linux-gnu/src/lib/cantorlibs_autogen/EWIEGA46WW/moc_expression.cpp:249
#13 0x00007fa3fcd7db8c in Cantor::Expression::setStatus (this=0x55b96989d350, status=Cantor::Expression::Interrupted) at ./src/lib/expression.cpp:206
#14 0x00007fa3f009ece5 in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/cantor/backends/cantor_sagebackend.so
#15 0x00007fa3f009f149 in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/cantor/backends/cantor_sagebackend.so
#16 0x00007fa3deafded0 in Worksheet::~Worksheet (this=0x55b9698e6110, __in_chrg=<optimized out>) at ./src/worksheet.cpp:119
#17 0x00007fa3deafe08d in Worksheet::~Worksheet (this=0x55b9698e6110, __in_chrg=<optimized out>) at ./src/worksheet.cpp:107
#18 0x00007fa3fb76718e in QObjectPrivate::deleteChildren (this=this@entry=0x55b9696d4c00) at kernel/qobject.cpp:2123
#19 0x00007fa3fc22fa66 in QWidget::~QWidget (this=0x55b9699460d0, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1530
#20 0x00007fa3fc22fdbd in QWidget::~QWidget (this=0x55b9699460d0, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1408
#21 0x00007fa3fcd118b7 in KParts::Part::~Part (this=0x55b9698c8db0, __vtt_parm=0x7fa3deb77638 <VTT for CantorPart+24>, __in_chrg=<optimized out>) at /usr/include/c++/10/bits/atomic_base.h:420
#22 0x00007fa3deae5a82 in CantorPart::~CantorPart (this=0x55b9698c8db0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:53
#23 0x00007fa3deae5acd in CantorPart::~CantorPart (this=0x55b9698c8db0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at ./src/cantor_part.cpp:400
#24 0x000055b967a7c6d0 in CantorShell::closeTab (this=0x55b96967cb30, index=<optimized out>) at ./src/cantor.cpp:483
#25 0x00007fa3fb773320 in doActivate<false> (sender=0x55b9697f0650, signal_index=8, argv=argv@entry=0x7ffd9a19d7b0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
#26 0x00007fa3fb76d068 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7fa3fc7075e0 <QTabWidget::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffd9a19d7b0) at kernel/qobject.cpp:3930
#27 0x00007fa3fc3c23e5 in QTabWidget::tabCloseRequested (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qtabwidget.cpp:333
#28 0x00007fa3fb773320 in doActivate<false> (sender=0x55b969749a30, signal_index=8, argv=argv@entry=0x7ffd9a19d8d0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
#29 0x00007fa3fb76d068 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7fa3fc706040 <QTabBar::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffd9a19d8d0) at kernel/qobject.cpp:3930
#30 0x00007fa3fc3a1ff5 in QTabBar::tabCloseRequested (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qtabbar.cpp:345
#31 0x00007fa3fb773320 in doActivate<false> (sender=0x55b9698d0990, signal_index=9, argv=argv@entry=0x7ffd9a19d9f0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
#32 0x00007fa3fb76d068 in QMetaObject::activate (sender=sender@entry=0x55b9698d0990, m=m@entry=0x7fa3fc6fa2a0 <QAbstractButton::staticMetaObject>, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7ffd9a19d9f0) at kernel/qobject.cpp:3930
#33 0x00007fa3fc2e1ec6 in QAbstractButton::clicked (this=this@entry=0x55b9698d0990, _t1=<optimized out>) at .moc/moc_qabstractbutton.cpp:313
#34 0x00007fa3fc2e288e in QAbstractButtonPrivate::emitClicked (this=this@entry=0x55b96a162cd0) at widgets/qabstractbutton.cpp:415
#35 0x00007fa3fc2e4143 in QAbstractButtonPrivate::click (this=this@entry=0x55b96a162cd0) at widgets/qabstractbutton.cpp:408
#36 0x00007fa3fc2e4325 in QAbstractButton::mouseReleaseEvent (this=0x55b9698d0990, e=0x7ffd9a19dfb0) at widgets/qabstractbutton.cpp:1012
#37 0x00007fa3fc23430e in QWidget::event (this=0x55b9698d0990, event=0x7ffd9a19dfb0) at kernel/qwidget.cpp:9033
#38 0x00007fa3fc1f3013 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55b9698d0990, e=0x7ffd9a19dfb0) at kernel/qapplication.cpp:3685
#39 0x00007fa3fc1f8841 in QApplication::notify(QObject*, QEvent*) () at kernel/qapplication.cpp:3129
#40 0x00007fa3fb73d1ca in QCoreApplication::notifyInternal2 (receiver=0x55b9698d0990, event=0x7ffd9a19dfb0) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:153
#41 0x00007fa3fc1f773a in QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x55b9698d0990, event=event@entry=0x7ffd9a19dfb0, alienWidget=alienWidget@entry=0x55b9698d0990, nativeWidget=0x55b96967cb30, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2615
#42 0x00007fa3fc24cf32 in QWidgetWindow::handleMouseEvent (this=0x55b969b1ca70, event=0x7ffd9a19e270) at /usr/include/c++/10/bits/atomic_base.h:420
#43 0x00007fa3fc24fd8e in QWidgetWindow::event (this=0x55b969b1ca70, event=0x7ffd9a19e270) at kernel/qwidgetwindow.cpp:295
#44 0x00007fa3fc1f3013 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55b969b1ca70, e=0x7ffd9a19e270) at kernel/qapplication.cpp:3685
#45 0x00007fa3fb73d1ca in QCoreApplication::notifyInternal2 (receiver=0x55b969b1ca70, event=0x7ffd9a19e270) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:153
#46 0x00007fa3fbb0e48b in QGuiApplicationPrivate::processMouseEvent (e=0x55b96a21b300) at kernel/qguiapplication.cpp:2203
#47 0x00007fa3fbae42bb in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1170
#48 0x00007fa3f4cae35e in xcbSourceDispatch (source=<optimized out>) at qxcbeventdispatcher.cpp:105
#49 0x00007fa3f9c164db in g_main_dispatch (context=0x7fa3ec005000) at ../../../glib/gmain.c:3325
#50 g_main_context_dispatch (context=0x7fa3ec005000) at ../../../glib/gmain.c:4016
#51 0x00007fa3f9c16788 in g_main_context_iterate (context=context@entry=0x7fa3ec005000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4092
#52 0x00007fa3f9c16853 in g_main_context_iteration (context=0x7fa3ec005000, may_block=may_block@entry=1) at ../../../glib/gmain.c:4157
#53 0x00007fa3fb794843 in QEventDispatcherGlib::processEvents (this=0x55b9695fb160, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#54 0x00007fa3fb73ba4b in QEventLoop::exec (this=this@entry=0x7ffd9a19e5a0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136
#55 0x00007fa3fb743fc6 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#56 0x000055b967a7787f in main (argc=<optimized out>, argv=<optimized out>) at ./src/main.cpp:152
[Inferior 1 (process 15810) detached]

Possible duplicates by query: bug 427575, bug 426596, bug 426090, bug 425786, bug 425658.

Reported using DrKonqi
Comment 1 Nikita Sirgienko 2020-11-05 11:28:06 UTC
Crash on tab closing happends for Sage tabs or in all tabs?
Comment 2 Łukasz Konieczny 2020-11-05 12:37:11 UTC
Looks like only Sage tabs crash on closing. I have tried Maxima and it works fine.
Comment 3 Nikita Sirgienko 2020-11-11 11:02:48 UTC
Well, I have created separate bug report for Cantor ans Sage 9.2 problems: https://bugs.kde.org/show_bug.cgi?id=428961.
The fix, which will make Sage 9.2 workable with Cantor will apears in 20.12, but you can manually fix it on your version, if you want it - you need only update Cantor's script file (cantor-execsage, which is placed in /usr/share/cantor/sagebackend/ or /usr/local/share/cantor/sagebackend, which depending from your installation). The new script code, which you need is here - https://invent.kde.org/education/cantor/-/blob/master/src/backends/sage/cantor-execsage.
Comment 4 Nikita Sirgienko 2020-11-11 11:12:15 UTC
About crashing problem - I don't know, how to fix it, because crash appears in Qt code, and I even don't know why it goes there in first place.
But there is a good news - crash will apears only, when Cantor can't use Sage. So, for example, the problem don't appears with Sage 9.1, because Cantor works with this version.
And after script fix - the problems will gone for Sage 9.2 too.
So, this problem is on low priority, and because it appears very rarely and depends from another bug - i will set status as LATER.
Comment 5 Łukasz Konieczny 2020-11-11 14:12:09 UTC
(In reply to Nikita Sirgienko from comment #4)
> About crashing problem - I don't know, how to fix it, because crash appears
> in Qt code, and I even don't know why it goes there in first place.
> But there is a good news - crash will apears only, when Cantor can't use
> Sage. So, for example, the problem don't appears with Sage 9.1, because
> Cantor works with this version.
> And after script fix - the problems will gone for Sage 9.2 too.
> So, this problem is on low priority, and because it appears very rarely and
> depends from another bug - i will set status as LATER.

OK. Thank you very much for help and explanation.
Regards.
Łukasz Konieczny
Comment 6 Alexander Semke 2021-02-14 10:53:34 UTC
This problem can be reproduced also for other backends like Maxima for example. It happens always when there is an expression having the status "running" and we close the tab. I'll provide a fix for it. Please note, your problem with Sage not working in Cantor won't be addressed by this, it will only stop Cantor from crashing if you try to close your "hanging" Sage worksheet.
Comment 7 Alexander Semke 2021-02-14 11:49:15 UTC
Git commit c71ffbcb963d1091fc7ab13b12082ea9e2b243f7 by Alexander Semke.
Committed on 14/02/2021 at 11:48.
Pushed by asemke into branch 'master'.

Don't try to modify the worksheet when it's currently being destroyed.
FIXED-IN: 21.04

M  +11   -3    src/cantor_part.cpp
M  +6    -6    src/worksheet.cpp
M  +1    -0    src/worksheet.h

https://invent.kde.org/education/cantor/commit/c71ffbcb963d1091fc7ab13b12082ea9e2b243f7