Bug 476087

Summary: kaffeine crashes (reproducible to a 100%) when performing a specific sequence in order to register a program in the near future
Product: [Applications] kaffeine Reporter: stakanov
Component: generalAssignee: Mauro Carvalho Chehab <mchehab>
Status: REPORTED ---    
Severity: crash Keywords: drkonqi
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description stakanov 2023-10-25 16:24:00 UTC
Application: kaffeine (2.0.18)

Qt Version: 5.15.11
Frameworks Version: 5.111.0
Operating System: Linux 6.5.8-1-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.27.8 [KCrashBackend]

-- Information about the crash:
Go to kaffeine, open television (in my case Sat TV), select in the menue "television", select program guide. Search for a specific title of movie, then when found select it to be registered. Then you confirm with close once done. The program in question is not selected for registration because the crash happens before the entry in the database is done. But(!) if you do the very same sequence and after selecting for registration, you do not close with the "close" button (uttermost right below) but you close the selection window by closing with the closing dot of the very window, the program does not crash, the selected program is marked for registration, the registration is then maintained

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: Kaffeine (kaffeine), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f172b08b8ec in QHash<QModelIndex, QPersistentModelIndexData*>::remove(QModelIndex const&) (akey=..., this=0x55c59c80a7e0) at ../../include/QtCore/../../src/corelib/tools/qhash.h:813
#5  QAbstractItemModelPrivate::removePersistentIndexData(QPersistentModelIndexData*) (this=0x55c59c80a780, data=data@entry=0x7f1720063450) at itemmodels/qabstractitemmodel.cpp:641
#6  0x00007f172b08bdb9 in QPersistentModelIndexData::destroy(QPersistentModelIndexData*) (data=0x7f1720063450) at itemmodels/qabstractitemmodel.cpp:89
#7  QPersistentModelIndex::~QPersistentModelIndex() (this=<optimized out>, __in_chrg=<optimized out>) at itemmodels/qabstractitemmodel.cpp:183
#8  QPersistentModelIndex::~QPersistentModelIndex() (this=<optimized out>, __in_chrg=<optimized out>) at itemmodels/qabstractitemmodel.cpp:180
#9  0x00007f172b0a3f2e in QItemSelectionRange::~QItemSelectionRange() (this=0x55c59c94d380, __in_chrg=<optimized out>) at itemmodels/qitemselectionmodel.h:54
#10 QList<QItemSelectionRange>::node_destruct(QList<QItemSelectionRange>::Node*, QList<QItemSelectionRange>::Node*) (this=<optimized out>, to=0x55c59c956870, from=0x55c59c956870) at ../../include/QtCore/../../src/corelib/tools/qlist.h:524
#11 QList<QItemSelectionRange>::dealloc(QListData::Data*) (this=0x55c59c9568e0, data=0x55c59c956860) at ../../include/QtCore/../../src/corelib/tools/qlist.h:921
#12 QList<QItemSelectionRange>::~QList() (this=this@entry=0x55c59c0c3280, __in_chrg=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qlist.h:874
#13 0x00007f172b0a42b9 in QItemSelection::~QItemSelection() (this=0x55c59c0c3280, __in_chrg=<optimized out>) at itemmodels/qitemselectionmodel.h:249
#14 QItemSelectionModelPrivate::~QItemSelectionModelPrivate() (this=0x55c59c0c3210, __in_chrg=<optimized out>) at ../../include/QtCore/5.15.11/QtCore/private/../../../../../src/corelib/itemmodels/qitemselectionmodel_p.h:60
#15 QItemSelectionModelPrivate::~QItemSelectionModelPrivate() (this=0x55c59c0c3210, __in_chrg=<optimized out>) at ../../include/QtCore/5.15.11/QtCore/private/../../../../../src/corelib/itemmodels/qitemselectionmodel_p.h:60
#16 0x00007f172b0967f9 in QItemSelectionModel::~QItemSelectionModel() (this=0x55c59c911540, __in_chrg=<optimized out>) at itemmodels/qitemselectionmodel.cpp:1179
#17 0x00007f172b116aee in QObjectPrivate::deleteChildren() (this=this@entry=0x55c59c7b4f90) at kernel/qobject.cpp:2137
#18 0x00007f172bde2696 in QWidget::~QWidget() (this=0x55c59c8cf380, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1524
#19 0x00007f172c080bf9 in QTreeView::~QTreeView() (this=0x55c59c8cf380, __in_chrg=<optimized out>) at itemviews/qtreeview.cpp:209
#20 0x00007f172b116aee in QObjectPrivate::deleteChildren() (this=this@entry=0x55c59bd4eb30) at kernel/qobject.cpp:2137
#21 0x00007f172bde2696 in QWidget::~QWidget() (this=0x55c59c4dca60, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1524
#22 0x000055c599e28c15 in  ()
#23 0x00007f172b118d17 in QObject::event(QEvent*) (this=0x55c59c4dca60, e=0x55c59c918490) at kernel/qobject.cpp:1334
#24 0x00007f172bda519e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55c59c4dca60, e=0x55c59c918490) at kernel/qapplication.cpp:3640
#25 0x00007f172b0ed198 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55c59c4dca60, event=0x55c59c918490) at kernel/qcoreapplication.cpp:1064
#26 0x00007f172b0ed35e in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#27 0x00007f172b0f0791 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55c59a6c0030) at kernel/qcoreapplication.cpp:1821
#28 0x00007f172b0f0cd8 in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=<optimized out>, event_type=<optimized out>) at kernel/qcoreapplication.cpp:1680
#29 0x00007f172b1468c3 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55c59a896bc0) at kernel/qeventdispatcher_glib.cpp:277
#30 0x00007f1729713ef0 in  () at /lib64/libglib-2.0.so.0
#31 0x00007f1729715b18 in  () at /lib64/libglib-2.0.so.0
#32 0x00007f17297161cc in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#33 0x00007f172b1460d6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55c59a8a5120, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#34 0x00007f172b0ebc2b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd66bded50, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#35 0x00007f172b0f40c0 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#36 0x000055c599de6830 in  ()
#37 0x00007f172a6281b0 in __libc_start_call_main () at /lib64/libc.so.6
#38 0x00007f172a628279 in __libc_start_main_impl () at /lib64/libc.so.6
#39 0x000055c599de7ce5 in _start ()
[Inferior 1 (process 19203) detached]

Reported using DrKonqi
Comment 1 stakanov 2023-10-25 16:29:56 UTC
and with all the given respect to the (malfunctioning) Konqi: the reporter is dead sure that the bug can be reproduced to a 100% of the time by doing exactly this kind of sequence. 

I tried also to close Kaffeine and encountered a second anomaly, that may or not may be connected: as expected kaffeine warns you hat a program has been selected for registration, "are you sure to quit"? IF you select to quit, astonishingly it does not but presents the very same window a second time. (Same same, content etc.). This happens not matter if one or more movies / programs are selected to register, as there would be a "double entry"? 
Hope that this might give some hint. 
As the annoyance is there but allows an easy workaround I would consider this minor.