Bug 355736 - korganizer crashes in QVector<QSharedPointer<KCalCore::Incidence> >::reserve(int)
Summary: korganizer crashes in QVector<QSharedPointer<KCalCore::Incidence> >::reserve(...
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: 5.0
Platform: Kubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: David Faure
URL:
Keywords: drkonqi
: 351421 355142 358152 361938 362010 362012 362183 362602 362724 363547 365674 366800 368141 368285 369452 369484 371242 375787 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-11-22 15:14 UTC by Achim Bohnet
Modified: 2022-05-20 22:04 UTC (History)
18 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.3.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Bohnet 2015-11-22 15:14:30 UTC
Application: korganizer ()

Qt Version: 5.4.2
Operating System: Linux 4.2.0-18-generic x86_64
Distribution: Ubuntu 15.10

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

akonadictl restart

Reproduce:

	* start korganizer
	* open a konsole window
	* run akonadictl restart

 -> korganizer crashes

The crash can be reproduced every time.

-- Backtrace:
Application: korganizer (korganizer), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[KCrash Handler]
#6  0x00007f03b6936e40 in QVector<QSharedPointer<KCalCore::Incidence> >::reserve(int) (this=<optimized out>, asize=asize@entry=0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h:363
#7  0x00007f03b6932a0e in KCalCore::Calendar::setupRelations(QSharedPointer<KCalCore::Incidence> const&) (this=0x21da4b0, forincidence=...) at ../../src/calendar.cpp:1032
#8  0x00007f03b697107c in KCalCore::MemoryCalendar::addIncidence(QSharedPointer<KCalCore::Incidence> const&) (this=0x21da4b0, incidence=...) at ../../src/memorycalendar.cpp:305
#9  0x00007f03b21f764c in Akonadi::CalendarBasePrivate::internalInsert(Akonadi::Item const&) (this=this@entry=0x21da530, item=...) at ../../src/calendarbase.cpp:158
#10 0x00007f03b2205520 in Akonadi::ETMCalendarPrivate::itemsAdded(QVector<Akonadi::Item> const&) (this=this@entry=0x21da530, items=...) at ../../src/etmcalendar.cpp:290
#11 0x00007f03b2206822 in Akonadi::ETMCalendarPrivate::onRowsInsertedInFilteredModel(QModelIndex const&, int, int) (this=0x21da530, index=..., start=<optimized out>, end=<optimized out>) at ../../src/etmcalendar.cpp:445
#12 0x00007f03b2207de5 in Akonadi::ETMCalendarPrivate::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=_o@entry=0x21da530, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=22, _a=_a@entry=0x7ffea6794820) at ./moc_etmcalendar_p.cpp:281
#13 0x00007f03b4a7c78a in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0x21e54d0, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6794820) at kernel/qobject.cpp:3717
#14 0x00007f03b4a7cf87 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x21e54d0, m=m@entry=0x7f03b4c7ee40 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6794820) at kernel/qobject.cpp:3582
#15 0x00007f03b4af3874 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) (this=this@entry=0x21e54d0, _t1=..., _t2=0, _t3=61) at .moc/moc_qabstractitemmodel.cpp:428
#16 0x00007f03b49f4f16 in QAbstractItemModel::endInsertRows() (this=this@entry=0x21e54d0) at itemmodels/qabstractitemmodel.cpp:2623
#17 0x00007f03b4a16693 in QSortFilterProxyModelPrivate::insert_source_items(QVector<int>&, QVector<int>&, QVector<int> const&, QModelIndex const&, Qt::Orientation, bool) (this=this@entry=0x21e6220, source_to_proxy=..., proxy_to_source=..., source_items=..., source_parent=..., emit_signal=emit_signal@entry=true, orient=Qt::Vertical) at itemmodels/qsortfilterproxymodel.cpp:713
#18 0x00007f03b4a19984 in QSortFilterProxyModelPrivate::_q_sourceRowsInserted(QModelIndex const&, int, int) (orient=Qt::Vertical, end=<optimized out>, start=<optimized out>, source_parent=..., this=0x21e6220) at itemmodels/qsortfilterproxymodel.cpp:824
#19 0x00007f03b4a19984 in QSortFilterProxyModelPrivate::_q_sourceRowsInserted(QModelIndex const&, int, int) (this=0x21e6220, source_parent=..., start=<optimized out>, end=<optimized out>) at itemmodels/qsortfilterproxymodel.cpp:1379
#20 0x00007f03b4a7c78a in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0x21add40, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6794b70) at kernel/qobject.cpp:3717
#21 0x00007f03b4a7cf87 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x21add40, m=m@entry=0x7f03b4c7ee40 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6794b70) at kernel/qobject.cpp:3582
#22 0x00007f03b4af3874 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) (this=this@entry=0x21add40, _t1=..., _t2=0, _t3=61) at .moc/moc_qabstractitemmodel.cpp:428
#23 0x00007f03b49f4f16 in QAbstractItemModel::endInsertRows() (this=this@entry=0x21add40) at itemmodels/qabstractitemmodel.cpp:2623
#24 0x00007f03b4a16693 in QSortFilterProxyModelPrivate::insert_source_items(QVector<int>&, QVector<int>&, QVector<int> const&, QModelIndex const&, Qt::Orientation, bool) (this=this@entry=0x21e39e0, source_to_proxy=..., proxy_to_source=..., source_items=..., source_parent=..., emit_signal=emit_signal@entry=true, orient=Qt::Vertical) at itemmodels/qsortfilterproxymodel.cpp:713
#25 0x00007f03b4a19984 in QSortFilterProxyModelPrivate::_q_sourceRowsInserted(QModelIndex const&, int, int) (orient=Qt::Vertical, end=<optimized out>, start=<optimized out>, source_parent=..., this=0x21e39e0) at itemmodels/qsortfilterproxymodel.cpp:824
#26 0x00007f03b4a19984 in QSortFilterProxyModelPrivate::_q_sourceRowsInserted(QModelIndex const&, int, int) (this=0x21e39e0, source_parent=..., start=<optimized out>, end=<optimized out>) at itemmodels/qsortfilterproxymodel.cpp:1379
#27 0x00007f03b4a7c78a in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0x21ade20, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6794ec0) at kernel/qobject.cpp:3717
#28 0x00007f03b4a7cf87 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x21ade20, m=m@entry=0x7f03b4c7ee40 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6794ec0) at kernel/qobject.cpp:3582
#29 0x00007f03b4af3874 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) (this=this@entry=0x21ade20, _t1=..., _t2=0, _t3=61) at .moc/moc_qabstractitemmodel.cpp:428
#30 0x00007f03b49f4f16 in QAbstractItemModel::endInsertRows() (this=this@entry=0x21ade20) at itemmodels/qabstractitemmodel.cpp:2623
#31 0x00007f03b4a16693 in QSortFilterProxyModelPrivate::insert_source_items(QVector<int>&, QVector<int>&, QVector<int> const&, QModelIndex const&, Qt::Orientation, bool) (this=this@entry=0x21e25e0, source_to_proxy=..., proxy_to_source=..., source_items=..., source_parent=..., emit_signal=emit_signal@entry=true, orient=Qt::Vertical) at itemmodels/qsortfilterproxymodel.cpp:713
#32 0x00007f03b4a19984 in QSortFilterProxyModelPrivate::_q_sourceRowsInserted(QModelIndex const&, int, int) (orient=Qt::Vertical, end=<optimized out>, start=<optimized out>, source_parent=..., this=0x21e25e0) at itemmodels/qsortfilterproxymodel.cpp:824
#33 0x00007f03b4a19984 in QSortFilterProxyModelPrivate::_q_sourceRowsInserted(QModelIndex const&, int, int) (this=0x21e25e0, source_parent=..., start=<optimized out>, end=<optimized out>) at itemmodels/qsortfilterproxymodel.cpp:1379
#34 0x00007f03b4a7c78a in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0x21b5730, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6795210) at kernel/qobject.cpp:3717
#35 0x00007f03b4a7cf87 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x21b5730, m=m@entry=0x7f03b4c7ee40 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6795210) at kernel/qobject.cpp:3582
#36 0x00007f03b4af3874 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) (this=this@entry=0x21b5730, _t1=..., _t2=6, _t3=67) at .moc/moc_qabstractitemmodel.cpp:428
#37 0x00007f03b49f4f16 in QAbstractItemModel::endInsertRows() (this=this@entry=0x21b5730) at itemmodels/qabstractitemmodel.cpp:2623
#38 0x00007f03b07dec90 in KDescendantsProxyModelPrivate::processPendingParents() (this=this@entry=0x21efa70) at ../../src/kdescendantsproxymodel.cpp:159
#39 0x00007f03b07df597 in KDescendantsProxyModelPrivate::sourceRowsInserted(QModelIndex const&, int, int) (this=0x21efa70) at ../../src/kdescendantsproxymodel.cpp:116
#40 0x00007f03b07df597 in KDescendantsProxyModelPrivate::sourceRowsInserted(QModelIndex const&, int, int) (this=0x21efa70, parent=..., start=<optimized out>, end=61) at ../../src/kdescendantsproxymodel.cpp:567
#41 0x00007f03b4a7c78a in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0x2174e20, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6795610) at kernel/qobject.cpp:3717
#42 0x00007f03b4a7cf87 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x2174e20, m=m@entry=0x7f03b4c7ee40 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=10, argv=argv@entry=0x7ffea6795610) at kernel/qobject.cpp:3582
#43 0x00007f03b4af3874 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) (this=this@entry=0x2174e20, _t1=..., _t2=0, _t3=61) at .moc/moc_qabstractitemmodel.cpp:428
#44 0x00007f03b49f4f16 in QAbstractItemModel::endInsertRows() (this=this@entry=0x2174e20) at itemmodels/qabstractitemmodel.cpp:2623
#45 0x00007f03b0b89d3a in Akonadi::EntityTreeModelPrivate::itemsFetched(long long, QVector<Akonadi::Item> const&) (this=this@entry=0x21dfc10, collectionId=collectionId@entry=121, items=...) at ../../../../akonadi/src/core/models/entitytreemodel_p.cpp:571
#46 0x00007f03b0b89e69 in Akonadi::EntityTreeModelPrivate::itemsFetched(QVector<Akonadi::Item> const&) (this=0x21dfc10, items=...) at ../../../../akonadi/src/core/models/entitytreemodel_p.cpp:488
#47 0x00007f03b4a7c78a in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0x2980b50, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffea6795990) at kernel/qobject.cpp:3717
#48 0x00007f03b4a7cf87 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x2980b50, m=m@entry=0x7f03b0e1ccc0 <Akonadi::ItemFetchJob::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffea6795990) at kernel/qobject.cpp:3582
#49 0x00007f03b0b33c42 in Akonadi::ItemFetchJob::itemsReceived(QVector<Akonadi::Item> const&) (this=this@entry=0x2980b50, _t1=...) at ./moc_itemfetchjob.cpp:162
#50 0x00007f03b0b35abf in Akonadi::ItemFetchJobPrivate::aboutToFinish() (this=<optimized out>) at ../../../../akonadi/src/core/jobs/itemfetchjob.cpp:77
#51 0x00007f03b0b35abf in Akonadi::ItemFetchJobPrivate::aboutToFinish() (this=0x283d520) at ../../../../akonadi/src/core/jobs/itemfetchjob.cpp:67
#52 0x00007f03b0b3e3f2 in Akonadi::Job::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (this=<optimized out>) at ../../../../akonadi/src/core/jobs/job.cpp:152
#53 0x00007f03b0b3e3f2 in Akonadi::Job::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at ./moc_job.cpp:107
#54 0x00007f03b4a7d651 in QObject::event(QEvent*) (this=0x2980b50, e=<optimized out>) at kernel/qobject.cpp:1245
#55 0x00007f03b57d0b8c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x2078c00, receiver=receiver@entry=0x2980b50, e=e@entry=0x29358c0) at kernel/qapplication.cpp:3720
#56 0x00007f03b57d6230 in QApplication::notify(QObject*, QEvent*) (this=0x7ffea6796070, receiver=0x2980b50, e=0x29358c0) at kernel/qapplication.cpp:3503
#57 0x00007f03b4a4bf1b in QCoreApplication::notifyInternal(QObject*, QEvent*) (this=0x7ffea6796070, receiver=0x2980b50, event=event@entry=0x29358c0) at kernel/qcoreapplication.cpp:935
#58 0x00007f03b4a4e057 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (event=0x29358c0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:228
#59 0x00007f03b4a4e057 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x2055ed0) at kernel/qcoreapplication.cpp:1552
#60 0x00007f03b4a4e588 in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1410
#61 0x00007f03b4aa2e73 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x20a92c0) at kernel/qeventdispatcher_glib.cpp:271
#62 0x00007f03aae70ff7 in g_main_context_dispatch (context=0x7f038c0016f0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:3154
#63 0x00007f03aae70ff7 in g_main_context_dispatch (context=context@entry=0x7f038c0016f0) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:3769
#64 0x00007f03aae71250 in g_main_context_iterate (context=context@entry=0x7f038c0016f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:3840
#65 0x00007f03aae712fc in g_main_context_iteration (context=0x7f038c0016f0, may_block=may_block@entry=1) at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gmain.c:3901
#66 0x00007f03b4aa327f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x20a92a0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#67 0x00007f03b4a4975a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffea6795f50, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#68 0x00007f03b4a512cc in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1188
#69 0x00007f03b4d6600c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1510
#70 0x00007f03b57cd025 in QApplication::exec() () at kernel/qapplication.cpp:2956
#71 0x000000000040971a in main(int, char**) (argc=1, argv=0x7ffea6796208) at ../../korganizer/main.cpp:61

Reported using DrKonqi
Comment 1 Achim Bohnet 2015-11-23 13:59:06 UTC
More specific korganzier 15.08.2does crash after:
 * akonadictl start
or
 * clicking on the 'Start' button in the center of grey area, that korganizer shows when akonadi is stopped.

[kmail and kaddressbook survive a akonadi restart]
Comment 2 David Faure 2016-07-25 21:46:13 UTC
Also happens when disabling/re-enabling some calendars, same backtrace.
Comment 3 David Faure 2016-07-25 21:46:37 UTC
*** Bug 358152 has been marked as a duplicate of this bug. ***
Comment 4 David Faure 2016-07-25 21:46:50 UTC
*** Bug 362012 has been marked as a duplicate of this bug. ***
Comment 5 David Faure 2016-07-25 21:47:02 UTC
*** Bug 362183 has been marked as a duplicate of this bug. ***
Comment 6 David Faure 2016-07-25 21:47:12 UTC
*** Bug 362724 has been marked as a duplicate of this bug. ***
Comment 7 David Faure 2016-07-25 21:48:24 UTC
I have reduced the issue to this testcase, which crashes indeed.

    QVector<int> vec;
    vec.erase(std::remove(vec.begin(), vec.end(), 42), vec.end());
    vec.reserve(0);
Comment 8 David Faure 2016-07-25 21:59:14 UTC
Found a Qt bug report about this, reopened it with more details, https://bugreports.qt.io/browse/QTBUG-51758.

Meanwhile it's quite pointless to do all this for an empty container, I'll add an if() in kcalcore, good for performance, not just as a workaround.
Comment 10 Denis Kurz 2016-09-06 19:19:40 UTC
*** Bug 351421 has been marked as a duplicate of this bug. ***
Comment 11 Denis Kurz 2016-09-06 19:19:56 UTC
*** Bug 355142 has been marked as a duplicate of this bug. ***
Comment 12 Denis Kurz 2016-09-06 19:20:01 UTC
*** Bug 361938 has been marked as a duplicate of this bug. ***
Comment 13 Denis Kurz 2016-09-06 19:20:05 UTC
*** Bug 362010 has been marked as a duplicate of this bug. ***
Comment 14 Denis Kurz 2016-09-06 19:20:11 UTC
*** Bug 362602 has been marked as a duplicate of this bug. ***
Comment 15 Denis Kurz 2016-09-06 19:20:18 UTC
*** Bug 363547 has been marked as a duplicate of this bug. ***
Comment 16 Denis Kurz 2016-09-06 19:20:23 UTC
*** Bug 365674 has been marked as a duplicate of this bug. ***
Comment 17 Denis Kurz 2016-09-06 19:20:28 UTC
*** Bug 366800 has been marked as a duplicate of this bug. ***
Comment 18 Denis Kurz 2016-09-06 19:20:32 UTC
*** Bug 368141 has been marked as a duplicate of this bug. ***
Comment 19 Denis Kurz 2016-09-06 19:20:47 UTC
*** Bug 368285 has been marked as a duplicate of this bug. ***
Comment 20 Denis Kurz 2016-10-12 09:23:40 UTC
*** Bug 369452 has been marked as a duplicate of this bug. ***
Comment 21 Denis Kurz 2016-10-12 09:23:45 UTC
*** Bug 369484 has been marked as a duplicate of this bug. ***
Comment 22 Christoph Feck 2016-10-20 20:58:45 UTC
*** Bug 371242 has been marked as a duplicate of this bug. ***
Comment 23 gjditchfield 2022-05-20 22:04:47 UTC
*** Bug 375787 has been marked as a duplicate of this bug. ***