Bug 404752 - Cantor crashes with Sage backend
Summary: Cantor crashes with Sage backend
Status: RESOLVED DOWNSTREAM
Alias: None
Product: cantor
Classification: Applications
Component: sage-backend (show other bugs)
Version: 18.12
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: Filipe Saraiva
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2019-02-23 23:16 UTC by John Scott
Modified: 2019-04-07 02:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Scott 2019-02-23 23:16:20 UTC
Application: cantor (18.12.0)

Qt Version: 5.11.3
Frameworks Version: 5.54.0
Operating System: Linux 4.19.0-2-amd64 x86_64
Distribution: Debian GNU/Linux buster/sid

-- Information about the crash:
My backtrace was obtained when I'd been using Wayland, but the crash happens on X11 also. The crash occurs when trying to execute any command at all, including when using the menus.

Here's the command-line output when it crashes.

Using Wayland-EGL
dir:  "/usr/lib/x86_64-linux-gnu/qt5/plugins/cantor/backends"
Creating MaximaBackend
Creating NullBackend
Creating SageBackend
dir:  "/usr/bin/cantor/backends"
Backend  "Sage"  offers extensions:  ("HistoryExtension", "ScriptExtension", "CASExtension", "CalculusExtension", "LinearAlgebraExtension", "PlotExtension", "PackagingExtension")
Spawning a new Sage session
new worksheetaccess interface
loading assistants...
dir:  "/usr/lib/x86_64-linux-gnu/qt5/plugins/cantor/assistants"
plugin  "AdvancedPlot"  is not supported by  "Sage"
plugin  "Create Matrix"  is supported by  "Sage" , requires extensions  ("LinearAlgebraExtension")
plugin  "Differentiate"  is supported by  "Sage" , requires extensions  ("CalculusExtension")
plugin  "Eigenvalues"  is supported by  "Sage" , requires extensions  ("LinearAlgebraExtension", "HistoryExtension")
plugin  "Eigenvectors"  is supported by  "Sage" , requires extensions  ("LinearAlgebraExtension", "HistoryExtension")
plugin  "Import Package"  is supported by  "Sage" , requires extensions  ("PackagingExtension")
plugin  "Integrate"  is supported by  "Sage" , requires extensions  ("CalculusExtension")
plugin  "Invert Matrix"  is supported by  "Sage" , requires extensions  ("LinearAlgebraExtension", "HistoryExtension")
plugin  "Plot2d"  is supported by  "Sage" , requires extensions  ("PlotExtension")
plugin  "Plot3d"  is supported by  "Sage" , requires extensions  ("PlotExtension")
plugin  "QalculatePlot"  is not supported by  "Sage"
plugin  "RunScript"  is supported by  "Sage" , requires extensions  ("ScriptExtension")
plugin  "Solve"  is supported by  "Sage" , requires extensions  ("CASExtension")
dir:  "/usr/bin/cantor/assistants"
loading panel plugins for session of type  "Sage"
Requesting capabilities of SageSession
dir:  "/usr/lib/x86_64-linux-gnu/qt5/plugins/cantor/panels"
plugin  "Help"  is supported, requires extensions  ("")
plugin  "Variable Manager"  is not supported
dir:  "/usr/bin/cantor/panels"
Requesting capabilities of SageSession
Entry Appended
adding panel for  "Help"
Using the 'xdg-shell-v6' shell integration
ShortcutOverride 16777220 QFlags<Qt::KeyboardModifiers>(ShiftModifier)
login
found version:  ()

The crash can be reproduced every time.

-- Backtrace:
Application: Cantor (cantor), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f7fa1a2b800 (LWP 13000))]

Thread 3 (Thread 0x7f7f974e8700 (LWP 13002)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x558ea1a453d8) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x558ea1a45388, cond=0x558ea1a453b0) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x558ea1a453b0, mutex=0x558ea1a45388) at pthread_cond_wait.c:655
#3  0x00007f7f97743a32 in cnd_wait (mtx=0x558ea1a45388, cond=0x558ea1a453b0) at ../src/../include/c11/threads_posix.h:155
#4  util_queue_thread_func (input=input@entry=0x558ea1ad3bb0) at ../src/util/u_queue.c:270
#5  0x00007f7f977435f7 in impl_thrd_routine (p=<optimized out>) at ../src/../include/c11/threads_posix.h:87
#6  0x00007f7fa5436fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7  0x00007f7fa60ca80f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f7f9e7e2700 (LWP 13001)):
#0  __GI___libc_read (nbytes=16, buf=0x7f7f9e7e1b50, fd=5) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=5, buf=buf@entry=0x7f7f9e7e1b50, nbytes=nbytes@entry=16) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007f7fa48f6aa0 in read (__nbytes=16, __buf=0x7f7f9e7e1b50, __fd=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/unistd.h:44
#3  g_wakeup_acknowledge (wakeup=0x7f7f98001510) at ../../../glib/gwakeup.c:210
#4  0x00007f7fa48b0c0f in g_main_context_check (context=context@entry=0x7f7f98001cb0, max_priority=2147483647, fds=fds@entry=0x7f7f98005440, n_fds=n_fds@entry=1) at ../../../glib/gmain.c:3698
#5  0x00007f7fa48b10e0 in g_main_context_iterate (context=context@entry=0x7f7f98001cb0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:3917
#6  0x00007f7fa48b125c in g_main_context_iteration (context=0x7f7f98001cb0, may_block=may_block@entry=1) at ../../../glib/gmain.c:3981
#7  0x00007f7fa65ec04b in QEventDispatcherGlib::processEvents (this=0x7f7f98000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#8  0x00007f7fa659914b in QEventLoop::exec (this=this@entry=0x7f7f9e7e1d70, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140
#9  0x00007f7fa63e80d6 in QThread::exec (this=this@entry=0x7f7fa56b5d60 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at ../../include/QtCore/../../src/corelib/global/qflags.h:120
#10 0x00007f7fa563b545 in QDBusConnectionManager::run (this=0x7f7fa56b5d60 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:178
#11 0x00007f7fa63f1c77 in QThreadPrivate::start (arg=0x7f7fa56b5d60 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:367
#12 0x00007f7fa5436fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#13 0x00007f7fa60ca80f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7f7fa1a2b800 (LWP 13000)):
[KCrash Handler]
#6  0x00007f7fa646978c in QString::toIntegral_helper<int> (base=10, ok=0x0, len=<error reading variable: Cannot access memory at address 0x25>, data=<error reading variable: Cannot access memory at address 0x31>) at ../../include/QtCore/../../src/corelib/tools/qstring.h:895
#7  QString::toInt (this=<optimized out>, ok=ok@entry=0x0, base=base@entry=10) at tools/qstring.cpp:7078
#8  0x00007f7f9c60594d in SageSession::updateSageVersion (this=0x558ea1ba46c0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:115
#9  0x00007f7f9c605cc1 in SageSession::login (this=0x558ea1ba46c0) at ./src/backends/sage/sagesession.cpp:121
#10 0x00007f7f8ff96f21 in Worksheet::loginToSession (this=0x558ea1c5ec70) at ./src/worksheet.cpp:112
#11 0x00007f7f8ff9757d in Worksheet::evaluateCurrentEntry (this=0x558ea1c5ec70) at ./src/worksheet.cpp:496
#12 0x00007f7f8ff99a28 in Worksheet::appendCommandEntry (this=<optimized out>, text=...) at ./src/worksheet.cpp:578
#13 0x00007f7f8ff8efa7 in CantorPart::runCommand (cmd=..., this=0x558ea1ba4170) at ./src/cantor_part.cpp:785
#14 CantorPart::runAssistant (this=0x558ea1ba4170) at ./src/cantor_part.cpp:780
#15 0x00007f7f8ffd08ed in CantorPart::qt_static_metacall (_o=<optimized out>, _id=<optimized out>, _a=<optimized out>, _c=<optimized out>) at ./obj-x86_64-linux-gnu/src/cantorpart_autogen/EWIEGA46WW/moc_cantor_part.cpp:217
#16 0x00007f7fa65c35c6 in QMetaObject::activate (sender=0x558ea225e400, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3771
#17 0x00007f7fa65c3703 in QtPrivate::QSlotObjectBase::call (a=0x7ffe36b4d3e0, r=0x558ea225e400, this=0x558ea2263950) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:376
#18 QMetaObject::activate (sender=0x558ea2244b10, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3754
#19 0x00007f7fa6f09ee2 in QAction::triggered (this=this@entry=0x558ea2244b10, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#20 0x00007f7fa6f0c4f0 in QAction::activate (this=0x558ea2244b10, event=<optimized out>) at kernel/qaction.cpp:1166
#21 0x00007f7fa707cf6c in QMenuPrivate::activateCausedStack (this=this@entry=0x558ea2330cf0, causedStack=..., action=action@entry=0x558ea2244b10, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1371
#22 0x00007f7fa7084530 in QMenuPrivate::activateAction (this=this@entry=0x558ea2330cf0, action=action@entry=0x558ea2244b10, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1448
#23 0x00007f7fa708555b in QMenu::mouseReleaseEvent (this=<optimized out>, e=0x7ffe36b4d9f0) at widgets/qmenu.cpp:2942
#24 0x00007f7fa6f4e748 in QWidget::event (this=this@entry=0x558ea22ba0f0, event=event@entry=0x7ffe36b4d9f0) at kernel/qwidget.cpp:8925
#25 0x00007f7fa7087beb in QMenu::event (this=0x558ea22ba0f0, e=0x7ffe36b4d9f0) at widgets/qmenu.cpp:3064
#26 0x00007f7fa6f10491 in QApplicationPrivate::notify_helper (this=this@entry=0x558ea1916380, receiver=receiver@entry=0x558ea22ba0f0, e=e@entry=0x7ffe36b4d9f0) at kernel/qapplication.cpp:3726
#27 0x00007f7fa6f17d08 in QApplication::notify (this=<optimized out>, receiver=0x558ea22ba0f0, e=0x7ffe36b4d9f0) at kernel/qapplication.cpp:3202
#28 0x00007f7fa659a479 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x558ea22ba0f0, event=event@entry=0x7ffe36b4d9f0) at ../../include/QtCore/5.11.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#29 0x00007f7fa6f17019 in QCoreApplication::sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#30 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x558ea22ba0f0, event=event@entry=0x7ffe36b4d9f0, alienWidget=0x0, alienWidget@entry=0x558ea22ba0f0, nativeWidget=0x558ea22ba0f0, buttonDown=buttonDown@entry=0x7f7fa7408870 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:2694
#31 0x00007f7fa6f69623 in QWidgetWindow::handleMouseEvent (this=0x558ea24c63d0, event=0x7ffe36b4ddf0) at kernel/qwidgetwindow.cpp:556
#32 0x00007f7fa6f6bdee in QWidgetWindow::event (event=0x7ffe36b4ddf0, this=0x558ea24c63d0) at kernel/qwidgetwindow.cpp:281
#33 QWidgetWindow::event (this=0x558ea24c63d0, event=0x7ffe36b4ddf0) at kernel/qwidgetwindow.cpp:224
#34 0x00007f7fa6f10491 in QApplicationPrivate::notify_helper (this=this@entry=0x558ea1916380, receiver=receiver@entry=0x558ea24c63d0, e=e@entry=0x7ffe36b4ddf0) at kernel/qapplication.cpp:3726
#35 0x00007f7fa6f17ac0 in QApplication::notify (this=0x7ffe36b4e200, receiver=0x558ea24c63d0, e=0x7ffe36b4ddf0) at kernel/qapplication.cpp:3485
#36 0x00007f7fa659a479 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x558ea24c63d0, event=event@entry=0x7ffe36b4ddf0) at ../../include/QtCore/5.11.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#37 0x00007f7fa6943a6b in QCoreApplication::sendSpontaneousEvent (event=0x7ffe36b4ddf0, receiver=0x558ea24c63d0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:237
#38 QGuiApplicationPrivate::processMouseEvent (e=0x558ea1b5c600) at kernel/qguiapplication.cpp:2082
#39 0x00007f7fa6945925 in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0x558ea1b5c600) at kernel/qguiapplication.cpp:1817
#40 0x00007f7fa691fd3b in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1032
#41 0x00007f7fa16a16cb in QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5WaylandClient.so.5
#42 0x00007f7fa659914b in QEventLoop::exec (this=this@entry=0x7ffe36b4e070, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140
#43 0x00007f7fa65a12b2 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:120
#44 0x00007f7fa693a7ec in QGuiApplication::exec () at kernel/qguiapplication.cpp:1762
#45 0x00007f7fa6f10405 in QApplication::exec () at kernel/qapplication.cpp:2900
#46 0x0000558ea0c1cdca in main (argc=<optimized out>, argv=<optimized out>) at ./src/main.cpp:156
[Inferior 1 (process 13000) detached]

Reported using DrKonqi
Comment 1 Alexander Semke 2019-02-24 10:19:02 UTC
The code in  SageSession::updateSageVersion() needs to be made more stable...

What does 'sage -v' returns on your computer?
Comment 2 John Scott 2019-02-24 16:24:56 UTC
(In reply to Alexander Semke from comment #1)
> The code in  SageSession::updateSageVersion() needs to be made more stable...
> 
> What does 'sage -v' returns on your computer?

No, it doesn't. On my system, it returns 
/usr/bin/sage: line 16: /src/bin/sage-version.sh: No such file or directory

which is clearly a bug in Debian's SageMath package. I'll file it downstream, thanks for your help!