reset() can race with shutdown() leading to a use-after-free on the
'logger' object.
Fixes: https://tracker.ceph.com/issues/48386
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit
cc295d1c87552eb76b9188d88d7e6ab2f3108149)
Conflicts:
src/mon/Paxos.h
- stable branch has slightly different Paxos and get_name function declarations
finish_contexts(g_ceph_context, committing_finishers, -ECANCELED);
if (logger)
g_ceph_context->get_perfcounters_collection()->remove(logger);
- delete logger;
}
void Paxos::leader_init()
* @param name A name for the paxos service. It serves as the naming space
* of the underlying persistent storage for this service.
*/
- Paxos(Monitor *m, const string &name)
+ Paxos(Monitor *m, const string &name)
: mon(m),
logger(NULL),
paxos_name(name),
clock_drift_warned(0),
trimming(false) { }
+ ~Paxos() {
+ delete logger;
+ }
+
const string get_name() const {
return paxos_name;
}