Project

General

Profile

Bug #57573

intrusive_lru leaking memory when

Added by Ali Maredia about 1 year ago. Updated 12 months ago.

Status:
Pending Backport
Priority:
High
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
backport_processed
Backport:
pacific quincy
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Values allocated during inserts in the lru defined in
src/common/intrusive_lru.h that are
unreferenced are sometimes not freed because evict()
does not delete values unless set.size() > lru_target_size.

For example, this condition is not met if the number
of entries in the intrusive_lru are less than or
equal to lru_target_size at the time of the
intrusive_lru's destruction.

Memory leaks due to the above scenario can be
reproduced if this commit is removed and
unittest_intrusive_lru is run under valgrind.

ex:

valgrind --tool=memcheck --leak-check=yes ./bin/unittest_intrusive_lru


Related issues

Copied to RADOS - Backport #57794: pacific: intrusive_lru leaking memory when New
Copied to RADOS - Backport #57795: quincy: intrusive_lru leaking memory when New

History

#1 Updated by Radoslaw Zarzynski about 1 year ago

  • Status changed from New to In Progress

As I understood:

1. evit() intends to not free too much (which makes sense).
2. The dtor reuses evict() for cleaning (which doesn't make sense).

#2 Updated by Casey Bodley 12 months ago

  • Status changed from In Progress to Pending Backport
  • Assignee deleted (Radoslaw Zarzynski)
  • Backport set to pacific quincy

#3 Updated by Backport Bot 12 months ago

  • Copied to Backport #57794: pacific: intrusive_lru leaking memory when added

#4 Updated by Backport Bot 12 months ago

  • Copied to Backport #57795: quincy: intrusive_lru leaking memory when added

#5 Updated by Backport Bot 12 months ago

  • Tags set to backport_processed

Also available in: Atom PDF