Bug 474144 - Korganizer crashes when forwarding an event
Summary: Korganizer crashes when forwarding an event
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2023-09-04 14:14 UTC by Thomas Monjalon
Modified: 2023-10-17 19:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 23.08.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Monjalon 2023-09-04 14:14:30 UTC
Application: korganizer (5.24.0 (23.08.0))

Qt Version: 5.15.10
Frameworks Version: 5.109.0
Operating System: Linux 6.4.12-arch1-1 x86_64
Windowing System: X11
Distribution: "Arch Linux"
DrKonqi: 5.27.7 [KCrashBackend]

-- Information about the crash:
Since a recent update, I am not able to forward a calendar event.

The crash can be reproduced every time.

-- Backtrace:
Application: KOrganizer (korganizer), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  0x00007f2629aef0b8 in Akonadi::MailClient::queueMessage(MailTransport::Transport const*, MessageComposer::Composer const*, QSharedPointer<KCalendarCore::IncidenceBase> const&, KIdentityManagement::Identity const&, Akonadi::MailClient::MessageData const&, QSharedPointer<KMime::Message> const&) (message=..., msg=..., identity=<optimized out>, incidence=..., composer=<optimized out>, transport=0x561d04ed36f0, this=0x561d03ffcbf0) at /usr/src/debug/akonadi-calendar/akonadi-calendar-23.08.0/src/mailclient_p.cpp:323
#7  operator() (__closure=0x561d04eb5680) at /usr/src/debug/akonadi-calendar/akonadi-calendar-23.08.0/src/mailclient_p.cpp:641
#8  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Akonadi::MailClient::send(const KCalendarCore::IncidenceBase::Ptr&, const KIdentityManagement::Identity&, const MessageData&, const QString&)::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#9  QtPrivate::Functor<Akonadi::MailClient::send(const KCalendarCore::IncidenceBase::Ptr&, const KIdentityManagement::Identity&, const MessageData&, const QString&)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#10 QtPrivate::QFunctorSlotObject<Akonadi::MailClient::send(const KCalendarCore::IncidenceBase::Ptr&, const KIdentityManagement::Identity&, const MessageData&, const QString&)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x561d04eb5670, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#11 0x00007f262a2d1637 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff5abc71f0, r=<optimized out>, this=0x561d04eb5670, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#12 doActivate<false>(QObject*, int, void**) (sender=0x561d04ede3f0, signal_index=6, argv=0x7fff5abc71f0) at kernel/qobject.cpp:3925
#13 0x00007f262b7c30aa in KJob::result(KJob*, KJob::QPrivateSignal) (this=this@entry=0x561d04ede3f0, _t1=<optimized out>, _t1@entry=0x561d04ede3f0, _t2=...) at /usr/src/debug/kcoreaddons/build/src/lib/KF5CoreAddons_autogen/include/moc_kjob.cpp:633
#14 0x00007f262b7c907c in KJob::finishJob(bool) (this=0x561d04ede3f0, emitResult=<optimized out>) at /usr/src/debug/kcoreaddons/kcoreaddons-5.109.0/src/lib/jobs/kjob.cpp:98
#15 0x00007f262a2d1637 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff5abc7320, r=<optimized out>, this=0x561d04f1cbd0, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#16 doActivate<false>(QObject*, int, void**) (sender=0x561d04ec9270, signal_index=6, argv=0x7fff5abc7320) at kernel/qobject.cpp:3925
#17 0x00007f262b7c30aa in KJob::result(KJob*, KJob::QPrivateSignal) (this=this@entry=0x561d04ec9270, _t1=<optimized out>, _t1@entry=0x561d04ec9270, _t2=...) at /usr/src/debug/kcoreaddons/build/src/lib/KF5CoreAddons_autogen/include/moc_kjob.cpp:633
#18 0x00007f262b7c907c in KJob::finishJob(bool) (this=0x561d04ec9270, emitResult=<optimized out>) at /usr/src/debug/kcoreaddons/kcoreaddons-5.109.0/src/lib/jobs/kjob.cpp:98
#19 0x00007f262b7c9cd2 in KJob::emitResult() (this=<optimized out>) at /usr/src/debug/kcoreaddons/kcoreaddons-5.109.0/src/lib/jobs/kjob.cpp:338
#20 0x00007f2627a3a67a in operator() (auditLogAsHtml=<optimized out>, auditLogError=<optimized out>, signature=..., result=<optimized out>, __closure=0x561d04efe8e0) at /usr/src/debug/messagelib/messagelib-23.08.0/messagecomposer/src/job/signjob.cpp:277
#21 QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2, 3>, QtPrivate::List<const GpgME::SigningResult&, const QByteArray&, const QString&, const GpgME::Error&>, void, MessageComposer::SignJob::process()::<lambda(const GpgME::SigningResult&, const QByteArray&, const QString&, const GpgME::Error&)> >::call (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#22 QtPrivate::Functor<MessageComposer::SignJob::process()::<lambda(const GpgME::SigningResult&, const QByteArray&, const QString&, const GpgME::Error&)>, 4>::call<QtPrivate::List<GpgME::SigningResult const&, QByteArray const&, QString const&, GpgME::Error const&>, void> (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#23 QtPrivate::QFunctorSlotObject<MessageComposer::SignJob::process()::<lambda(const GpgME::SigningResult&, const QByteArray&, const QString&, const GpgME::Error&)>, 4, QtPrivate::List<const GpgME::SigningResult&, const QByteArray&, const QString&, const GpgME::Error&>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x561d04efe8d0, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#24 0x00007f262a2d1637 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff5abc74b0, r=<optimized out>, this=0x561d04efe8d0, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#25 doActivate<false>(QObject*, int, void**) (sender=0x561d04ec7660, signal_index=7, argv=0x7fff5abc74b0) at kernel/qobject.cpp:3925
#26 0x00007f2626d55806 in QGpgME::SignJob::result(GpgME::SigningResult const&, QByteArray const&, QString const&, GpgME::Error const&) (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>, _t3=<optimized out>, _t4=<optimized out>) at /usr/src/debug/gpgme/gpgme-1.22.0/lang/qt/src/signjob.moc:144
#27 0x00007f2626d9d8dd in QGpgME::_detail::ThreadedJobMixin<QGpgME::SignJob, std::tuple<GpgME::SigningResult, QByteArray, QString, GpgME::Error> >::doEmitResult<GpgME::SigningResult, QByteArray, QString, GpgME::Error>(std::tuple<GpgME::SigningResult, QByteArray, QString, GpgME::Error> const&) (tuple=std::tuple containing = {...}, this=0x561d04ec7660) at /usr/include/c++/13.2.1/tuple:237
#28 QGpgME::_detail::ThreadedJobMixin<QGpgME::SignJob, std::tuple<GpgME::SigningResult, QByteArray, QString, GpgME::Error> >::slotFinished() (this=0x561d04ec7660) at /usr/src/debug/gpgme/gpgme-1.22.0/lang/qt/src/threadedjobmixin.h:239
#29 0x00007f262a2c4174 in QObject::event(QEvent*) (this=0x561d04ec7660, e=0x7f25c8005a60) at kernel/qobject.cpp:1347
#30 0x00007f262af7893f in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x561d04ec7660, e=0x7f25c8005a60) at kernel/qapplication.cpp:3640
#31 0x00007f262a29c6f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x561d04ec7660, event=0x7f25c8005a60) at kernel/qcoreapplication.cpp:1064
#32 0x00007f262a2a165b in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x561d03c4bd10) at kernel/qcoreapplication.cpp:1821
#33 0x00007f262a2e76d8 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x561d03d39430) at kernel/qeventdispatcher_glib.cpp:277
#34 0x00007f2627f10a61 in g_main_dispatch (context=0x7f2604000ee0) at ../glib/glib/gmain.c:3460
#35 g_main_context_dispatch (context=0x7f2604000ee0) at ../glib/glib/gmain.c:4200
#36 0x00007f2627f6dc29 in g_main_context_iterate.isra.0 (context=context@entry=0x7f2604000ee0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4276
#37 0x00007f2627f0e112 in g_main_context_iteration (context=0x7f2604000ee0, may_block=1) at ../glib/glib/gmain.c:4343
#38 0x00007f262a2eb51c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x561d03d40700, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#39 0x00007f262a29b404 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff5abc79e0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#40 0x00007f262a29c8a3 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#41 0x00007f262a73bef2 in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#42 0x00007f262af76cda in QApplication::exec() () at kernel/qapplication.cpp:2832
#43 0x0000561d037e6db8 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/korganizer/korganizer-23.08.0/src/main.cpp:72
[Inferior 1 (process 1320473) detached]

Reported using DrKonqi
Comment 1 Daniel Vrátil 2023-10-13 13:06:45 UTC
Could you please describe how exactly are you trying to forward an event? Thanks
Comment 2 Thomas Monjalon 2023-10-13 13:19:54 UTC
In Korganizer, I do a right-clik on an event and choose "send as iCalendar".
Then I choose the recipient, click OK,
and it crashes.
Comment 3 Bug Janitor Service 2023-10-17 19:34:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/korganizer/-/merge_requests/106
Comment 4 Daniel Vrátil 2023-10-17 19:39:05 UTC
Git commit e28baf6ff1290edbc8e5771400fe87c81dbc8fea by Daniel Vrátil.
Committed on 17/10/2023 at 21:30.
Pushed by dvratil into branch 'release/23.08'.

Fix crash when forwarding incidence via context menu

The MailClient inside ITIPHandler may work asynchronously, causing the
ITIPHandler inside the KOEVentPopupMenu to go out-of-scope and be
destroyed before the async operation in the MailClient finishes. Since
MailClient relies on a factory object owned by the ITIPHandler, if the
ITIPHandler gets destroyed before the MailClient finishes, it will
delete the factory object causing use-after-free when the async
operation in MailClient is finally done.
FIXED-IN: 23.08.3

M  +6    -3    src/koeventpopupmenu.cpp

https://invent.kde.org/pim/korganizer/-/commit/e28baf6ff1290edbc8e5771400fe87c81dbc8fea