Project

General

Profile

Actions

Bug #881

closed

confutils: memory leaks

Added by Josh Durgin about 13 years ago. Updated about 13 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Running valgrind --leak-check=yes .libs/lt-testlibrbd reveals several leaks in configuration and initialization. I'm working on the leaks in librados/librbd for #868. Valgrind summary is attached.


Files

valgrind.log (14.2 KB) valgrind.log Josh Durgin, 03/11/2011 04:01 PM
Actions #1

Updated by Colin McCabe about 13 years ago

It would be best to replace those char* in md_config_t with std::string. With all the strdup antics going on, I'm sure there are some leaks. I doubt they're that big, though, since we just run init once and then we're done.

Actions #2

Updated by Colin McCabe about 13 years ago

Taking a closer look at this, it looks like there are some real errors in the ConfUtils class. The other stuff is just bogus warnings that happen because we never free the DoutStreambuf.

Actions #3

Updated by Sage Weil about 13 years ago

  • Subject changed from memory leaks in initialization/configuration to confutils: memory leaks
Actions #4

Updated by Colin McCabe about 13 years ago

  • Assignee set to Colin McCabe
Actions #5

Updated by Colin McCabe about 13 years ago

  • Status changed from New to 4

I re-ran this on the latest code, and I saw a bunch of "potential leaks" related to allocating std::strings in the ConfFile. But these are all bogus because when the ConfFile is destroyed, those strings will all be freed.

I think valgrind is complaining about this because g_conf, a global, is creating a ConfFile. That ConfFile, and the memory inside it, won't be freed until g_conf is destroyed. But since g_conf has the special init_priority(103) attached to it, that happens after every other global has been destroyed. Perhaps valgrind's own analysis is running before that destructor is getting called?

Anyway, these are certainly not real memory leaks. If anyone has any idea how to get rid of these annoying warnings, it would be welcome. However, until then, this bug will have to be closed, or dormant, or something.

Actions #6

Updated by Colin McCabe about 13 years ago

  • Status changed from 4 to Resolved

I don't see any obvious way to get valgrind to stop warning about these "potential leaks" which are not leaks at all. I think this is just something we're going to have to filter out. It only shows up when you run with --leak-check=full

Actions

Also available in: Atom PDF