D21456: Fix a crash due to weird refcount messup during stack unwinding

Daniel Vrátil noreply at phabricator.kde.org
Tue May 28 11:48:02 BST 2019


dvratil created this revision.
Herald added a project: KDE PIM.
Herald added a subscriber: kde-pim.
dvratil requested review of this revision.

REVISION SUMMARY
  My Akonadi Server has been crashing repeatadly whenever an exception was
  thrown inside a handler. The crash was due to memory corruption when
  stack unwinding caused the refcount of the "cmd" shared pointer to get
  messed up which lead to double-free corruption.
  
  The problem seems to be in the capture-by-value of the shared pointer in the
  lambda, but I do not exactly understand what causes the problem, neither
  was I able to produce a minimal reproducer case.
  
  We can safely capture the shared pointer by reference, we don't keep a
  reference to the functor anywhere.

REPOSITORY
  R165 Akonadi

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

AFFECTED FILES
  src/server/connection.cpp

To: dvratil
Cc: kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190528/a3c1c1a4/attachment.html>


More information about the kde-pim mailing list