[ 
https://issues.apache.org/jira/browse/TS-4956?focusedWorklogId=30503&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-30503
 ]

ASF GitHub Bot logged work on TS-4956:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Oct/16 16:47
            Start Date: 12/Oct/16 16:47
    Worklog Time Spent: 10m 
      Work Description: Github user jpeach commented on a diff in the pull 
request:

    https://github.com/apache/trafficserver/pull/1095#discussion_r83048541
  
    --- Diff: iocore/hostdb/test_RefCountCache.cc ---
    @@ -264,7 +272,20 @@ main()
       // printf("Sync return: %d\n", cache->sync_all());
     
       printf("TestRun: %d\n", ret);
    -  exit(ret);
    +
    +  delete cache;
    +
    +  return ret;
    +}
    +
    +int main() {
    +  int ret = test();
    +
    +  for (const auto item: ExampleStruct::items_freed) {
    +    printf("really freeing: %p\n", item);
    +    ::free(item);
    --- End diff --
    
    You still ought to call the destructor when you free.


Issue Time Tracking
-------------------

    Worklog Id:     (was: 30503)
    Time Spent: 1h 20m  (was: 1h 10m)

> Memory leaks in hostdb test
> ---------------------------
>
>                 Key: TS-4956
>                 URL: https://issues.apache.org/jira/browse/TS-4956
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: HostDB
>            Reporter: Bryan Call
>            Assignee: Bryan Call
>             Fix For: 7.1.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Memory leaks in hostdb test and there was an issue with the RefCountCache 
> destructor.
> {noformat}
> ==18648==ERROR: LeakSanitizer: detected memory leaks
> Direct leak of 96 byte(s) in 1 object(s) allocated from:
>     #0 0x7f5e41866ea0 in operator new(unsigned long) 
> (/lib64/libasan.so.3+0xc7ea0)
>     #1 0x415c36 in testRefcounting() 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:130
>     #2 0x40f066 in main 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:206
>     #3 0x7f5e3eadf730 in __libc_start_main (/lib64/libc.so.6+0x20730)
> Direct leak of 31 byte(s) in 1 object(s) allocated from:
>     #0 0x7f5e41865e60 in malloc (/lib64/libasan.so.3+0xc6e60)
>     #1 0x4179ab in ExampleStruct::alloc(int) 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:48
>     #2 0x4179ab in fillCache(RefCountCache<ExampleStruct>*, int, int) 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:81
>     #3 0x40f3bd in main 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:229
>     #4 0x7f5e3eadf730 in __libc_start_main (/lib64/libc.so.6+0x20730)
> Direct leak of 24 byte(s) in 1 object(s) allocated from:
>     #0 0x7f5e41865e60 in malloc (/lib64/libasan.so.3+0xc6e60)
>     #1 0x415c6b in ExampleStruct::alloc(int) 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:48
>     #2 0x415c6b in testRefcounting() 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:133
>     #3 0x40f066 in main 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:206
>     #4 0x7f5e3eadf730 in __libc_start_main (/lib64/libc.so.6+0x20730)
> Direct leak of 24 byte(s) in 1 object(s) allocated from:
>     #0 0x7f5e41865e60 in malloc (/lib64/libasan.so.3+0xc6e60)
>     #1 0x415eee in ExampleStruct::alloc(int) 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:48
>     #2 0x415eee in testRefcounting() 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:142
>     #3 0x40f066 in main 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:206
>     #4 0x7f5e3eadf730 in __libc_start_main (/lib64/libc.so.6+0x20730)
> Indirect leak of 1120 byte(s) in 4 object(s) allocated from:
>     #0 0x7f5e41865e60 in malloc (/lib64/libasan.so.3+0xc6e60)
>     #1 0x7f5e4156cf85 in ats_malloc 
> /home/bcall/dev/apache/trafficserver/lib/ts/ink_memory.cc:59
>     #2 0x411f36 in DefaultAlloc::alloc(int) ../../lib/ts/defalloc.h:34
>     #3 0x411f36 in Vec<TSHashTable<RefCountCacheHashing>::Bucket, 
> DefaultAlloc, 0>::set_expand() ../../lib/ts/Vec.h:781
>     #4 0x411f36 in TSHashTable<RefCountCacheHashing>::TSHashTable(unsigned 
> long) ../../lib/ts/Map.h:1516
>     #5 0x411f36 in 
> RefCountCachePartition<ExampleStruct>::RefCountCachePartition(unsigned int, 
> unsigned long, unsigned int, RecRawStatBlock*) P_RefCountCache.h:166
>     #6 0x411f36 in RefCountCache<ExampleStruct>::RefCountCache(unsigned int, 
> int, int, VersionNumber, std::__cxx11::basic_string<char, 
> std::char_traits<char>, std::allocator<char> >) P_RefCountCache.h:441
>     #7 0x415c46 in testRefcounting() 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:130
>     #8 0x40f066 in main 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:206
>     #9 0x7f5e3eadf730 in __libc_start_main (/lib64/libc.so.6+0x20730)
> Indirect leak of 832 byte(s) in 4 object(s) allocated from:
>     #0 0x7f5e41866ea0 in operator new(unsigned long) 
> (/lib64/libasan.so.3+0xc7ea0)
>     #1 0x411b79 in RefCountCache<ExampleStruct>::RefCountCache(unsigned int, 
> int, int, VersionNumber, std::__cxx11::basic_string<char, 
> std::char_traits<char>, std::allocator<char> >) P_RefCountCache.h:441
>     #2 0x415c46 in testRefcounting() 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:130
>     #3 0x40f066 in main 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:206
>     #4 0x7f5e3eadf730 in __libc_start_main (/lib64/libc.so.6+0x20730)
> Indirect leak of 64 byte(s) in 1 object(s) allocated from:
>     #0 0x7f5e41865e60 in malloc (/lib64/libasan.so.3+0xc6e60)
>     #1 0x7f5e4156cf85 in ats_malloc 
> /home/bcall/dev/apache/trafficserver/lib/ts/ink_memory.cc:59
>     #2 0x41253b in DefaultAlloc::alloc(int) ../../lib/ts/defalloc.h:34
>     #3 0x41253b in Vec<RefCountCachePartition<ExampleStruct>*, DefaultAlloc, 
> 2>::reserve(unsigned long) ../../lib/ts/Vec.h:796
>     #4 0x41253b in RefCountCache<ExampleStruct>::RefCountCache(unsigned int, 
> int, int, VersionNumber, std::__cxx11::basic_string<char, 
> std::char_traits<char>, std::allocator<char> >) P_RefCountCache.h:439
>     #5 0x415c46 in testRefcounting() 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:130
>     #6 0x40f066 in main 
> /home/bcall/dev/apache/trafficserver/iocore/hostdb/test_RefCountCache.cc:206
>     #7 0x7f5e3eadf730 in __libc_start_main (/lib64/libc.so.6+0x20730)
> SUMMARY: AddressSanitizer: 2191 byte(s) leaked in 13 allocation(s).
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to