zwoop edited a comment on pull request #8615:
URL: https://github.com/apache/trafficserver/pull/8615#issuecomment-1062477060


   I *think* I'm seeing a memory leak with this patch, either we're leaking the 
MD5Context (and not calling the destructor), or we're leaking something else. 
Also, it seems incredibly unfortunate that it has to call malloc() on every 
cache key generation now, doesn't it ?
   
   ```
   ==2847515== 1,420,696 (460,896 direct, 959,800 indirect) bytes in 9,602 
blocks are definitely lost in loss record 1,518 of 1,528
   ==2847515==    at 0x4842839: malloc (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
   ==2847515==    by 0x4C3C99D: CRYPTO_zalloc (in 
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
   ==2847515==    by 0x48A7FC4: MD5Context 
(apache/trafficserver/include/tscore/MD5.h:38)
   ==2847515==    by 0x48A7FC4: ats::CryptoContext::CryptoContext() 
(apache/trafficserver/src/tscore/CryptoHash.cc:48)
   ==2847515==    by 0x666908: url_CryptoHash_get(URLImpl const*, 
ats::CryptoHash*, long) (apache/trafficserver/proxy/hdrs/URL.cc:1850)
   ==2847515==    by 0x56EA6D: hash_get 
(apache/trafficserver/proxy/hdrs/URL.h:495)
   ==2847515==    by 0x56EA6D: generate_key 
(apache/trafficserver/iocore/cache/P_CacheInternal.h:1037)
   ==2847515==    by 0x56EA6D: HttpSM::do_cache_lookup_and_read() 
(apache/trafficserver/proxy/http/HttpSM.cc:4768)
   ==2847515==    by 0x554FE1: HttpSM::state_read_client_request_header(int, 
void*) (apache/trafficserver/proxy/http/HttpSM.cc:0)
   ==2847515==    by 0x55372D: HttpSM::main_handler(int, void*) 
(apache/trafficserver/proxy/http/HttpSM.cc:0)
   ==2847515==    by 0x553A8F: do_api_callout 
(apache/trafficserver/proxy/http/HttpSM.cc:421)
   ==2847515==    by 0x553A8F: HttpSM::state_add_to_list(int, void*) 
(apache/trafficserver/proxy/http/HttpSM.cc:448)
   ==2847515==    by 0x5544E8: HttpSM::attach_client_session(ProxyTransaction*) 
(apache/trafficserver/proxy/http/HttpSM.cc:617)
   ==2847515==    by 0x540664: Http1ClientSession::new_transaction() 
(apache/trafficserver/proxy/http/Http1ClientSession.cc:472)
   ==2847515==    by 0x540253: Http1ClientSession::state_keep_alive(int, void*) 
(apache/trafficserver/proxy/http/Http1ClientSession.cc:381)
   ==2847515==    by 0x75D4BD: handleEvent 
(apache/trafficserver/iocore/eventsystem/I_Continuation.h:219)
   ==2847515==    by 0x75D4BD: read_signal_and_update(int, UnixNetVConnection*) 
(apache/trafficserver/iocore/net/UnixNetVConnection.cc:82)
   ```
   
   I ran about 10k requests through here, and a similar leak happens a few 
hundred times as well, so fairly certain there's exactly one MD5context related 
leak for each request.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to