Bug 374457 - Unsafe iteration in void Model::responseReceived()
Summary: Unsafe iteration in void Model::responseReceived()
Status: RESOLVED WORKSFORME
Alias: None
Product: trojita
Classification: Unmaintained
Component: IMAP (show other bugs)
Version: git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-02 12:37 UTC by Jan Kundrát
Modified: 2022-11-29 05:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kundrát 2017-01-02 12:37:02 UTC
Here's a real segfault, possibly triggered by network reconnects:

Thread 1 "trojita" received signal SIGSEGV, Segmentation fault.
QMapNodeBase::nextNode (this=0x31e7280) at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/tools/qmap.cpp:58
58      /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/tools/qmap.cpp: No such file or directory.
(gdb) bt
#0  QMapNodeBase::nextNode (this=0x31e7280) at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/tools/qmap.cpp:58
#1  0x00000000005747f3 in QMapNodeBase::nextNode (this=0x31e7280) at /usr/include/qt5/QtCore/qmap.h:96
#2  QMapNode<Imap::Parser*, Imap::Mailbox::ParserState>::nextNode (this=0x31e7280) at /usr/include/qt5/QtCore/qmap.h:124
#3  QMap<Imap::Parser*, Imap::Mailbox::ParserState>::iterator::operator++ (this=<optimized out>) at /usr/include/qt5/QtCore/qmap.h:432
#4  Imap::Mailbox::Model::responseReceived (this=<optimized out>) at /home/jkt/work/prog/trojita/src/Imap/Model/Model.cpp:147
#5  0x00007ffff3416a9a in QObject::event (this=0xae7fe0, e=<optimized out>)
    at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/kernel/qobject.cpp:1263
#6  0x00007ffff3cae394 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0xae7fe0, e=0x19543f0)
    at /var/tmp/portage/dev-qt/qtwidgets-5.7.9999/work/qtwidgets-5.7.9999/src/widgets/kernel/qapplication.cpp:3799
#7  0x00007ffff3cb65a6 in QApplication::notify (this=0x7fffffffd620, receiver=0xae7fe0, e=0x19543f0)
    at /var/tmp/portage/dev-qt/qtwidgets-5.7.9999/work/qtwidgets-5.7.9999/src/widgets/kernel/qapplication.cpp:3556
#8  0x00007ffff33e6bd8 in QCoreApplication::notifyInternal2 (receiver=0xae7fe0, event=event@entry=0x19543f0)
    at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/kernel/qcoreapplication.cpp:988
#9  0x00007ffff33e98e7 in QCoreApplication::sendEvent (event=0x19543f0, receiver=<optimized out>)
    at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/kernel/qcoreapplication.h:231
#10 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x941fb0)
    at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/kernel/qcoreapplication.cpp:1649
#11 0x00007ffff33e9ebe in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0)
    at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/kernel/qcoreapplication.cpp:1503
#12 0x00007ffff3440499 in postEventSourceDispatch (s=0x998770)
    at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:276
#13 0x00007fffedf7980c in g_main_dispatch (context=0x7fffe00016f0) at /var/tmp/portage/dev-libs/glib-2.48.2/work/glib-2.48.2/glib/gmain.c:3154
#14 g_main_context_dispatch (context=context@entry=0x7fffe00016f0) at /var/tmp/portage/dev-libs/glib-2.48.2/work/glib-2.48.2/glib/gmain.c:3769
#15 0x00007fffedf79b18 in g_main_context_iterate (context=context@entry=0x7fffe00016f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.48.2/work/glib-2.48.2/glib/gmain.c:3840
#16 0x00007fffedf79c21 in g_main_context_iteration (context=0x7fffe00016f0, may_block=1) at /var/tmp/portage/dev-libs/glib-2.48.2/work/glib-2.48.2/glib/gmain.c:3901
#17 0x00007ffff344054d in QEventDispatcherGlib::processEvents (this=0x9b5c70, flags=...)
    at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:423
#18 0x00007ffff33e517a in QEventLoop::exec (this=this@entry=0x7fffffffd480, flags=..., flags@entry=...)
    at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/kernel/qeventloop.cpp:212
#19 0x00007ffff33ee116 in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.7.9999/work/qtcore-5.7.9999/src/corelib/kernel/qcoreapplication.cpp:1261
#20 0x0000000000443758 in main (argc=<optimized out>, argv=<optimized out>) at /home/jkt/work/prog/trojita/src/Gui/main.cpp:214

IMHO that generic responseReceived() should not exist -- it seems that we should always know about what connection any response belongs to.
Comment 1 Justin Zobel 2022-10-30 00:37:47 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 2 Bug Janitor Service 2022-11-14 05:15:17 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Bug Janitor Service 2022-11-29 05:18:45 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!