D15326: Fix segfaults in OutputWidget

Anton Anikin noreply at phabricator.kde.org
Fri Sep 7 10:19:30 BST 2018


antonanikin created this revision.
antonanikin added a reviewer: KDevelop.
Herald added a project: KDevelop.
antonanikin requested review of this revision.

REVISION SUMMARY
  This patch fixes regressions provided by D14931 <https://phabricator.kde.org/D14931>.
  
  Steps to reproduce (my system is neon/bionic with Qt 5.11.1 and KDevelop/master):
  
  1. Start KDevelop and load some project
  2. Start project build
  3. Close KDevelop
  4. On exit segfault happens
  
  Main problems:
  
  1. Incorrect signal processing. OutputWidget::updateFilter() slot is called from parent's destructor when m_tabwidget/m_stackwidget is deleted so we have destroyed m_views hash and segfault as a result.
  
  2. Incorrect QSharedPointer usage. All handled objects have QWidget as a parent so we have double-free problem and and segfault as a result.

TEST PLAN
  Tested on different output widgets (KDevelop::IOutputView::OneView/HistoryView/MultipleView) with no segfaults. All our views/proxies objects are deleted (no memory leaks).

REPOSITORY
  R32 KDevelop

BRANCH
  master

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

AFFECTED FILES
  plugins/standardoutputview/outputwidget.cpp
  plugins/standardoutputview/outputwidget.h

To: antonanikin, #kdevelop
Cc: kdevelop-devel, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180907/664a2702/attachment.html>


More information about the KDevelop-devel mailing list