Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4956

Memory leaks in hostdb test

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 7.1.0
    • HostDB
    • None

    Description

      Memory leaks in hostdb test and there was an issue with the RefCountCache destructor.

      ==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).
      

      Attachments

        Issue Links

          Activity

            People

              bcall Bryan Call
              bcall Bryan Call
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m