Bug 1325107

Summary: [abrt] trojita: QLinkedList<Imap::Commands::Command>::detach(): trojita killed by SIGSEGV
Product: [Fedora] Fedora Reporter: Karel Volný <kvolny>
Component: qt5-qtbaseAssignee: Than Ngo <than>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: jgrulich, jkt, jreznik, kde-sig, ovasik, projects.rg, rdieter, than
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/33ebf1f06f4842c95a497393bd54a590df7b6d21
Whiteboard: abrt_hash:2e166b7501e8738d476d019ffba38cc93e5a505a;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 19:52:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: core_backtrace
none
File: dso_list
none
File: environ
none
File: limits
none
File: maps
none
File: mountinfo
none
File: namespaces
none
File: open_fds
none
File: proc_pid_status
none
File: var_log_messages none

Description Karel Volný 2016-04-08 09:25:44 UTC
Version-Release number of selected component:
trojita-0.6-1.fc23

Additional info:
reporter:       libreport-2.6.4
backtrace_rating: 4
cmdline:        /usr/bin/trojita
crash_function: QLinkedList<Imap::Commands::Command>::detach
executable:     /usr/bin/trojita
global_pid:     4560
kernel:         4.4.6-301.fc23.x86_64
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (10 frames)
 #0 QLinkedList<Imap::Commands::Command>::detach at /usr/include/qt5/QtCore/qlinkedlist.h:99
 #1 QLinkedList<Imap::Commands::Command>::append at /usr/include/qt5/QtCore/qlinkedlist.h:366
 #2 Imap::Parser::queueCommand at /usr/src/debug/trojita-0.6/src/Imap/Parser/Parser.cpp:614
 #3 Imap::Parser::list at /usr/src/debug/trojita-0.6/src/Imap/Parser/Parser.cpp:241
 #4 Imap::Mailbox::ListChildMailboxesTask::perform at /usr/src/debug/trojita-0.6/src/Imap/Tasks/ListChildMailboxesTask.cpp:81
 #5 Imap::Mailbox::ImapTask::_completed at /usr/src/debug/trojita-0.6/src/Imap/Tasks/ImapTask.cpp:230
 #6 Imap::Mailbox::GetAnyConnectionTask::perform at /usr/src/debug/trojita-0.6/src/Imap/Tasks/GetAnyConnectionTask.cpp:98
 #7 Imap::Mailbox::Model::runReadyTasks at /usr/src/debug/trojita-0.6/src/Imap/Model/Model.cpp:1517
 #8 Imap::Mailbox::Model::qt_static_metacall at /usr/src/debug/trojita-0.6/moc_Model.cpp:326
 #9 QObject::event at kernel/qobject.cpp:1256

Comment 1 Karel Volný 2016-04-08 09:25:49 UTC
Created attachment 1145051 [details]
File: backtrace

Comment 2 Karel Volný 2016-04-08 09:25:50 UTC
Created attachment 1145052 [details]
File: cgroup

Comment 3 Karel Volný 2016-04-08 09:25:52 UTC
Created attachment 1145053 [details]
File: core_backtrace

Comment 4 Karel Volný 2016-04-08 09:25:53 UTC
Created attachment 1145054 [details]
File: dso_list

Comment 5 Karel Volný 2016-04-08 09:25:54 UTC
Created attachment 1145055 [details]
File: environ

Comment 6 Karel Volný 2016-04-08 09:25:56 UTC
Created attachment 1145056 [details]
File: limits

Comment 7 Karel Volný 2016-04-08 09:25:58 UTC
Created attachment 1145057 [details]
File: maps

Comment 8 Karel Volný 2016-04-08 09:25:59 UTC
Created attachment 1145058 [details]
File: mountinfo

Comment 9 Karel Volný 2016-04-08 09:26:00 UTC
Created attachment 1145059 [details]
File: namespaces

Comment 10 Karel Volný 2016-04-08 09:26:01 UTC
Created attachment 1145060 [details]
File: open_fds

Comment 11 Karel Volný 2016-04-08 09:26:03 UTC
Created attachment 1145061 [details]
File: proc_pid_status

Comment 12 Karel Volný 2016-04-08 09:26:04 UTC
Created attachment 1145062 [details]
File: var_log_messages

Comment 13 Jan Kundrát 2016-04-08 11:02:23 UTC
Can you reproduce this with valgrind attached?

The segfault happens in code which enqueues IMAP commands. Based on my past experience, this usually happened when some object (an IMAP connection in this case, maybe?) is already freed, but something still accesses it (a classic use-after-free).

Of course I've never seen a crash like this particular one in a few years, so I don't know how to reproduce it. Were you doing something fancy? Was there a network reconnect? (Our tests hammer such a situation already, but it's possible that there's some failure.)

RaphGro mentioned a possibility of some behavior change triggered by upstream Qt. Unless it affects signal delivery with queued connections, I don't think this is a Qt bug, but on the other hand, I've seen KDE patches working around delayed signal delivery in some contexts.

Comment 14 Rex Dieter 2016-04-08 16:39:39 UTC
https://phabricator.kde.org/D1314  implies "Workaround problems with Qt::QueuedConnection" problem with Qt-5.6

Comment 15 Raphael Groner 2016-04-21 13:43:21 UTC
The backtrace has nothing to do with Qt::QueuedConnection as assumed in comment #14. It's a bug with QLinkedList in QtCore. The function detach is not documented but called inside the header as inline function and accesses a bogus pointer (uninitialized?).
https://github.com/qtproject/qtbase/blob/dev/src/corelib/tools/qlinkedlist.h#L384
https://github.com/qtproject/qtbase/blob/dev/src/corelib/tools/qlinkedlist.h#L105
http://doc.qt.io/qt-5/qlinkedlist.html#append

Comment 16 Jan Kundrát 2016-04-21 14:29:40 UTC
(In reply to Raphael Groner from comment #15)
> It's a bug with QLinkedList in QtCore

My hypothesis is that the QLinkedList has been already freed, or that something has corrupted memory. If it's been already freed, it's a question how come that we use that memory after free; I haven't seen this report before, and this part of the code is not regularly changed. I doubt I'll be able to understand this without valgrind's output.

Comment 17 Karel Volný 2016-04-22 14:32:57 UTC
(In reply to Jan Kundrát from comment #13)
> Can you reproduce this with valgrind attached?

well, unfortunately, I don't know how to reproduce, and running with Valgrind all the time isn't something I'd like to try

but yes, it might have to do something with interrupted connections ...

Comment 18 Fedora End Of Life 2016-11-25 07:17:35 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 19 Fedora End Of Life 2016-12-20 19:52:02 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.