Project

General

Profile

Actions

Bug #10425

closed

RadosClient::connect leaks Objecter if called twice

Added by Loïc Dachary over 9 years ago. Updated about 9 years ago.

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

0%

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

Description

http://workbench.dachary.org/ceph/ceph/blob/giant/src/librados/RadosClient.cc#L226

If RadosClient::connect is called a second time (maybe after fixing an error condition), the Objecter allocated by the first call will be leaked.


Files

20150121_10425_fix_v1.patch (1.06 KB) 20150121_10425_fix_v1.patch Radoslaw Zarzynski, 01/21/2015 12:04 PM
Actions #1

Updated by Radoslaw Zarzynski over 9 years ago

I am working on this bug.

Actions #2

Updated by Loïc Dachary over 9 years ago

  • Status changed from 12 to In Progress
  • Assignee set to Loïc Dachary

Cool, thanks. I assign it to myself to track this, let me know if you need any help.

Actions #3

Updated by Radoslaw Zarzynski over 9 years ago

I am attaching the first proposal of patch for your review.

Besides rectifying the Objecter leak, two additional things have been done in the body of RadosClient::connect method:
  1. Switch from throwing variant of “new” to the non-throwing one. I think that handling memory allocation problems via std::bad_alloc exception was unintentional behavior, especially due to the usage of ENOMEM return code across the whole method. It might lead to stuck in CONNECTING state in some circumstances.
  2. Leak of Messenger instance. The issue is very similar to the main problem so I am proposing to fix it together.

Could you please tell me about guard (objecter != NULL) on RadosClient::wait_for_osdmap method? Does the check need to base on assumption about objecter? Maybe the explicit state verification (like in other methods of the class) should be performed?

Actions #6

Updated by Loïc Dachary about 9 years ago

  • Backport set to dumpling,firefly
Actions #7

Updated by Loïc Dachary about 9 years ago

  • Status changed from In Progress to 7
Actions #8

Updated by Loïc Dachary about 9 years ago

  • Status changed from 7 to Pending Backport
Actions #9

Updated by Loïc Dachary about 9 years ago

  • Backport changed from dumpling,firefly to firefly

dumpling is end of life

Actions #10

Updated by Loïc Dachary about 9 years ago

1b26672 librados: fix resources leakage in RadosClient::connect(). (in firefly),

Actions #11

Updated by Loïc Dachary about 9 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF