]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
[RGW, memory leak] Memory leak in RGW GC (losing pointer during allocating Ceph-conte...
authorAndrey Kuznetsov <Andrey_Kuznetsov@epam.com>
Thu, 19 Jun 2014 13:59:31 +0000 (17:59 +0400)
committerferus.tigris@gmail.com <ferus.tigris@gmail.com>
Sun, 29 Jun 2014 18:26:24 +0000 (22:26 +0400)
Memory leaks detector report:
...
==117947== 11,725 (200 direct, 11,525 indirect) bytes in 25 blocks are definitely lost in loss
record 82 of 82
==117947==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==117947==    by 0x687CC1: RGWGC::process(int, int) (in /usr/bin/radosgw)
==117947==    by 0x6884D1: RGWGC::process() (in /usr/bin/radosgw)
==117947==    by 0x68875C: RGWGC::GCWorker::entry() (in /usr/bin/radosgw)
==117947==    by 0x55F890A: Thread::_entry_func(void*) (in /usr/lib64/librados.so.2.0.0)
==117947==    by 0x34D46079D0: start_thread (in /lib64/libpthread-2.12.so)
==117947==    by 0x34D42E8B6C: clone (in /lib64/libc-2.12.so)
...

Signed-off-by: Andrey Kuznetsov <Andrey_Kuznetsov@epam.com>
src/rgw/rgw_gc.cc

index dab07f341abc9d2055f3a95ea2c2b7d4071d643f..a20042d49ebbf7d2dc372f646a6d2d21d9e9e965 100644 (file)
@@ -154,7 +154,7 @@ int RGWGC::process(int index, int max_secs)
 
   string marker;
   bool truncated;
-  IoCtx *ctx = NULL;
+  IoCtx *ctx = new IoCtx;
   do {
     int max = 100;
     std::list<cls_rgw_gc_obj_info> entries;
@@ -167,7 +167,6 @@ int RGWGC::process(int index, int max_secs)
       goto done;
 
     string last_pool;
-    ctx = new IoCtx;
     std::list<cls_rgw_gc_obj_info>::iterator iter;
     for (iter = entries.begin(); iter != entries.end(); ++iter) {
       bool remove_tag;