Bug 478213 - Okular crashes when en- or disabling SmartyPans formatting (markdown)
Summary: Okular crashes when en- or disabling SmartyPans formatting (markdown)
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 23.08.3
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-07 14:51 UTC by postix
Modified: 2023-12-07 15:37 UTC (History)
0 users

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 postix 2023-12-07 14:51:37 UTC
SUMMARY

Okular crashes when en- or disabling SmartyPans formatting (markdown). 


STEPS TO REPRODUCE
1. Open Okular
2. Open a PDF (LaTeX)
3. Go to Configure Display Backends -> Markdown
4. Activate SmartyPants formatting

OBSERVED RESULT

gdb bt

```
#0  0x00007f0d0d4832fd in __GI_rewind (fp=0x0) at rewind.c:34
#1  0x00007f0ccc1cf318 in Markdown::Converter::convertOpenFile() (this=this@entry=0x557af7b33580) at /usr/src/debug/okular-23.08.3/generators/markdown/converter.cpp:80
#2  0x00007f0ccc1cfaad in Markdown::Converter::convertAgain() (this=0x557af7b33580) at /usr/src/debug/okular-23.08.3/generators/markdown/converter.cpp:75
#3  MarkdownGenerator::reparseConfig() (this=0x557af76a9660) at /usr/src/debug/okular-23.08.3/generators/markdown/generator_md.cpp:41
#4  0x00007f0cf3f85fea in Okular::DocumentPrivate::slotGeneratorConfigChanged() (this=0x557af72df3e0) at /usr/src/debug/okular-23.08.3/core/document.cpp:1567
#5  Okular::DocumentPrivate::slotGeneratorConfigChanged() (this=0x557af72df3e0) at /usr/src/debug/okular-23.08.3/core/document.cpp:1555
#6  operator() (__closure=<optimized out>) at /usr/src/debug/okular-23.08.3/core/document.cpp:4724
#7  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Okular::Document::fillConfigDialog(KConfigDialog*)::<lambda()> >::call (arg=<optimized out>, f=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:146
#8  QtPrivate::Functor<Okular::Document::fillConfigDialog(KConfigDialog*)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:256
#9  QtPrivate::QFunctorSlotObject<Okular::Document::fillConfigDialog(KConfigDialog*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *)
    (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:443
#10 0x00007f0d0df25442 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffcfaf1b170, r=0x557af7369780, this=0x557af7ac8350) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#11 doActivate<false>(QObject*, int, void**) (sender=0x557af793c270, signal_index=13, argv=0x7ffcfaf1b170) at kernel/qobject.cpp:3925
#12 0x00007f0d0df1e0af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x557af793c270, m=m@entry=0x7f0d0f597240 <KConfigDialog::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffcfaf1b170)
    at kernel/qobject.cpp:3985
#13 0x00007f0d0f563325 in KConfigDialog::settingsChanged(QString const&) (this=this@entry=0x557af793c270, _t1=...) at /usr/src/debug/kconfigwidgets-5.112.0/build/src/KF5ConfigWidgets_autogen/include/moc_kconfigdialog.cpp:208
#14 0x00007f0d0f568069 in KConfigDialogPrivate::settingsChangedSlot() (this=<optimized out>) at /usr/src/debug/kconfigwidgets-5.112.0/src/kconfigdialog.cpp:295
#15 operator() (__closure=<optimized out>) at /usr/src/debug/kconfigwidgets-5.112.0/src/kconfigdialog.cpp:203
#16 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KConfigDialogPrivate::setupManagerConnections(KConfigDialogManager*)::<lambda()> >::call (arg=<optimized out>, f=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:146
#17 QtPrivate::Functor<KConfigDialogPrivate::setupManagerConnections(KConfigDialogManager*)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:256
#18 QtPrivate::QFunctorSlotObject<KConfigDialogPrivate::setupManagerConnections(KConfigDialogManager*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *)
    (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:443
#19 0x00007f0d0df25442 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffcfaf1b250, r=0x557af793c270, this=0x557af798d6c0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#20 doActivate<false>(QObject*, int, void**) (sender=0x557af798d620, signal_index=3, argv=0x7ffcfaf1b250) at kernel/qobject.cpp:3925
#21 0x00007f0d0df1e0af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x557af798d620, m=m@entry=0x7f0d0f597280 <KConfigDialogManager::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0)
    at kernel/qobject.cpp:3985
#22 0x00007f0d0f5632c0 in KConfigDialogManager::settingsChanged() (this=this@entry=0x557af798d620) at /usr/src/debug/kconfigwidgets-5.112.0/build/src/KF5ConfigWidgets_autogen/include/moc_kconfigdialogmanager.cpp:182
#23 0x00007f0d0f56b11a in KConfigDialogManager::updateSettings() (this=0x557af798d620) at /usr/src/debug/kconfigwidgets-5.112.0/src/kconfigdialogmanager.cpp:399
#24 0x00007f0d0df25442 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffcfaf1b420, r=0x557af798d620, this=0x557af7877ae0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#25 doActivate<false>(QObject*, int, void**) (sender=0x557af7a5e260, signal_index=9, argv=0x7ffcfaf1b420) at kernel/qobject.cpp:3925
#26 0x00007f0d0df1e0af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x557af7a5e260, m=m@entry=0x7f0d0f0c0280, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7ffcfaf1b420) at kernel/qobject.cpp:3985
#27 0x00007f0d0ec96ae2 in QAbstractButton::clicked(bool) (this=this@entry=0x557af7a5e260, _t1=<optimized out>) at .moc/moc_qabstractbutton.cpp:308
#28 0x00007f0d0ec96d4a in QAbstractButtonPrivate::emitClicked() (this=0x557af7902bb0) at widgets/qabstractbutton.cpp:416
#29 0x00007f0d0ec98587 in QAbstractButtonPrivate::click() (this=0x557af7902bb0) at widgets/qabstractbutton.cpp:409
#30 0x00007f0d0ec98797 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) (this=0x557af7a5e260, e=0x7ffcfaf1b9b0) at widgets/qabstractbutton.cpp:1045
#31 0x00007f0d0ebe6d58 in QWidget::event(QEvent*) (this=0x557af7a5e260, event=0x7ffcfaf1b9b0) at kernel/qwidget.cpp:9045
#32 0x00007f0d0eba519e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x557af7110120, receiver=receiver@entry=0x557af7a5e260, e=e@entry=0x7ffcfaf1b9b0) at kernel/qapplication.cpp:3640
#33 0x00007f0d0ebad5cf in QApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=<optimized out>, e=0x7ffcfaf1b9b0) at kernel/qapplication.cpp:3084
#34 0x00007f0d0deed198 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x557af7a5e260, event=0x7ffcfaf1b9b0) at kernel/qcoreapplication.cpp:1064
#35 0x00007f0d0deed36e in QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#36 0x00007f0d0ebab92e in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool)
    (receiver=receiver@entry=0x557af7a5e260, event=event@entry=0x7ffcfaf1b9b0, alienWidget=<optimized out>, nativeWidget=0x557af793c270, buttonDown=buttonDown@entry=0x7f0d0f0f2330 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
    at kernel/qapplication.cpp:2622
#37 0x00007f0d0ebff7ed in QWidgetWindow::handleMouseEvent(QMouseEvent*) (this=this@entry=0x557af7ac8fd0, event=event@entry=0x7ffcfaf1bc60) at kernel/qwidgetwindow.cpp:684
#38 0x00007f0d0ec02d0f in QWidgetWindow::event(QEvent*) (this=0x557af7ac8fd0, event=0x7ffcfaf1bc60) at kernel/qwidgetwindow.cpp:300
#39 0x00007f0d0eba519e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x557af7ac8fd0, e=0x7ffcfaf1bc60) at kernel/qapplication.cpp:3640
#40 0x00007f0d0deed198 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x557af7ac8fd0, event=0x7ffcfaf1bc60) at kernel/qcoreapplication.cpp:1064
#41 0x00007f0d0deed36e in QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#42 0x00007f0d0e37d0db in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (e=0x7f0cfc002440) at kernel/qguiapplication.cpp:2285
#43 0x00007f0d0e35038c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#44 0x00007f0d0bd617b0 in userEventSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at qeventdispatcher_glib.cpp:74
#45 0x00007f0d0c513f30 in g_main_dispatch (context=0x7f0d04000ec0) at ../glib/gmain.c:3476
#46 g_main_context_dispatch_unlocked (context=context@entry=0x7f0d04000ec0) at ../glib/gmain.c:4284
#47 0x00007f0d0c515b58 in g_main_context_iterate_unlocked (context=context@entry=0x7f0d04000ec0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4349
#48 0x00007f0d0c51620c in g_main_context_iteration (context=0x7f0d04000ec0, may_block=1) at ../glib/gmain.c:4414
#49 0x00007f0d0df460d6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x557af714d030, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#50 0x00007f0d0deebc2b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffcfaf1bf90, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#51 0x00007f0d0def40c0 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#52 0x00007f0d0e37057c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#53 0x00007f0d0eba5115 in QApplication::exec() () at kernel/qapplication.cpp:2832
#54 0x0000557af698901e in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/okular-23.08.3/shell/main.cpp:109
```


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20231202
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.6.3-1-default (64-bit)
Graphics Platform: Wayland
Comment 1 postix 2023-12-07 14:52:23 UTC
bt full

```
#0  0x00007f0d0d4832fd in __GI_rewind (fp=0x0) at rewind.c:34
        _IO_acquire_lock_file = 0x0
#1  0x00007f0ccc1cf318 in Markdown::Converter::convertOpenFile() (this=this@entry=0x557af7b33580) at /usr/src/debug/okular-23.08.3/generators/markdown/converter.cpp:80
        markdownHandle = <optimized out>
        flags = <optimized out>
        htmlDocument = 0x7f0d0e444809 <QFont::operator!=(QFont const&) const+9> "H\203\304\b\203\360\001Ðff.\017\037\204"
        size = <optimized out>
        html = {d = 0x0}
        textDocument = <optimized out>
        frameFormat = {<QTextFormat> = {d = {d = 0x557af79a04c0}, format_type = -201740946}, <No data fields>}
        rootFrame = <optimized out>
#2  0x00007f0ccc1cfaad in Markdown::Converter::convertAgain() (this=0x557af7b33580) at /usr/src/debug/okular-23.08.3/generators/markdown/converter.cpp:75
        c = 0x557af7b33580
        textDocumentGeneratorChangedConfig = <optimized out>
#3  MarkdownGenerator::reparseConfig() (this=0x557af76a9660) at /usr/src/debug/okular-23.08.3/generators/markdown/generator_md.cpp:41
        c = 0x557af7b33580
        textDocumentGeneratorChangedConfig = <optimized out>
#4  0x00007f0cf3f85fea in Okular::DocumentPrivate::slotGeneratorConfigChanged() (this=0x557af72df3e0) at /usr/src/debug/okular-23.08.3/core/document.cpp:1567
        it_changed = <optimized out>
        iface = <optimized out>
        configchanged = false
        it = {i = 0x557af7a07000}
        itEnd = {i = 0x557af7918cb0}
        this = <optimized out>
#5  Okular::DocumentPrivate::slotGeneratorConfigChanged() (this=0x557af72df3e0) at /usr/src/debug/okular-23.08.3/core/document.cpp:1555
        this = <optimized out>
#6  operator() (__closure=<optimized out>) at /usr/src/debug/okular-23.08.3/core/document.cpp:4724
        this = <optimized out>
#7  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Okular::Document::fillConfigDialog(KConfigDialog*)::<lambda()> >::call (arg=<optimized out>, f=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:146
#8  QtPrivate::Functor<Okular::Document::fillConfigDialog(KConfigDialog*)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:256
#9  QtPrivate::QFunctorSlotObject<Okular::Document::fillConfigDialog(KConfigDialog*)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *)
    (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:443
#10 0x00007f0d0df25442 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffcfaf1b170, r=0x557af7369780, this=0x557af7ac8350) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
        receiver = 0x557af7369780
        td = <optimized out>
        senderData = {previous = 0x0, receiver = 0x557af7369780, sender = 0x557af793c270, signal = 13}
        c = 0x557af7ac8f70
        connections = {d = 0x557af798eea0}
        list = <optimized out>
        inSenderThread = <optimized out>
        highestConnectionId = 5
        signalVector = <optimized out>
        currentThreadId = 0x7f0d0afaaa00
        sp = <optimized out>
        signal_spy_set = 0x0
        empty_argv = {0x0}
        senderDeleted = false
#11 doActivate<false>(QObject*, int, void**) (sender=0x557af793c270, signal_index=13, argv=0x7ffcfaf1b170) at kernel/qobject.cpp:3925
        receiver = 0x557af7369780
        td = <optimized out>
        senderData = {previous = 0x0, receiver = 0x557af7369780, sender = 0x557af793c270, signal = 13}
        c = 0x557af7ac8f70
        connections = {d = 0x557af798eea0}
        list = <optimized out>
        inSenderThread = <optimized out>
        highestConnectionId = 5
        signalVector = <optimized out>
        currentThreadId = 0x7f0d0afaaa00
        sp = <optimized out>
        signal_spy_set = 0x0
        empty_argv = {0x0}
        senderDeleted = false
#12 0x00007f0d0df1e0af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x557af793c270, m=m@entry=0x7f0d0f597240 <KConfigDialog::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffcfaf1b170)
    at kernel/qobject.cpp:3985
#13 0x00007f0d0f563325 in KConfigDialog::settingsChanged(QString const&) (this=this@entry=0x557af793c270, _t1=...) at /usr/src/debug/kconfigwidgets-5.112.0/build/src/KF5ConfigWidgets_autogen/include/moc_kconfigdialog.cpp:208
        _a = {0x0, 0x7ffcfaf1b1a0}
```
Comment 2 Bug Janitor Service 2023-12-07 15:28:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/856
Comment 3 Albert Astals Cid 2023-12-07 15:35:54 UTC
Git commit d1838d3a97efa681274c7f323d72c1c194e184bb by Albert Astals Cid.
Committed on 07/12/2023 at 16:28.
Pushed by sune into branch 'master'.

markdown: Don't try re-converting a document if there's none

M  +4    -2    generators/markdown/generator_md.cpp

https://invent.kde.org/graphics/okular/-/commit/d1838d3a97efa681274c7f323d72c1c194e184bb
Comment 4 postix 2023-12-07 15:37:05 UTC
That was fast. Thanks! :)