Bug 432327

Summary: "Bookmark all tabs as folder" crashes if a tab was closed prior
Product: [Applications] konsole Reporter: rickrods
Component: bookmarkAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: crash CC: jkt, tcanabrava
Priority: NOR    
Version: master   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 21.04
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description rickrods 2021-01-31 00:15:20 UTC
SUMMARY


STEPS TO REPRODUCE
1. Open 5 tabs and use each of them to ssh to a different server. 
2. All connect via pubkey auth. 
3. Each tab has a different profile. 
2. Set custom profiles for each tab.
3. Try to execute bookmark tabs as folder

OBSERVED RESULT
Crash
1/30/21 6:05 PM	systemd-coredump	Process 72267 (konsole) of user 1000 dumped core.

Stack trace of thread 72267:
#0  0x00007f0cc4c2018b __GI_raise (libc.so.6 + 0x4618b)
#1  0x00007f0cc46eef9b _ZN6KCrash19defaultCrashHandlerEi (libKF5Crash.so.5 + 0x4f9b)
#2  0x00007f0cc4c20210 __restore_rt (libc.so.6 + 0x46210)
#3  0x00007f0cc389df6f _ZN5QIconC1ERKS_ (libQt5Gui.so.5 + 0x1d2f6f)
#4  0x00007f0cc4acfba2 _ZNK7Konsole14ViewProperties4iconEv (libkonsoleprivate.so.21 + 0x99ba2)
#5  0x00007f0cc4aa44b1 _ZNK7Konsole15BookmarkHandler11iconForViewEPNS_14ViewPropertiesE (libkonsoleprivate.so.21 + 0x6e4b1)
#6  0x00007f0cc4aa4831 _ZNK7Konsole15BookmarkHandler19currentBookmarkListEv (libkonsoleprivate.so.21 + 0x6e831)
#7  0x00007f0cc2b56b4d _ZN13KBookmarkMenu20slotAddBookmarksListEv (libKF5Bookmarks.so.5 + 0x32b4d)
#8  0x00007f0cc50b66be n/a (libQt5Core.so.5 + 0x2ea6be)
#9  0x00007f0cc3efc8e6 _ZN7QAction9triggeredEb (libQt5Widgets.so.5 + 0x1678e6)
#10 0x00007f0cc3efefb8 _ZN7QAction8activateENS_11ActionEventE (libQt5Widgets.so.5 + 0x169fb8)
#11 0x00007f0cc40896a2 n/a (libQt5Widgets.so.5 + 0x2f46a2)
#12 0x00007f0cc4090dee n/a (libQt5Widgets.so.5 + 0x2fbdee)
#13 0x00007f0cc4092082 _ZN5QMenu17mouseReleaseEventEP11QMouseEvent (libQt5Widgets.so.5 + 0x2fd082)
#14 0x00007f0cc3f45c06 _ZN7QWidget5eventEP6QEvent (libQt5Widgets.so.5 + 0x1b0c06)
#15 0x00007f0cc409468b _ZN5QMenu5eventEP6QEvent (libQt5Widgets.so.5 + 0x2ff68b)
#16 0x00007f0cc3f02dc3 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x16ddc3)
#17 0x00007f0cc3f0be77 _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x176e77)
#18 0x00007f0cc507f69a _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5 + 0x2b369a)
#19 0x00007f0cc3f0b0a7 _ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Ebb (libQt5Widgets.so.5 + 0x1760a7)
#20 0x00007f0cc3f618ee n/a (libQt5Widgets.so.5 + 0x1cc8ee)
#21 0x00007f0cc3f64174 n/a (libQt5Widgets.so.5 + 0x1cf174)
#22 0x00007f0cc3f02dc3 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x16ddc3)
#23 0x00007f0cc3f0bbb8 _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x176bb8)
#24 0x00007f0cc507f69a _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5 + 0x2b369a)
#25 0x00007f0cc380b4e8 _ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE (libQt5Gui.so.5 + 0x1404e8)
#26 0x00007f0cc380cb55 _ZN22QGuiApplicationPrivate24processWindowSystemEventEPN29QWindowSystemInterfacePrivate17WindowSystemEventE (libQt5Gui.so.5 + 0x141b55)
#27 0x00007f0cc37e47ac _ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Gui.so.5 + 0x1197ac)
#28 0x00007f0cbea3ad7e n/a (libQt5XcbQpa.so.5 + 0x70d7e)
#29 0x00007f0cc2c2ef9d g_main_context_dispatch (libglib-2.0.so.0 + 0x51f9d)
#30 0x00007f0cc2c2f220 n/a (libglib-2.0.so.0 + 0x52220)
#31 0x00007f0cc2c2f2c3 g_main_context_iteration (libglib-2.0.so.0 + 0x522c3)
#32 0x00007f0cc50d9fa2 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x30dfa2)
#33 0x00007f0cc507e1ab _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b21ab)
#34 0x00007f0cc5086354 _ZN16QCoreApplication4execEv (libQt5Core.so.5 + 0x2ba354)
#35 0x00007f0cc5408851 kdemain (libkdeinit5_konsole.so + 0x32851)
#36 0x00007f0cc4c010b3 __libc_start_main (libc.so.6 + 0x270b3)
#37 0x0000562182db735e n/a (konsole + 0x235e)

Stack trace of thread 72271:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72270:
#0  0x00007ffe3dcfdb37 __vdso_clock_gettime (linux-vdso.so.1 + 0xb37)
#1  0x00007f0cc4cba235 __GI___clock_gettime (libc.so.6 + 0xe0235)
#2  0x00007f0cc50d9885 n/a (libQt5Core.so.5 + 0x30d885)
#3  0x00007f0cc50d811d _ZN14QTimerInfoList17updateCurrentTimeEv (libQt5Core.so.5 + 0x30c11d)
#4  0x00007f0cc50d86f9 _ZN14QTimerInfoList9timerWaitER8timespec (libQt5Core.so.5 + 0x30c6f9)
#5  0x00007f0cc50d9d16 n/a (libQt5Core.so.5 + 0x30dd16)
#6  0x00007f0cc2c2e70f g_main_context_prepare (libglib-2.0.so.0 + 0x5170f)
#7  0x00007f0cc2c2f0bb n/a (libglib-2.0.so.0 + 0x520bb)
#8  0x00007f0cc2c2f2c3 g_main_context_iteration (libglib-2.0.so.0 + 0x522c3)
#9  0x00007f0cc50d9fbb _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x30dfbb)
#10 0x00007f0cc507e1ab _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b21ab)
#11 0x00007f0cc4e98a12 _ZN7QThread4execEv (libQt5Core.so.5 + 0xcca12)
#12 0x00007f0cc2522f4b n/a (libQt5DBus.so.5 + 0x18f4b)
#13 0x00007f0cc4e99bac n/a (libQt5Core.so.5 + 0xcdbac)
#14 0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#15 0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72272:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72273:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72274:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72275:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72278:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72276:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72277:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72279:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)

Stack trace of thread 72280:
#0  0x00007f0cc34cd376 futex_wait_cancelable (libpthread.so.0 + 0x10376)
#1  0x00007f0cb4f9943b n/a (radeonsi_dri.so + 0x14143b)
#2  0x00007f0cb4f9903b n/a (radeonsi_dri.so + 0x14103b)
#3  0x00007f0cc34c6609 start_thread (libpthread.so.0 + 0x9609)
#4  0x00007f0cc4cfc293 __clone (libc.so.6 + 0x122293)



EXPECTED RESULT
All tabs to be bookmarked in a new folder?

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
I just tested with 2 tabs and it worked. I am unsure why it crashed with the 5 tabs.
Comment 1 rickrods 2021-01-31 00:19:55 UTC
I forgot to mention I am using 
KDE neon Unstable Edition
Unstable Branches

Hope this helps.
Comment 2 Kurt Hindenburg 2021-02-09 01:56:35 UTC
Thanks, I got it to crash once.  I'll try to test more and see what's going on.

    #0 0x7f86d043a160 in Konsole::BookmarkHandler::titleForView(Konsole::ViewProperties*) const /home/kurthindenburg/Devel/KDE/src/konsole/src/BookmarkHandler.cpp:99:47
    #1 0x7f86d043ad72 in Konsole::BookmarkHandler::currentBookmarkList() const /home/kurthindenburg/Devel/KDE/src/konsole/src/BookmarkHandler.cpp:139:48
    #2 0x7f86d043aeff in non-virtual thunk to Konsole::BookmarkHandler::currentBookmarkList() const /home/kurthindenburg/Devel/KDE/src/konsole/src/BookmarkHandler.cpp
Comment 3 Kurt Hindenburg 2021-02-09 02:07:19 UTC
It has nothing to do w/ ssh or # of tabs.

To reproduce:
1. start 2 tabs
2. close one tab
3. Bookmark->Bookmark tabs as folder

crash
Comment 4 Kurt Hindenburg 2021-02-09 03:30:53 UTC
According to bit bisect (which is a pain to use w/ so many Qt/KF changes) it is  https://invent.kde.org/utilities/konsole/-/commit/6e8153a78e3c63e514a6ecb62f6c9b4b504e7eb7
Comment 5 Kurt Hindenburg 2021-02-09 03:37:40 UTC
The views are not removed when you close a session so when BookmarkHandler::currentBookmarkList is called, it loops through removed sessions.
Comment 6 Jack Thomasson 2021-03-04 17:24:14 UTC
Created attachment 136373 [details]
New crash information added by DrKonqi

konsole (20.12.2) using Qt 5.15.2

- What I was doing when the application crashed:

Bookmark Tabs as Folder after closing several tabs from another bookmark

-- Backtrace (Reduced):
#4  0x00007fc0836db8ae in QIcon::name() const () from /lib64/libQt5Gui.so.5
#5  0x00007fc08487cb8c in Konsole::BookmarkHandler::iconForView(Konsole::ViewProperties*) const () from /lib64/libkonsoleprivate.so.20
#6  0x00007fc08487cd53 in Konsole::BookmarkHandler::currentBookmarkList() const () from /lib64/libkonsoleprivate.so.20
#7  0x00007fc082d5cdad in KBookmarkMenu::slotAddBookmarksList() () from /lib64/libKF5Bookmarks.so.5
#8  0x00007fc08325f386 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
Comment 7 Bug Janitor Service 2021-03-07 19:20:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/361
Comment 8 Kurt Hindenburg 2021-03-07 20:50:26 UTC
Git commit 34f85cecea5010a5b8fa8c15020bf894f4d0bbcc by Kurt Hindenburg, on behalf of Carlos Alves.
Committed on 07/03/2021 at 20:50.
Pushed by hindenburg into branch 'master'.

Fix Bookmark all tabs as a folder crash

The list of active sessions needs to be refreshed when a session is
destroyed. It was being refreshed only on creation.
FIXED-IN: 21.04

M  +4    -0    src/ViewManager.cpp
M  +2    -0    src/widgets/ViewContainer.cpp
M  +3    -0    src/widgets/ViewContainer.h

https://invent.kde.org/utilities/konsole/commit/34f85cecea5010a5b8fa8c15020bf894f4d0bbcc