[Akonadi] [Bug 397131] New: kmail crash due to MonitorPrivate::emitItemsNotification accessing empty items

Martin Koller bugzilla_noreply at kde.org
Fri Aug 3 18:25:07 BST 2018


https://bugs.kde.org/show_bug.cgi?id=397131

            Bug ID: 397131
           Summary: kmail crash due to
                    MonitorPrivate::emitItemsNotification accessing empty
                    items
           Product: Akonadi
           Version: GIT (master)
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kdepim-bugs at kde.org
          Reporter: kollix at aon.at
  Target Milestone: ---

I see kmail crashing after todays update (akonadi @
f7ce8ab4af83b8a64e97e2a8f11c21674cde826c)

The problem is in akonadis MonitorPrivate::emitItemsNotification
implementation, which gets called in line 555 via
        if (!items.isEmpty() || itemNtf.operation() ==
Protocol::ItemChangeNotification::Remove || !fetchItems()) {
            someoneWasListening = emitItemsNotification(itemNtf, items, parent,
destParent);
        }

so obviously items CAN be empty (which it is in the crash case), but
emitItemsNotification()
in line 1064 (and others) uses
    case Protocol::ItemChangeNotification::Add:
        return emitToListeners(&Monitor::itemAdded, its.first(), col);

and Qt asserts due to the first() call on the empty list.

The stack I have here is:
1   raise                                                                      
  0x7fa2fad6df67 
2   abort                                                                      
  0x7fa2fad6f33a 
3   qt_message_fatal                               qlogging.cpp             
1842 0x7fa2fba08f1c 
4   QMessageLogger::fatal                          qlogging.cpp             
880  0x7fa2fba08f1c 
5   qt_assert                                      qglobal.cpp              
3188 0x7fa2fba08576 
6   QVector<Akonadi::Item>::first                  qvector.h                
237  0x7fa2f48bb98e 
7   Akonadi::MonitorPrivate::emitItemsNotification monitor_p.cpp            
1064 0x7fa2f48b0f90 
8   Akonadi::MonitorPrivate::emitNotification      monitor_p.cpp            
555  0x7fa2f48ae94c 
9   Akonadi::MonitorPrivate::dispatchNotifications monitor_p.cpp            
1000 0x7fa2f48b58c5 
10  Akonadi::MonitorPrivate::slotNotify            monitor_p.cpp            
969  0x7fa2f48b532a 
11  Akonadi::MonitorPrivate::handleCommands        monitor_p.cpp            
864  0x7fa2f48b4963 
12  Akonadi::Monitor::qt_static_metacall           moc_monitor.cpp          
338  0x7fa2f48a18b3 
13  QObject::event                                 qobject.cpp              
1251 0x7fa2fbc07f76 
14  QApplicationPrivate::notify_helper             qapplication.cpp         
3728 0x7fa2fc9821ac 
15  QApplication::notify                           qapplication.cpp         
3487 0x7fa2fc988b52 
16  QCoreApplication::notifyInternal2              qcoreapplication.cpp     
1048 0x7fa2fbbdc8f5 
17  QCoreApplication::sendEvent                    qcoreapplication.h       
234  0x7fa2fbbdf2be 
18  QCoreApplicationPrivate::sendPostedEvents      qcoreapplication.cpp     
1745 0x7fa2fbbdf2be 
19  QEventDispatcherUNIX::processEvents            qeventdispatcher_unix.cpp
466  0x7fa2fbc2c5c4 
20  QUnixEventDispatcherQPA::processEvents         qunixeventdispatcher.cpp  68
  0x7fa2d1fbc34d

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Kdepim-bugs mailing list