Project

General

Profile

Actions

Bug #13949

closed

rados.py uses string_at, leaks string memory

Added by Dan Mick over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
-
Category:
librados
Target version:
-
% Done:

0%

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

Description

It looks to me very much like ctypes.string_at() allocates new memory for the string; in the case of xattrs, at least, that string memory was malloced in librados, and string_at without free means the librados copy is a leak.

There are several places where string_at is called, and I suspect they're all leaks.

Actions #1

Updated by Samuel Just over 8 years ago

  • Priority changed from Normal to Urgent
Actions #2

Updated by Kefu Chai over 8 years ago

  • Status changed from New to Need More Info

It looks to me very much like ctypes.string_at() allocates new memory for the string; in the case of xattrs, at least, that string memory was malloced in librados, and string_at without free means the librados copy is a leak.

Dan, ctypes.string_at() does allocate new memory chunk. but it is wrapped using a PyStringObject, like other PyObjects, it is refcounted, so presumably, it is also managed by the gc of python, or do you observe some visible leak when using the rados python binding?

Actions #3

Updated by Samuel Just about 8 years ago

It sounds like this may not matter due to a ctypes recoding?

Actions #4

Updated by Josh Durgin about 8 years ago

  • Status changed from Need More Info to Closed

string_at is no longer used since the conversion to cython.

Actions

Also available in: Atom PDF