<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>439991</bug_id>
          
          <creation_ts>2021-07-18 06:56:30 +0000</creation_ts>
          <short_desc>akonadi_imap_resource crashes when I open the account settings</short_desc>
          <delta_ts>2021-07-29 08:21:52 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>Akonadi</product>
          <component>IMAP resource</component>
          <version>unspecified</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>drkonqi</keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kishore Gopalakrishnan">kishore96</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>f.baumg</cc>
          
          <cf_commitlink>https://invent.kde.org/pim/kdepim-runtime/commit/8f7520ed17f96b7eaddc50ec314eca30509d1e6b</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2047532</commentid>
    <comment_count>0</comment_count>
    <who name="Kishore Gopalakrishnan">kishore96</who>
    <bug_when>2021-07-18 06:56:30 +0000</bug_when>
    <thetext>Application: akonadi_imap_resource (5.17.80 (21.08.0))

Qt Version: 5.15.2
Frameworks Version: 5.84.0
Operating System: Linux 5.10.50-1-lts x86_64
Windowing System: X11
Drkonqi Version: 5.22.3
Distribution: Arch Linux

-- Information about the crash:
- What I was doing when the application crashed:
1. Open Kmail
2. Go to the top-level item in the sidebar corresponding to your email account, and right-click on it
3. Click &apos;Account Settings&apos;

Every time I do this, I get a notification saying &apos;$name_of_email_account has closed unexpectedly&apos;. 

- Other information:
1. The crash is reproducible with both Gmail and non-Gmail IMAP accounts.
2. The &apos;Account Settings&apos; option works correctly on the &apos;Local folders&apos; item.
3. The crash does not happen if I downgrade all &apos;KDE Applications&apos; to 21.04.3.

The crash can be reproduced every time.

-- Backtrace:
Application: Google Mail (kishore96) (akonadi_imap_resource), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f89bd940e3b in std::__uniq_ptr_impl&lt;KPasswordLineEditPrivate, std::default_delete&lt;KPasswordLineEditPrivate&gt; &gt;::_M_ptr() const (this=&lt;optimized out&gt;) at /usr/include/c++/11.1.0/bits/unique_ptr.h:173
#5  std::unique_ptr&lt;KPasswordLineEditPrivate, std::default_delete&lt;KPasswordLineEditPrivate&gt; &gt;::get() const (this=&lt;optimized out&gt;) at /usr/include/c++/11.1.0/bits/unique_ptr.h:422
#6  std::unique_ptr&lt;KPasswordLineEditPrivate, std::default_delete&lt;KPasswordLineEditPrivate&gt; &gt;::operator-&gt;() const (this=&lt;optimized out&gt;) at /usr/include/c++/11.1.0/bits/unique_ptr.h:416
#7  KPasswordLineEdit::setRevealPasswordAvailable(bool) (this=this@entry=0x0, reveal=true) at /usr/src/debug/kwidgetsaddons-5.84.0/src/kpasswordlineedit.cpp:141
#8  0x000055a183708f23 in SetupServer::SetupServer(ImapResourceBase*, unsigned long long) (this=this@entry=0x55a183e7ef70, parentResource=parentResource@entry=0x7ffdbd7b6860, parent=parent@entry=218103854) at /home/kishore/build/build/kdepim-runtime/src/kdepim-runtime-21.07.80/resources/imap/setupserver.cpp:123
#9  0x000055a183700b54 in ImapResource::createConfigureDialog(unsigned long long) (this=0x7ffdbd7b6860, windowId=218103854) at /home/kishore/build/build/kdepim-runtime/src/kdepim-runtime-21.07.80/resources/imap/imapresource.cpp:62
#10 0x000055a183732ef1 in ImapResourceBase::configure(unsigned long long) (this=0x7ffdbd7b6860, windowId=&lt;optimized out&gt;) at /home/kishore/build/build/kdepim-runtime/src/kdepim-runtime-21.07.80/resources/imap/imapresourcebase.cpp:204
#11 0x00007f89be143243 in Akonadi__ControlAdaptor::qt_metacall(QMetaObject::Call, int, void**) (this=0x7f89ac005060, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffdbd7b61f0) at /usr/src/debug/build/src/agentbase/controladaptor.moc:176
#12 0x00007f89bc87d590 in QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&amp;, QVector&lt;int&gt; const&amp;, int) (this=&lt;optimized out&gt;, object=&lt;optimized out&gt;, msg=&lt;optimized out&gt;, metaTypes=&lt;optimized out&gt;, slotIdx=&lt;optimized out&gt;) at ../../include/QtCore/../../src/corelib/tools/qvarlengtharray.h:190
#13 0x00007f89bc8810b3 in QDBusConnectionPrivate::activateCall(QObject*, int, QDBusMessage const&amp;) (this=this@entry=0x7f89a800bf70, object=0x7f89ac005060, flags=flags@entry=273, msg=...) at qdbusintegrator.cpp:904
#14 0x00007f89bc881ae1 in QDBusConnectionPrivate::activateCall(QObject*, int, QDBusMessage const&amp;) (msg=..., flags=273, object=&lt;optimized out&gt;, this=0x7f89a800bf70) at qdbusintegrator.cpp:853
#15 QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&amp;, QDBusMessage const&amp;, int) (this=0x7f89a800bf70, node=..., msg=..., pathStartPos=&lt;optimized out&gt;) at qdbusintegrator.cpp:1497
#16 0x00007f89bc883f8c in QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f899803b240) at qdbusintegrator.cpp:1617
#17 0x00007f89bc5e5047 in QObject::event(QEvent*) (this=0x7ffdbd7b6860, e=0x7f899803b240) at kernel/qobject.cpp:1314
#18 0x00007f89bd19eff6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=&lt;optimized out&gt;, receiver=0x7ffdbd7b6860, e=0x7f899803b240) at kernel/qapplication.cpp:3632
#19 0x00007f89bc5b71aa in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x7ffdbd7b6860, event=0x7f899803b240) at kernel/qcoreapplication.cpp:1064
#20 0x00007f89bc5ba359 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55a183c6d260) at kernel/qcoreapplication.cpp:1821
#21 0x00007f89bc6114b8 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55a183d3dc70) at kernel/qeventdispatcher_glib.cpp:277
#22 0x00007f89bb43410c in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#23 0x00007f89bb487b99 in  () at /usr/lib/libglib-2.0.so.0
#24 0x00007f89bb431871 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#25 0x00007f89bc610aca in QEventDispatcherGlib::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) (this=0x55a183d40910, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#26 0x00007f89bc5b5a5b in QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) (this=this@entry=0x7ffdbd7b67d0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#27 0x00007f89bc5be248 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#28 0x00007f89bca892e2 in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1867
#29 0x00007f89bd19ef6a in QApplication::exec() () at kernel/qapplication.cpp:2824
#30 0x00007f89be126cad in Akonadi::ResourceBase::init(Akonadi::ResourceBase&amp;) (r=...) at /usr/src/debug/akonadi-21.07.80/src/agentbase/resourcebase.cpp:563
#31 0x000055a18370077c in Akonadi::ResourceBase::init&lt;ImapResource&gt;(int, char**) (argc=&lt;optimized out&gt;, argv=0x7ffdbd7b6860) at /usr/include/KF5/AkonadiAgentBase/resourcebase.h:182
#32 0x00007f89bbf1cb25 in __libc_start_main () at /usr/lib/libc.so.6
#33 0x000055a1836fd9de in _start ()
[Inferior 1 (process 67419) detached]

Possible duplicates by query: bug 428358, bug 425651, bug 418844, bug 418707, bug 413349.

Reported using DrKonqi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2048747</commentid>
    <comment_count>1</comment_count>
    <who name="Kishore Gopalakrishnan">kishore96</who>
    <bug_when>2021-07-25 08:30:25 +0000</bug_when>
    <thetext>I did a git bisect. Reverting the mentioned commit fixes the issue.

18bc7e4361f1c0de505af7e9e5cbb09d61b1a503 is the first bad commit
commit 18bc7e4361f1c0de505af7e9e5cbb09d61b1a503
Author: Laurent Montel &lt;montel@kde.org&gt;
Date:   Thu Jun 24 13:55:38 2021 +0200

    Honor KDE Kiosk setting lineedit_reveal_password

 resources/dav/resource/settings.cpp               |  2 ++
 resources/dav/resource/setupwizard.cpp            |  2 ++
 resources/dav/resource/urlconfigurationdialog.cpp |  2 ++
 resources/etesync/setupwizard.cpp                 |  2 ++
 resources/ews/ewsconfigdialog.cpp                 |  2 ++
 resources/ews/ewssettings.cpp                     |  5 +++++
 resources/imap/settingspasswordrequester.cpp      | 10 +++++++---
 resources/imap/setupserver.cpp                    |  3 +++
 resources/pop3/accountwidget.cpp                  |  5 +++--
 resources/pop3/pop3resource.cpp                   |  5 +++++
 10 files changed, 33 insertions(+), 5 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2049480</commentid>
    <comment_count>2</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2021-07-29 07:24:07 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/30</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2049484</commentid>
    <comment_count>3</comment_count>
    <who name="brainpower">f.baumg</who>
    <bug_when>2021-07-29 08:21:00 +0000</bug_when>
    <thetext>Git commit d47c29c4d6d48688eed665ff4a2837db6bce70bb by Franz Baumgärtner.
Committed on 29/07/2021 at 08:03.
Pushed by mlaurent into branch &apos;master&apos;.

fix UI elements being used before initialization

commit 18bc7e43 introduced calls to setRevealPasswordAvailable() on
password fields.

those calls happened before m_ui-&gt;password and m_ui-&gt;customPassword
were initialized by the call to m_ui-&gt;setupUI(),
and led to a crash when trying to open the settings of an IMAP account.

M  +2    -2    resources/imap/setupserver.cpp

https://invent.kde.org/pim/kdepim-runtime/commit/d47c29c4d6d48688eed665ff4a2837db6bce70bb</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2049485</commentid>
    <comment_count>4</comment_count>
    <who name="Laurent Montel">montel</who>
    <bug_when>2021-07-29 08:21:52 +0000</bug_when>
    <thetext>Git commit 8f7520ed17f96b7eaddc50ec314eca30509d1e6b by Laurent Montel, on behalf of Franz Baumgärtner.
Committed on 29/07/2021 at 08:21.
Pushed by mlaurent into branch &apos;release/21.08&apos;.

fix UI elements being used before initialization

commit 18bc7e43 introduced calls to setRevealPasswordAvailable() on
password fields.

those calls happened before m_ui-&gt;password and m_ui-&gt;customPassword
were initialized by the call to m_ui-&gt;setupUI(),
and led to a crash when trying to open the settings of an IMAP account.
(cherry picked from commit d47c29c4d6d48688eed665ff4a2837db6bce70bb)

M  +2    -2    resources/imap/setupserver.cpp

https://invent.kde.org/pim/kdepim-runtime/commit/8f7520ed17f96b7eaddc50ec314eca30509d1e6b</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>