[
https://issues.apache.org/jira/browse/TS-4956?focusedWorklogId=30425&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-30425
]
ASF GitHub Bot logged work on TS-4956:
--------------------------------------
Author: ASF GitHub Bot
Created on: 11/Oct/16 20:11
Start Date: 11/Oct/16 20:11
Worklog Time Spent: 10m
Work Description: Github user jacksontj commented on a diff in the pull
request:
https://github.com/apache/trafficserver/pull/1095#discussion_r82878003
--- Diff: iocore/hostdb/test_RefCountCache.cc ---
@@ -135,8 +135,6 @@ testRefcounting()
cache->put(1, to_delete);
ret |= to_delete->refcount() != 1;
cache->erase(1);
- ret |= to_delete->refcount() != 0;
--- End diff --
Since the memory is actually getting freed we should figure out a way to
test that it was in fact deleted. An alternative is maybe to have it update a
global map of key -> bool for things that where deleted? then we could simply
do a get and ensure its not in the map. (something to replace the test instead
of dropping it. Or maybe a global atomic for number of active ExampleStruct
objects
Issue Time Tracking
-------------------
Worklog Id: (was: 30425)
Time Spent: 20m (was: 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: 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)