Bug 497744 - Opening the Preview Options dialog, closing it, then reopening it causes the app to crash
Summary: Opening the Preview Options dialog, closing it, then reopening it causes the ...
Status: RESOLVED FIXED
Alias: None
Product: ghostwriter
Classification: Applications
Component: general (show other bugs)
Version: 24.12.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: megan.conkle
URL:
Keywords:
: 502211 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-12-21 10:28 UTC by Relma
Modified: 2025-04-18 20:03 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Relma 2024-12-21 10:28:53 UTC
SUMMARY
Opening Preview Options causes app to crash after reopening

STEPS TO REPRODUCE
1. Open Settings > Preview Options
2. Close it 
3. Reopen Preview Options
4. App crashes

OBSERVED RESULT
App Crashes with Segfault, command line output shown here:
```
[     0.262 355947 ghostwriter ] INFO      Backup files will be stored in "/home/yourusername/.local/share/ghostwriter/backups/"
[     0.262 355947 ghostwriter ] WARNING   Command "pandoc" is not available.
[     0.263 355947 ghostwriter ] WARNING   Command "multimarkdown" is not available.
[     0.263 355947 ghostwriter ] WARNING   Command "cmark" is not available.
[2]    355947 segmentation fault (core dumped)  ghostwriter
```

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS Linux
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Comment 1 John Kizer 2024-12-30 06:03:56 UTC
I can reproduce this on my Fedora KDE 41 system. Of note, my system did apparently have the commands that were being looked for on startup, but crashed in the same situation:

[     0.106 146620 ghostwriter ] INFO      Using pandoc version 3.1.11.1
[     0.107 146620 ghostwriter ] INFO      Using multimarkdown version 6.7.0
[     0.107 146620 ghostwriter ] INFO      Using cmark version 0.30.3

Backtrace from my system:
#0  0x00007f99f3e86515 in QWidget::testAttribute_helper (this=0x55fc453ed470, attribute=attribute@entry=Qt::WA_DeleteOnClose)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qwidget.cpp:11568
#1  0x00007f99f3e944bf in QWidget::testAttribute (this=0x55fc453ed470, attribute=Qt::WA_DeleteOnClose)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qwidget.h:915
#2  QWidget::setAttribute (this=0x55fc453ed470, attribute=Qt::WA_DeleteOnClose, on=true)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qwidget.cpp:11362
#3  0x000055fc1ad40b52 in ghostwriter::MainWindow::showPreviewOptions (this=<optimized out>)
    at /usr/src/debug/ghostwriter-24.12.0-1.fc41.x86_64/src/mainwindow.cpp:583
#4  0x00007f99f2d5b601 in QtPrivate::QSlotObjectBase::call (this=0x55fc45bc3ac0, r=<optimized out>, a=0x7ffdadd7b6b0)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/kernel/qobjectdefs_impl.h:486
#5  doActivate<false> (sender=0x55fc454f3f00, signal_index=7, argv=0x7ffdadd7b6b0)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/kernel/qobject.cpp:4124
#6  0x00007f99f2d51c07 in QMetaObject::activate
    (sender=sender@entry=0x55fc454f3f00, m=m@entry=0x7f99f3dab240, local_signal_index=local_signal_index@entry=4, argv=argv@entry=0x7ffdadd7b6b0)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/kernel/qobject.cpp:4184
#7  0x00007f99f397a5d4 in QAction::triggered (this=this@entry=0x55fc454f3f00, _t1=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/redhat-linux-build/src/gui/Gui_autogen/include/moc_qaction.cpp:479
#8  0x00007f99f397d7ef in QAction::activate (this=0x55fc454f3f00, event=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/gui/kernel/qaction.cpp:1104
#9  0x00007f99f403b314 in QMenuPrivate::activateCausedStack
    (this=0x55fc45ba46e0, causedStack=QList<QPointer<QWidget>> (size = 1) = {...}, action=0x55fc454f3f00, action_e=QAction::Trigger, self=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/widgets/qmenu.cpp:1420
#10 0x00007f99f4043f70 in QMenuPrivate::activateAction (this=0x55fc45ba46e0, action=0x55fc454f3f00, action_e=QAction::Trigger, self=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/widgets/qmenu.cpp:1502
#11 0x00007f99f3ea3698 in QWidget::event (this=0x55fc45ba46b0, event=0x7ffdadd7bd80)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qwidget.cpp:9345
#12 0x00007f99f3e3d678 in QApplicationPrivate::notify_helper
    (this=this@entry=0x55fc44d20260, receiver=receiver@entry=0x55fc45ba46b0, e=e@entry=0x7ffdadd7bd80)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qapplication.cpp:3296
#13 0x00007f99f3e4893b in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7ffdadd7bd80)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qapplication.cpp:2774
#14 0x00007f99f2cf33f8 in QCoreApplication::notifyInternal2 (receiver=0x55fc45ba46b0, event=0x7ffdadd7bd80)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/kernel/qcoreapplication.cpp:1168
#15 0x00007f99f2cf365d in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/kernel/qcoreapplication.cpp:1626
#16 0x00007f99f3e46eec in QApplicationPrivate::sendMouseEvent
    (receiver=0x55fc45ba46b0, event=event@entry=0x7ffdadd7bd80, alienWidget=<optimized out>, nativeWidget=0x55fc45ba46b0, buttonDown=buttonDown@entry=0x7f99f45d1950 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qapplication.cpp:2355
#17 0x00007f99f3eb8992 in QWidgetWindow::handleMouseEvent (this=0x55fc4644f2d0, event=event@entry=0x7ffdadd7c030)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qwidgetwindow.cpp:575
#18 0x00007f99f3ebaf00 in QWidgetWindow::event (this=0x55fc4644f2d0, event=0x7ffdadd7c030)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qwidgetwindow.cpp:299
#19 0x00007f99f3e3d678 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55fc4644f2d0, e=0x7ffdadd7c030)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qapplication.cpp:3296
#20 0x00007f99f2cf33f8 in QCoreApplication::notifyInternal2 (receiver=0x55fc4644f2d0, event=0x7ffdadd7c030)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/kernel/qcoreapplication.cpp:1168
#21 0x00007f99f2cf365d in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/kernel/qcoreapplication.cpp:1626
#22 0x00007f99f34e9ba9 in QGuiApplicationPrivate::processMouseEvent (e=0x7f99bc001950)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/gui/kernel/qguiapplication.cpp:2461
#23 0x00007f99f3551fdc in QWindowSystemInterface::sendWindowSystemEvents (flags=...)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/gui/kernel/qwindowsysteminterface.cpp:1114
#24 0x00007f99f3aba3d4 in userEventSourceDispatch (source=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/gui/platform/unix/qeventdispatcher_glib.cpp:38
#25 0x00007f99f132228c in g_main_dispatch (context=0x7f99c4000f30) at ../glib/gmain.c:3357
#26 g_main_context_dispatch_unlocked (context=0x7f99c4000f30) at ../glib/gmain.c:4208
#27 0x00007f99f13827b8 in g_main_context_iterate_unlocked.isra.0
    (context=context@entry=0x7f99c4000f30, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4273
#28 0x00007f99f1323783 in g_main_context_iteration (context=0x7f99c4000f30, may_block=1) at ../glib/gmain.c:4338
#29 0x00007f99f2fed233 in QEventDispatcherGlib::processEvents (this=0x55fc44dd2f80, flags=...)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#30 0x00007f99f2d01c3b in QEventLoop::exec (this=this@entry=0x7ffdadd7c4d0, flags=..., flags@entry=...)
    at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/global/qflags.h:34
#31 0x00007f99f2cfd3ee in QCoreApplication::exec () at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/corelib/global/qflags.h:74
#32 0x00007f99f34d6bfd in QGuiApplication::exec () at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/gui/kernel/qguiapplication.cpp:1975
#33 0x00007f99f3e3d5e9 in QApplication::exec () at /usr/src/debug/qt6-qtbase-6.8.1-7.fc41.x86_64/src/widgets/kernel/qapplication.cpp:2564
#34 0x000055fc1acea652 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/ghostwriter-24.12.0-1.fc41.x86_64/src/appmain.cpp:182
Comment 2 Martin Brodbeck 2025-01-29 09:29:27 UTC
I can confirm this bug with ghostwriter 24.12.01

Operating System: Arch Linux 
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.12.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 3 John Kizer 2025-04-10 17:26:01 UTC
*** Bug 502211 has been marked as a duplicate of this bug. ***
Comment 4 megan.conkle 2025-04-18 20:03:56 UTC
Git commit 02511821a840659197aee2504fe74b25fec9bc9f by Megan Conkle.
Committed on 18/04/2025 at 20:01.
Pushed by wereturtle into branch 'master'.

Fix crash on opening preview options dialog twice.

Preview options dialog was a static local object that had delete
on close set.  Made it a normal local variable so that delete on
close did not destroy the object for the second attempt to open
the dialog.

M  +2    -2    src/mainwindow.cpp

https://invent.kde.org/office/ghostwriter/-/commit/02511821a840659197aee2504fe74b25fec9bc9f