Bug 447363 - Kile crashes in Okular::Page::formFields() when rapidly switching between tabs using the keyboard shortcut
Summary: Kile crashes in Okular::Page::formFields() when rapidly switching between tab...
Status: REPORTED
Alias: None
Product: kile
Classification: Applications
Component: general (show other bugs)
Version: master
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2021-12-22 00:50 UTC by Nate Graham
Modified: 2024-03-05 15:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (6.22 KB, text/plain)
2023-04-19 15:20 UTC, Ethan Nguyen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2021-12-22 00:50:40 UTC
Application: kile (2.9.93)
 (Compiled from sources)
Qt Version: 5.15.2
Frameworks Version: 5.90.0
Operating System: Linux 5.15.7-200.fc35.x86_64 x86_64
Windowing System: Wayland
Distribution: Fedora Linux 35 (KDE Plasma)
DrKonqi: 5.23.80 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:

Rapidly switching between open tabs using the keyboard shortcut (Alt+arrows by default)

The crash can be reproduced every time.

-- Backtrace:
Application: Kile (kile), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = 0x0}
[KCrash Handler]
#5  QLinkedList<Okular::FormField*>::QLinkedList (l=<error reading variable: Cannot access memory at address 0x0>, this=0x7ffd5bd86768, this@entry=0x7f2ebf13a59e <QWidget::setPalette(QPalette const&)+126>) at /usr/include/qt5/QtCore/qlinkedlist.h:99
#6  Okular::Page::formFields (this=0x0) at /home/nate/kde/src/okular/core/page.cpp:514
#7  0x00007f2ea89a8f29 in SignatureGuiUtils::getSignatureFormFields (doc=<optimized out>, allPages=allPages@entry=true, pageNum=pageNum@entry=-1) at /home/nate/kde/src/okular/part/signatureguiutils.cpp:23
#8  0x00007f2ea89aca83 in SignaturePanel::notifySetup (setupFlags=<optimized out>, this=0x8c24920) at /home/nate/kde/src/okular/part/signaturepanel.cpp:114
#9  SignaturePanel::notifySetup (this=0x8c24920, setupFlags=<optimized out>) at /home/nate/kde/src/okular/part/signaturepanel.cpp:108
#10 0x00007f2ea87bd10a in Okular::Document::closeDocument (this=0x8a31a00) at /home/nate/kde/src/okular/core/document.cpp:2558
#11 Okular::Document::closeDocument (this=0x8a31a00) at /home/nate/kde/src/okular/core/document.cpp:2486
#12 0x00007f2ea88f0384 in Okular::Part::closeUrl (this=0x8a11590, promptToSave=<optimized out>) at /home/nate/kde/src/okular/part/part.cpp:1894
#13 0x00007f2ec0ff3907 in KileTool::LivePreviewManager::clearLivePreview (this=0xa394130) at /home/nate/kde/src/kile/src/livepreview.cpp:362
#14 0x00007f2ec0ffa5f0 in KileTool::LivePreviewManager::handleTextViewActivated (this=0xa394130, view=0xa727240, clearPreview=<optimized out>, forceCompilation=<optimized out>) at /home/nate/kde/src/kile/src/livepreview.cpp:1087
#15 0x00007f2ebe663430 in doActivate<false> (sender=0x8a21540, signal_index=6, argv=0x7ffd5bd86a30) at kernel/qobject.cpp:3898
#16 0x00007f2ebe65e367 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f2ec11856a0 <KileView::Manager::staticMetaObject>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0x7ffd5bd86a30) at kernel/qobject.cpp:3946
#17 0x00007f2ec0e3f3d2 in KileView::Manager::textViewActivated (this=<optimized out>, _t1=<optimized out>) at /home/nate/kde/build/kile/src/kdeinit_kile_autogen/EWIEGA46WW/moc_kileviewmanager.cpp:740
#18 0x00007f2ebe6633e9 in QtPrivate::QSlotObjectBase::call (a=0x7ffd5bd86b40, r=<optimized out>, this=0xa175730) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#19 doActivate<false> (sender=0xa172460, signal_index=7, argv=0x7ffd5bd86b40) at kernel/qobject.cpp:3886
#20 0x00007f2ebe65e367 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f2ebf63c4e0 <QTabBar::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd5bd86b40) at kernel/qobject.cpp:3946
#21 0x00007f2ebf2c2092 in QTabBar::currentChanged (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qtabbar.cpp:338
#22 0x00007f2ebe6633e9 in QtPrivate::QSlotObjectBase::call (a=0x7ffd5bd86c60, r=<optimized out>, this=0xa3bc3c0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#23 doActivate<false> (sender=0xa3bc740, signal_index=4, argv=0x7ffd5bd86c60) at kernel/qobject.cpp:3886
#24 0x00007f2ebe65e367 in QMetaObject::activate (sender=sender@entry=0xa3bc740, m=m@entry=0x7f2ebf62b260 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffd5bd86c60) at kernel/qobject.cpp:3946
#25 0x00007f2ebf0fd916 in QAction::triggered (this=this@entry=0xa3bc740, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#26 0x00007f2ebf10062c in QAction::activate (this=0xa3bc740, event=<optimized out>) at kernel/qaction.cpp:1161
#27 0x00007f2ebf101217 in QAction::event (e=<optimized out>, this=<optimized out>) at kernel/qaction.cpp:1086
#28 QAction::event (this=<optimized out>, e=<optimized out>) at kernel/qaction.cpp:1075
#29 0x00007f2ebf104443 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0xa3bc740, e=0x7ffd5bd86e10) at kernel/qapplication.cpp:3632
#30 0x00007f2ebe62f7d8 in QCoreApplication::notifyInternal2 (receiver=0xa3bc740, event=0x7ffd5bd86e10) at kernel/qcoreapplication.cpp:1064
#31 0x00007f2ebeaacf32 in QShortcutMap::dispatchEvent (this=<optimized out>, e=<optimized out>) at kernel/qshortcutmap.cpp:675
#32 0x00007f2ebeaad5a3 in QShortcutMap::tryShortcut (this=this@entry=0x1bc6118, e=e@entry=0x7ffd5bd86ed0) at kernel/qshortcutmap.cpp:343
#33 0x00007f2ebea640a7 in QWindowSystemInterface::handleShortcutEvent (window=0x7ffd5bd86ed0, timestamp=82073576, keyCode=16777239, modifiers=..., nativeScanCode=117, nativeVirtualKey=65366, nativeModifiers=4, text=..., autorepeat=true, count=1) at kernel/qwindowsysteminterface.cpp:477
#34 0x00007f2ebea7d50f in QGuiApplicationPrivate::processKeyEvent (e=0xf58a590) at kernel/qguiapplication.cpp:2388
#35 0x00007f2ebea60c9c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#36 0x00007f2ebce43684 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5WaylandClient.so.5
#37 0x00007f2ebc3f3130 in g_main_dispatch (context=0x1bd77d0) at ../glib/gmain.c:3381
#38 g_main_context_dispatch (context=0x1bd77d0) at ../glib/gmain.c:4099
#39 0x00007f2ebc448208 in g_main_context_iterate.constprop.0 (context=context@entry=0x1bd77d0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#40 0x00007f2ebc3f0933 in g_main_context_iteration (context=0x1bd77d0, may_block=1) at ../glib/gmain.c:4240
#41 0x00007f2ebe680bb8 in QEventDispatcherGlib::processEvents (this=0x1c0e300, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#42 0x00007f2ebe62e1e2 in QEventLoop::exec (this=this@entry=0x7ffd5bd87280, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#43 0x00007f2ea87bb791 in Okular::DocumentPrivate::clearAndWaitForRequests (this=0x1bc3920) at /usr/include/qt5/QtCore/qflags.h:121
#44 0x00007f2ea87bcd25 in Okular::Document::closeDocument (this=0x8a31a00) at /home/nate/kde/src/okular/core/document.cpp:2501
#45 Okular::Document::closeDocument (this=0x8a31a00) at /home/nate/kde/src/okular/core/document.cpp:2486
#46 0x00007f2ea88f0384 in Okular::Part::closeUrl (this=0x8a11590, promptToSave=<optimized out>) at /home/nate/kde/src/okular/part/part.cpp:1894
#47 0x00007f2ec0ff3907 in KileTool::LivePreviewManager::clearLivePreview (this=0xa394130) at /home/nate/kde/src/kile/src/livepreview.cpp:362
#48 0x00007f2ec0ffa5f0 in KileTool::LivePreviewManager::handleTextViewActivated (this=0xa394130, view=0xa93b550, clearPreview=<optimized out>, forceCompilation=<optimized out>) at /home/nate/kde/src/kile/src/livepreview.cpp:1087
#49 0x00007f2ebe663430 in doActivate<false> (sender=0x8a21540, signal_index=6, argv=0x7ffd5bd87520) at kernel/qobject.cpp:3898
#50 0x00007f2ebe65e367 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f2ec11856a0 <KileView::Manager::staticMetaObject>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0x7ffd5bd87520) at kernel/qobject.cpp:3946
#51 0x00007f2ec0e3f3d2 in KileView::Manager::textViewActivated (this=<optimized out>, _t1=<optimized out>) at /home/nate/kde/build/kile/src/kdeinit_kile_autogen/EWIEGA46WW/moc_kileviewmanager.cpp:740
#52 0x00007f2ebe6633e9 in QtPrivate::QSlotObjectBase::call (a=0x7ffd5bd87630, r=<optimized out>, this=0xa175730) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#53 doActivate<false> (sender=0xa172460, signal_index=7, argv=0x7ffd5bd87630) at kernel/qobject.cpp:3886
#54 0x00007f2ebe65e367 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f2ebf63c4e0 <QTabBar::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd5bd87630) at kernel/qobject.cpp:3946
#55 0x00007f2ebf2c2092 in QTabBar::currentChanged (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qtabbar.cpp:338
#56 0x00007f2ebe6633e9 in QtPrivate::QSlotObjectBase::call (a=0x7ffd5bd87750, r=<optimized out>, this=0xa3bc3c0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#57 doActivate<false> (sender=0xa3bc740, signal_index=4, argv=0x7ffd5bd87750) at kernel/qobject.cpp:3886
#58 0x00007f2ebe65e367 in QMetaObject::activate (sender=sender@entry=0xa3bc740, m=m@entry=0x7f2ebf62b260 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffd5bd87750) at kernel/qobject.cpp:3946
#59 0x00007f2ebf0fd916 in QAction::triggered (this=this@entry=0xa3bc740, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#60 0x00007f2ebf10062c in QAction::activate (this=0xa3bc740, event=<optimized out>) at kernel/qaction.cpp:1161
#61 0x00007f2ebf101217 in QAction::event (e=<optimized out>, this=<optimized out>) at kernel/qaction.cpp:1086
#62 QAction::event (this=<optimized out>, e=<optimized out>) at kernel/qaction.cpp:1075
#63 0x00007f2ebf104443 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0xa3bc740, e=0x7ffd5bd87900) at kernel/qapplication.cpp:3632
#64 0x00007f2ebe62f7d8 in QCoreApplication::notifyInternal2 (receiver=0xa3bc740, event=0x7ffd5bd87900) at kernel/qcoreapplication.cpp:1064
#65 0x00007f2ebeaacf32 in QShortcutMap::dispatchEvent (this=<optimized out>, e=<optimized out>) at kernel/qshortcutmap.cpp:675
#66 0x00007f2ebeaad5a3 in QShortcutMap::tryShortcut (this=this@entry=0x1bc6118, e=e@entry=0x7ffd5bd879c0) at kernel/qshortcutmap.cpp:343
#67 0x00007f2ebea640a7 in QWindowSystemInterface::handleShortcutEvent (window=0x7ffd5bd879c0, timestamp=82073576, keyCode=16777239, modifiers=..., nativeScanCode=117, nativeVirtualKey=65366, nativeModifiers=4, text=..., autorepeat=true, count=1) at kernel/qwindowsysteminterface.cpp:477
#68 0x00007f2ebea7d50f in QGuiApplicationPrivate::processKeyEvent (e=0xf520fa0) at kernel/qguiapplication.cpp:2388
#69 0x00007f2ebea60c9c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#70 0x00007f2ebce43684 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5WaylandClient.so.5
#71 0x00007f2ebc3f3130 in g_main_dispatch (context=0x1bd77d0) at ../glib/gmain.c:3381
#72 g_main_context_dispatch (context=0x1bd77d0) at ../glib/gmain.c:4099
#73 0x00007f2ebc448208 in g_main_context_iterate.constprop.0 (context=context@entry=0x1bd77d0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#74 0x00007f2ebc3f0933 in g_main_context_iteration (context=0x1bd77d0, may_block=1) at ../glib/gmain.c:4240
#75 0x00007f2ebe680bb8 in QEventDispatcherGlib::processEvents (this=0x1c0e300, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#76 0x00007f2ebe62e1e2 in QEventLoop::exec (this=this@entry=0x7ffd5bd87d70, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#77 0x00007f2ea87bb791 in Okular::DocumentPrivate::clearAndWaitForRequests (this=0x1bc3920) at /usr/include/qt5/QtCore/qflags.h:121
#78 0x00007f2ea87bcd25 in Okular::Document::closeDocument (this=0x8a31a00) at /home/nate/kde/src/okular/core/document.cpp:2501
#79 Okular::Document::closeDocument (this=0x8a31a00) at /home/nate/kde/src/okular/core/document.cpp:2486
#80 0x00007f2ea88f0384 in Okular::Part::closeUrl (this=0x8a11590, promptToSave=<optimized out>) at /home/nate/kde/src/okular/part/part.cpp:1894
#81 0x00007f2ec0ff3907 in KileTool::LivePreviewManager::clearLivePreview (this=0xa394130) at /home/nate/kde/src/kile/src/livepreview.cpp:362
#82 0x00007f2ec0ffa5f0 in KileTool::LivePreviewManager::handleTextViewActivated (this=0xa394130, view=0xa727240, clearPreview=<optimized out>, forceCompilation=<optimized out>) at /home/nate/kde/src/kile/src/livepreview.cpp:1087
#83 0x00007f2ebe663430 in doActivate<false> (sender=0x8a21540, signal_index=6, argv=0x7ffd5bd88010) at kernel/qobject.cpp:3898
#84 0x00007f2ebe65e367 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f2ec11856a0 <KileView::Manager::staticMetaObject>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0x7ffd5bd88010) at kernel/qobject.cpp:3946
#85 0x00007f2ec0e3f3d2 in KileView::Manager::textViewActivated (this=<optimized out>, _t1=<optimized out>) at /home/nate/kde/build/kile/src/kdeinit_kile_autogen/EWIEGA46WW/moc_kileviewmanager.cpp:740
#86 0x00007f2ebe6633e9 in QtPrivate::QSlotObjectBase::call (a=0x7ffd5bd88120, r=<optimized out>, this=0xa175730) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#87 doActivate<false> (sender=0xa172460, signal_index=7, argv=0x7ffd5bd88120) at kernel/qobject.cpp:3886
#88 0x00007f2ebe65e367 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f2ebf63c4e0 <QTabBar::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd5bd88120) at kernel/qobject.cpp:3946
#89 0x00007f2ebf2c2092 in QTabBar::currentChanged (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qtabbar.cpp:338
#90 0x00007f2ebe6633e9 in QtPrivate::QSlotObjectBase::call (a=0x7ffd5bd88240, r=<optimized out>, this=0xa3bc3c0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#91 doActivate<false> (sender=0xa3bc740, signal_index=4, argv=0x7ffd5bd88240) at kernel/qobject.cpp:3886
#92 0x00007f2ebe65e367 in QMetaObject::activate (sender=sender@entry=0xa3bc740, m=m@entry=0x7f2ebf62b260 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffd5bd88240) at kernel/qobject.cpp:3946
#93 0x00007f2ebf0fd916 in QAction::triggered (this=this@entry=0xa3bc740, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#94 0x00007f2ebf10062c in QAction::activate (this=0xa3bc740, event=<optimized out>) at kernel/qaction.cpp:1161
#95 0x00007f2ebf101217 in QAction::event (e=<optimized out>, this=<optimized out>) at kernel/qaction.cpp:1086
#96 QAction::event (this=<optimized out>, e=<optimized out>) at kernel/qaction.cpp:1075
#97 0x00007f2ebf104443 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0xa3bc740, e=0x7ffd5bd883f0) at kernel/qapplication.cpp:3632
#98 0x00007f2ebe62f7d8 in QCoreApplication::notifyInternal2 (receiver=0xa3bc740, event=0x7ffd5bd883f0) at kernel/qcoreapplication.cpp:1064
#99 0x00007f2ebeaacf32 in QShortcutMap::dispatchEvent (this=<optimized out>, e=<optimized out>) at kernel/qshortcutmap.cpp:675
#100 0x00007f2ebeaad5a3 in QShortcutMap::tryShortcut (this=this@entry=0x1bc6118, e=e@entry=0x7ffd5bd884b0) at kernel/qshortcutmap.cpp:343
#101 0x00007f2ebea640a7 in QWindowSystemInterface::handleShortcutEvent (window=0x7ffd5bd884b0, timestamp=82073576, keyCode=16777239, modifiers=..., nativeScanCode=117, nativeVirtualKey=65366, nativeModifiers=4, text=..., autorepeat=true, count=1) at kernel/qwindowsysteminterface.cpp:477
#102 0x00007f2ebea7d50f in QGuiApplicationPrivate::processKeyEvent (e=0xabd8290) at kernel/qguiapplication.cpp:2388
#103 0x00007f2ebea60c9c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#104 0x00007f2ebce43684 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5WaylandClient.so.5
#105 0x00007f2ebc3f3130 in g_main_dispatch (context=0x1bd77d0) at ../glib/gmain.c:3381
#106 g_main_context_dispatch (context=0x1bd77d0) at ../glib/gmain.c:4099
#107 0x00007f2ebc448208 in g_main_context_iterate.constprop.0 (context=context@entry=0x1bd77d0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#108 0x00007f2ebc3f0933 in g_main_context_iteration (context=0x1bd77d0, may_block=1) at ../glib/gmain.c:4240
#109 0x00007f2ebe680bb8 in QEventDispatcherGlib::processEvents (this=0x1c0e300, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#110 0x00007f2ebe62e1e2 in QEventLoop::exec (this=this@entry=0x7ffd5bd88860, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#111 0x00007f2ea87bb791 in Okular::DocumentPrivate::clearAndWaitForRequests (this=0x1bc3920) at /usr/include/qt5/QtCore/qflags.h:121
#112 0x00007f2ea87bcd25 in Okular::Document::closeDocument (this=0x8a31a00) at /home/nate/kde/src/okular/core/document.cpp:2501
#113 Okular::Document::closeDocument (this=0x8a31a00) at /home/nate/kde/src/okular/core/document.cpp:2486
#114 0x00007f2ea88f0384 in Okular::Part::closeUrl (this=0x8a11590, promptToSave=<optimized out>) at /home/nate/kde/src/okular/part/part.cpp:1894
#115 0x00007f2ec0ff3907 in KileTool::LivePreviewManager::clearLivePreview (this=0xa394130) at /home/nate/kde/src/kile/src/livepreview.cpp:362
#116 0x00007f2ec0ffa5f0 in KileTool::LivePreviewManager::handleTextViewActivated (this=0xa394130, view=0xa93b550, clearPreview=<optimized out>, forceCompilation=<optimized out>) at /home/nate/kde/src/kile/src/livepreview.cpp:1087
#117 0x00007f2ebe663430 in doActivate<false> (sender=0x8a21540, signal_index=6, argv=0x7ffd5bd88b00) at kernel/qobject.cpp:3898
#118 0x00007f2ebe65e367 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f2ec11856a0 <KileView::Manager::staticMetaObject>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0x7ffd5bd88b00) at kernel/qobject.cpp:3946
#119 0x00007f2ec0e3f3d2 in KileView::Manager::textViewActivated (this=<optimized out>, _t1=<optimized out>) at /home/nate/kde/build/kile/src/kdeinit_kile_autogen/EWIEGA46WW/moc_kileviewmanager.cpp:740
#120 0x00007f2ebe6633e9 in QtPrivate::QSlotObjectBase::call (a=0x7ffd5bd88c10, r=<optimized out>, this=0xa175730) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#121 doActivate<false> (sender=0xa172460, signal_index=7, argv=0x7ffd5bd88c10) at kernel/qobject.cpp:3886
#122 0x00007f2ebe65e367 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f2ebf63c4e0 <QTabBar::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd5bd88c10) at kernel/qobject.cpp:3946
#123 0x00007f2ebf2c2092 in QTabBar::currentChanged (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qtabbar.cpp:338
#124 0x00007f2ebe6633e9 in QtPrivate::QSlotObjectBase::call (a=0x7ffd5bd88d30, r=<optimized out>, this=0xa3bc3c0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#125 doActivate<false> (sender=0xa3bc740, signal_index=4, argv=0x7ffd5bd88d30) at kernel/qobject.cpp:3886
#126 0x00007f2ebe65e367 in QMetaObject::activate (sender=sender@entry=0xa3bc740, m=m@entry=0x7f2ebf62b260 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffd5bd88d30) at kernel/qobject.cpp:3946
#127 0x00007f2ebf0fd916 in QAction::triggered (this=this@entry=0xa3bc740, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#128 0x00007f2ebf10062c in QAction::activate (this=0xa3bc740, event=<optimized out>) at kernel/qaction.cpp:1161
#129 0x00007f2ebf101217 in QAction::event (e=<optimized out>, this=<optimized out>) at kernel/qaction.cpp:1086
#130 QAction::event (this=<optimized out>, e=<optimized out>) at kernel/qaction.cpp:1075
#131 0x00007f2ebf104443 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0xa3bc740, e=0x7ffd5bd88ee0) at kernel/qapplication.cpp:3632
#132 0x00007f2ebe62f7d8 in QCoreApplication::notifyInternal2 (receiver=0xa3bc740, event=0x7ffd5bd88ee0) at kernel/qcoreapplication.cpp:1064
#133 0x00007f2ebeaacf32 in QShortcutMap::dispatchEvent (this=<optimized out>, e=<optimized out>) at kernel/qshortcutmap.cpp:675
#134 0x00007f2ebeaad5a3 in QShortcutMap::tryShortcut (this=this@entry=0x1bc6118, e=e@entry=0x7ffd5bd88fa0) at kernel/qshortcutmap.cpp:343
#135 0x00007f2ebea640a7 in QWindowSystemInterface::handleShortcutEvent (window=0x7ffd5bd88fa0, timestamp=82073576, keyCode=16777239, modifiers=..., nativeScanCode=117, nativeVirtualKey=65366, nativeModifiers=4, text=..., autorepeat=true, count=1) at kernel/qwindowsysteminterface.cpp:477
#136 0x00007f2ebea7d50f in QGuiApplicationPrivate::processKeyEvent (e=0xff61970) at kernel/qguiapplication.cpp:2388
#137 0x00007f2ebea60c9c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#138 0x00007f2ebce43684 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5WaylandClient.so.5
#139 0x00007f2ebc3f3130 in g_main_dispatch (context=0x1bd77d0) at ../glib/gmain.c:3381
#140 g_main_context_dispatch (context=0x1bd77d0) at ../glib/gmain.c:4099
#141 0x00007f2ebc448208 in g_main_context_iterate.constprop.0 (context=context@entry=0x1bd77d0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#142 0x00007f2ebc3f0933 in g_main_context_iteration (context=0x1bd77d0, may_block=1) at ../glib/gmain.c:4240
#143 0x00007f2ebe680bb8 in QEventDispatcherGlib::processEvents (this=0x1c0e300, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#144 0x00007f2ebe62e1e2 in QEventLoop::exec (this=this@entry=0x7ffd5bd89340, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#145 0x00007f2ebe636724 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#146 0x00007f2ebea75c40 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1860
#147 0x00007f2ebf1043b9 in QApplication::exec () at kernel/qapplication.cpp:2824
#148 0x00007f2ec1000b8b in kdemain (argc=<optimized out>, argv=<optimized out>) at /home/nate/kde/src/kile/src/main.cpp:203
#149 0x00007f2ebd948560 in __libc_start_call_main (main=main@entry=0x401040 <main>, argc=argc@entry=1, argv=argv@entry=0x7ffd5bd89608) at ../sysdeps/nptl/libc_start_call_main.h:58
#150 0x00007f2ebd94860c in __libc_start_main_impl (main=0x401040 <main>, argc=1, argv=0x7ffd5bd89608, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd5bd895f8) at ../csu/libc-start.c:409
#151 0x0000000000401075 in _start ()
[Inferior 1 (process 147803) detached]

Reported using DrKonqi
Comment 1 Laura David Hurka 2021-12-22 19:03:49 UTC
How do you do that? If I do Alt+Left/Right, only the text editor tab changes. The document view changes only when I click ViewPDF or ForwardPDF. It also does not crash if I do it faster than usual on my slowbook. ;)
Comment 2 Nate Graham 2021-12-22 19:13:27 UTC
Yep. And when the text editor tab changes, the Okular-provided preview changes too.

I should note that when I reproduce this, at least one of the tabs is a simple .txt file that doesn't get rendered by the Okularpart preview. It doesn't happen when all of the tabs contain .tex files.
Comment 3 Nate Graham 2021-12-22 19:14:14 UTC
Maybe there's an "automatically reload preview" setting that I turned on ages ago. Either way, the Okularpart preview does update automatically for me when I switch tabs.
Comment 4 Albert Astals Cid 2021-12-23 22:02:54 UTC
it's re-entering the closeDocument method because you press the shortcuts faster than it takes for cancelling the running threads.

If you can reproduce this easily you need to add a bool in document that is "i am closing" and then check it first thing in closedocument, if it's already closing just return, if not set it to true and then set it to false at the end of the function.

Can you check if that helps?
Comment 5 Nate Graham 2022-02-03 02:53:38 UTC
Nope, that doesn't fix it, assuming I did it right:


diff --git core/document.cpp core/document.cpp
index b6be827f1..9a80db24f 100644
--- core/document.cpp
+++ core/document.cpp
@@ -2486,10 +2486,12 @@ KXMLGUIClient *Document::guiClient()
 
 void Document::closeDocument()
 {
-    // check if there's anything to close...
-    if (!d->m_generator)
+    // check if there's anything to close or if we are already closing...
+    if (!d->m_generator || d->m_isClosing)
         return;
 
+    d->m_isClosing = true;
+
     emit aboutToClose();
 
     delete d->m_pageController;
@@ -2639,6 +2641,7 @@ void Document::closeDocument()
     // see: https://sourceware.org/bugzilla/show_bug.cgi?id=14827
     malloc_trim(0);
 #endif
+    d->m_isClosing = false;
 }
 
 void Document::addObserver(DocumentObserver *pObserver)
diff --git core/document_p.h core/document_p.h
index bd932db37..c8c93c47a 100644
--- core/document_p.h
+++ core/document_p.h
@@ -129,6 +129,7 @@ public:
         , m_annotationBeingModified(false)
         , m_docdataMigrationNeeded(false)
         , m_synctex_scanner(nullptr)
+        , m_isClosing(false)
     {
         calculateMaxTextPages();
     }
@@ -345,6 +346,8 @@ public:
     static QVector<KPluginMetaData> availableGenerators();
     static QVector<KPluginMetaData> configurableGenerators();
     static KPluginMetaData generatorForMimeType(const QMimeType &type, QWidget *widget, const QVector<KPluginMetaData> &triedOffers = QVector<KPluginMetaData>());
+
+    bool m_isClosing;
 };
 
 class DocumentInfoPrivate
Comment 6 Albert Astals Cid 2022-02-03 13:10:12 UTC
That sounds like what i meant yes.

What backtrace do you get now? Because previously you had two closeDocument in the backtrace that now should not be possible.
Comment 7 Nate Graham 2022-02-03 14:50:15 UTC
Now this is the backtrace:

Thread 1 "kile" received signal SIGSEGV, Segmentation fault.
QMapNode<Okular::DocumentObserver const*, Okular::TilesManager*>::lowerBound (akey=<optimized out>, this=<optimized out>) at /usr/include/qt5/QtCore/qmap.h:155
155                 n = n->leftNode();
(gdb) bt
#0  QMapNode<Okular::DocumentObserver const*, Okular::TilesManager*>::lowerBound (
    akey=<optimized out>, this=<optimized out>) at /usr/include/qt5/QtCore/qmap.h:155
#1  QMapData<Okular::DocumentObserver const*, Okular::TilesManager*>::findNode (
    this=<optimized out>, this=<optimized out>, akey=<synthetic pointer>: <optimized out>)
    at /usr/include/qt5/QtCore/qmap.h:288
#2  QMap<Okular::DocumentObserver const*, Okular::TilesManager*>::value (
    adefaultValue=<optimized out>, akey=<synthetic pointer>: <optimized out>, this=<optimized out>)
    at /usr/include/qt5/QtCore/qmap.h:665
#3  Okular::PagePrivate::tilesManager (this=<optimized out>, observer=0x186f620)
    at /home/nate/kde/src/okular/core/page.cpp:996
#4  0x00007fffd2daae7f in Okular::PixmapRequestPrivate::tilesManager (this=<optimized out>)
    at /home/nate/kde/src/okular/core/generator.cpp:657
#5  0x00007fffd2d91c42 in Okular::DocumentPrivate::sendGeneratorPixmapRequest (this=0x7fffcc002c00)
    at /home/nate/kde/src/okular/core/document.cpp:1290
#6  0x00007ffff5488726 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffd220, r=<optimized out>, 
    this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#7  QSingleShotTimer::timerEvent (this=0x541ca40) at kernel/qtimer.cpp:320
#8  0x00007ffff547bedf in QObject::event (this=0x541ca40, e=0x7fffffffd370)
    at kernel/qobject.cpp:1336
#9  0x00007ffff5f26443 in QApplicationPrivate::notify_helper (this=<optimized out>, 
    receiver=0x541ca40, e=0x7fffffffd370) at kernel/qapplication.cpp:3632
#10 0x00007ffff54517d8 in QCoreApplication::notifyInternal2 (receiver=0x541ca40, 
    event=0x7fffffffd370) at kernel/qcoreapplication.cpp:1064
#11 0x00007ffff54a1ea3 in QTimerInfoList::activateTimers (this=0x469380)
    at kernel/qtimerinfo_unix.cpp:643
#12 0x00007ffff54a27ac in timerSourceDispatch (source=<optimized out>)
    at kernel/qeventdispatcher_glib.cpp:183
#13 0x00007ffff321005f in g_main_dispatch (context=0x46a7a0) at ../glib/gmain.c:3381
#14 g_main_context_dispatch (context=0x46a7a0) at ../glib/gmain.c:4099
#15 0x00007ffff3265298 in g_main_context_iterate.constprop.0 (context=context@entry=0x46a7a0, 
    block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#16 0x00007ffff320d853 in g_main_context_iteration (context=0x46a7a0, may_block=1)
    at ../glib/gmain.c:4240
#17 0x00007ffff54a2bb8 in QEventDispatcherGlib::processEvents (this=0x46ad30, flags=...)
    at kernel/qeventdispatcher_glib.cpp:423
#18 0x00007ffff54501e2 in QEventLoop::exec (this=this@entry=0x7fffffffd610, flags=..., 
    flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#19 0x00007ffff5458724 in QCoreApplication::exec ()
    at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#20 0x00007ffff5897c40 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1860
#21 0x00007ffff5f263b9 in QApplication::exec () at kernel/qapplication.cpp:2824
#22 0x00007ffff7e32c1b in kdemain (argc=<optimized out>, argv=<optimized out>)
    at /home/nate/kde/src/kile/src/main.cpp:203
#23 0x00007ffff4768560 in __libc_start_call_main (main=main@entry=0x401040 <main>, 
    argc=argc@entry=1, argv=argv@entry=0x7fffffffd8d8) at ../sysdeps/nptl/libc_start_call_main.h:58
#24 0x00007ffff476860c in __libc_start_main_impl (main=0x401040 <main>, argc=1, 
    argv=0x7fffffffd8d8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffffffd8c8) at ../csu/libc-start.c:409
#25 0x0000000000401075 in _start ()
Comment 8 Albert Astals Cid 2022-02-03 22:33:49 UTC
Not present in this second backtrace, but looking at the first one there's 4 nested calls to KileTool::LivePreviewManager::clearLivePreview. Wonder if this should actually be fixed in kile?
Comment 9 Nate Graham 2022-02-04 15:33:24 UTC
Could be, so maybe there are two bugs? One in Okular and one in Kile?
Comment 10 Albert Astals Cid 2022-02-06 22:27:20 UTC
(In reply to Nate Graham from comment #9)
> Could be, so maybe there are two bugs? One in Okular and one in Kile?

I haven't looked at it properly so i'm just throwing random facts here, but if Kile is calling Okular::Part::closeUrl again over the same object before waiting for the previous Okular::Part::closeUrl call to finish, i'd say that's a Kile bug and not an Okular bug.
Comment 11 Nate Graham 2022-02-07 16:55:53 UTC
Yes, that seems likely
Comment 12 Ethan Nguyen 2023-04-19 15:20:44 UTC
Created attachment 158215 [details]
New crash information added by DrKonqi

kile (2.9.93) using Qt 5.15.9

Rapidly scrolling between document tabls (i.e. using two-finger scroll/scrollwheel on the tabs) results in a segfault. I had autoview/autopreview enabled so it may be an issue with that?

-- Backtrace (Reduced):
#6  QHash<int, QHashDummyValue>::findNode (ahp=0x0, akey=<optimized out>, this=<error reading variable: Cannot access memory at address 0x10>) at /usr/include/qt/QtCore/qhash.h:940
#7  QHash<int, QHashDummyValue>::contains (akey=<optimized out>, this=<error reading variable: Cannot access memory at address 0x10>) at /usr/include/qt/QtCore/qhash.h:920
#8  QSet<int>::contains (value=<optimized out>, this=<optimized out>, this=<optimized out>, value=<optimized out>) at /usr/include/qt/QtCore/qset.h:97
#9  Okular::Generator::hasFeature (this=0x0, feature=Okular::Generator::SupportsCancelling) at /usr/src/debug/okular/okular-22.12.3/core/generator.cpp:427
#10 0x00007f6e07f661c5 in Okular::DocumentPrivate::clearAndWaitForRequests (this=0x55ea602ad0a0) at /usr/src/debug/okular/okular-22.12.3/core/document.cpp:2186
Comment 13 Carl Schwan 2024-03-05 15:57:22 UTC
I can't reproduce this in the Qt6 version