D9189: Do not crash when completion object gets destroyed underneath us

Milian Wolff noreply at phabricator.kde.org
Mon Dec 4 22:33:20 UTC 2017


mwolff created this revision.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.

REVISION SUMMARY
  For some reason the 'Open With' dialog opened by KMail triggers the
  following crash for me:
  
  #0  0x0000555568ea4220 in ?? ()
   #1  0x00007ffff549bd60 in QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType) () from /usr/lib/libQt5Core.so.5
   #2  0x00007ffff71287f4 in KLineEdit::setCompletionObject (this=0x555568ee8c00, comp=0x555568ea1320, handle=<optimized out>)
  
    at /home/milian/projects/kf5/src/frameworks/kcompletion/src/klineedit.cpp:1514
  
  #3  0x00007ffff7113d35 in KComboBox::setLineEdit (this=0x555568ea3ba0, edit=0x555568ee8c00) at /home/milian/projects/kf5/src/frameworks/kcompletion/src/kcombobox.cpp:325
   #4  0x00007ffff784ef63 in KOpenWithDialogPrivate::init (this=0x7fff70240440,
  
    _text="<qt>Select the program you want to use to open the file<br/>DebuggingProfilingWindows-2017-WK50.pdf</qt>", _value="")
    at /home/milian/projects/kf5/src/frameworks/kio/src/widgets/kopenwithdialog.cpp:601
  
  #5  0x00007ffff784f93c in KOpenWithDialog::KOpenWithDialog (this=0x7fffffffba50, _urls=QList<QUrl> = {...}, _text=..., _value="", parent=<optimized out>)
  
    at /home/milian/projects/kf5/src/frameworks/kio/src/widgets/kopenwithdialog.cpp:531
  
  #6  0x00007ffff7862b51 in KRun::displayOpenWithDialog (lst=QList<QUrl> = {...}, window=0x55555599a690, tempFiles=tempFiles at entry=true, suggestedFileName="",
  
    asn=<QArrayData::shared_null+24> "") at /home/milian/projects/kf5/src/frameworks/kio/src/widgets/krun.cpp:267
  
  Guard against it by using a QPointer to check whether the completion
  object gets destroyed before we want to use it again.
  
  Sadly WebEngine in KMail prevents me from using Valgrind, so I have
  not yet figured out where exactly the deletion is coming from. That
  said, this fix should make this working again with minimal impact.

REPOSITORY
  R284 KCompletion

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D9189

AFFECTED FILES
  src/kcombobox.cpp

To: mwolff
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171204/462e7d4f/attachment.html>


More information about the Kde-frameworks-devel mailing list