Skip to content
Commit 7f104d75 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Fix a crash due to weird refcount messup during stack unwinding

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.

Reviewers: #kde_pim, vkrause

Reviewed By: #kde_pim, vkrause

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D21456
parent 8f230d7d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment