[squid-dev] NotePairs, SSL and Cert Validation memory leaks

Christos Tsantilas christos at chtsanti.net
Wed Jan 13 14:28:57 UTC 2016


The latest squid-3.5.13 release should include fixes for these leaks.
Which squid version are you using?


On 01/11/2016 07:04 PM, William Lima wrote:
> Hi all,
>
> I have identified those memory leaks in the latest version of Squid 3.5:
>
>   128 (48 direct, 80 indirect) bytes in 1 blocks are definitely lost in loss record 1,875 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x3A59D1: NotePairs::add(char const*, char const*) (Notes.h:211)
>      by 0x563C63: Helper::Reply::parse(char*, unsigned long) (Reply.cc:106)
>      by 0x563D6E: Helper::Reply::Reply(char*, unsigned long) (Reply.cc:23)
>      by 0x33DC72: helperStatefulHandleRead(RefCount<Comm::Connection> const&, char*, unsigned long, Comm::Flag, int, void*) (helper.cc:1000)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   128 (48 direct, 80 indirect) bytes in 1 blocks are definitely lost in loss record 1,876 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x3A59D1: NotePairs::add(char const*, char const*) (Notes.h:211)
>      by 0x562F01: Helper::Reply::parseResponseKeys() (Reply.cc:182)
>      by 0x5635AA: Helper::Reply::parse(char*, unsigned long) (Reply.cc:127)
>      by 0x563D6E: Helper::Reply::Reply(char*, unsigned long) (Reply.cc:23)
>      by 0x33F178: helperHandleRead(RefCount<Comm::Connection> const&, char*, unsigned long, Comm::Flag, int, void*) (helper.cc:817)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   144 (96 direct, 48 indirect) bytes in 2 blocks are definitely lost in loss record 1,917 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x29AB25: cbdataInternalAlloc(int) (cbdata.cc:281)
>      by 0x4F9220: ssl_verify_cb(int, x509_store_ctx_st*) (CbDataList.h:37)
>      by 0x5B85EB1: X509_verify_cert (x509_vfy.c:349)
>      by 0x5843087: ssl_verify_cert_chain (ssl_cert.c:554)
>      by 0x58221C2: ssl3_get_server_certificate (s3_clnt.c:1161)
>      by 0x5824831: ssl3_connect (s3_clnt.c:334)
>      by 0x582D676: ssl23_connect (s23_clnt.c:776)
>      by 0x4ED7DB: Ssl::PeerConnector::negotiateSsl() (PeerConnector.cc:248)
>      by 0x4EDF9A: JobDialer<Ssl::PeerConnector>::dial(AsyncCall&) (AsyncJobCalls.h:174)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   192 (144 direct, 48 indirect) bytes in 3 blocks are definitely lost in loss record 2,046 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x29AB25: cbdataInternalAlloc(int) (cbdata.cc:281)
>      by 0x4F902A: ssl_verify_cb(int, x509_store_ctx_st*) (CbDataList.h:37)
>      by 0x5B865CD: X509_verify_cert (x509_vfy.c:679)
>      by 0x5843087: ssl_verify_cert_chain (ssl_cert.c:554)
>      by 0x58221C2: ssl3_get_server_certificate (s3_clnt.c:1161)
>      by 0x5824831: ssl3_connect (s3_clnt.c:334)
>      by 0x582D676: ssl23_connect (s23_clnt.c:776)
>      by 0x4ED7DB: Ssl::PeerConnector::negotiateSsl() (PeerConnector.cc:248)
>      by 0x4EDF9A: JobDialer<Ssl::PeerConnector>::dial(AsyncCall&) (AsyncJobCalls.h:174)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   5,000 (1,776 direct, 3,224 indirect) bytes in 37 blocks are definitely lost in loss record 3,060 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x3A5AF7: NotePairs::append(NotePairs const*) (Notes.h:211)
>      by 0x327345: ExternalACLEntry::update(ExternalACLEntryData const&) (ExternalACLEntry.cc:41)
>      by 0x322A3D: external_acl_cache_add(external_acl*, char const*, ExternalACLEntryData const&) (external_acl.cc:1264)
>      by 0x3230E4: externalAclHandleReply(void*, Helper::Reply const&) (external_acl.cc:1376)
>      by 0x33F189: helperHandleRead(RefCount<Comm::Connection> const&, char*, unsigned long, Comm::Flag, int, void*) (helper.cc:818)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   6,368 (2,256 direct, 4,112 indirect) bytes in 47 blocks are definitely lost in loss record 3,077 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x3A5AF7: NotePairs::append(NotePairs const*) (Notes.h:211)
>      by 0x322C2B: externalAclHandleReply(void*, Helper::Reply const&) (external_acl.cc:1346)
>      by 0x33F189: helperHandleRead(RefCount<Comm::Connection> const&, char*, unsigned long, Comm::Flag, int, void*) (helper.cc:818)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   8,088 (2,736 direct, 5,352 indirect) bytes in 57 blocks are definitely lost in loss record 3,090 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x3A5EE9: NotePairs::appendNewOnly(NotePairs const*) (Notes.h:211)
>      by 0x48AD6C: Auth::Ntlm::UserRequest::HandleReply(void*, Helper::Reply const&) (UserRequest.cc:274)
>      by 0x33DCB1: helperStatefulHandleRead(RefCount<Comm::Connection> const&, char*, unsigned long, Comm::Flag, int, void*) (helper.cc:1002)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   15,551 (96 direct, 15,455 indirect) bytes in 2 blocks are definitely lost in loss record 3,137 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x29AB25: cbdataInternalAlloc(int) (cbdata.cc:281)
>      by 0x4F902A: ssl_verify_cb(int, x509_store_ctx_st*) (CbDataList.h:37)
>      by 0x5B8643C: X509_verify_cert (x509_vfy.c:382)
>      by 0x5843087: ssl_verify_cert_chain (ssl_cert.c:554)
>      by 0x58221C2: ssl3_get_server_certificate (s3_clnt.c:1161)
>      by 0x5824831: ssl3_connect (s3_clnt.c:334)
>      by 0x582D676: ssl23_connect (s23_clnt.c:776)
>      by 0x4ED7DB: Ssl::PeerConnector::negotiateSsl() (PeerConnector.cc:248)
>      by 0x4EDF9A: JobDialer<Ssl::PeerConnector>::dial(AsyncCall&) (AsyncJobCalls.h:174)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   15,810 (192 direct, 15,618 indirect) bytes in 4 blocks are definitely lost in loss record 3,140 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x29AB25: cbdataInternalAlloc(int) (cbdata.cc:281)
>      by 0x4EA000: Ssl::PeerConnector::sslCrtvdCheckForErrors(Ssl::CertValidationResponse const&, Ssl::ErrorDetail*&) (CbDataList.h:37)
>      by 0x4EBCAC: Ssl::PeerConnector::sslCrtvdHandleReply(RefCount<Ssl::CertValidationResponse>) (PeerConnector.cc:489)
>      by 0x4EE8DE: UnaryMemFunT<Ssl::PeerConnector, RefCount<Ssl::CertValidationResponse>, RefCount<Ssl::CertValidationResponse> >::doDial() (AsyncJobCalls.h:121)
>      by 0x4EDF9A: JobDialer<Ssl::PeerConnector>::dial(AsyncCall&) (AsyncJobCalls.h:174)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   17,432 (5,712 direct, 11,720 indirect) bytes in 119 blocks are definitely lost in loss record 3,151 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x3A5AF7: NotePairs::append(NotePairs const*) (Notes.h:211)
>      by 0x327345: ExternalACLEntry::update(ExternalACLEntryData const&) (ExternalACLEntry.cc:41)
>      by 0x3224FA: external_acl_cache_add(external_acl*, char const*, ExternalACLEntryData const&) (external_acl.cc:1257)
>      by 0x3230E4: externalAclHandleReply(void*, Helper::Reply const&) (external_acl.cc:1376)
>      by 0x33F189: helperHandleRead(RefCount<Comm::Connection> const&, char*, unsigned long, Comm::Flag, int, void*) (helper.cc:818)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   36,456 (12,912 direct, 23,544 indirect) bytes in 269 blocks are definitely lost in loss record 3,188 of 3,225
>      at 0x4C267BB: calloc (vg_replace_malloc.c:593)
>      by 0x642906: xcalloc (xalloc.cc:83)
>      by 0x63CEB2: MemPoolMalloc::allocate() (MemPoolMalloc.cc:39)
>      by 0x3A5AF7: NotePairs::append(NotePairs const*) (Notes.h:211)
>      by 0x3A5C91: UpdateRequestNotes(ConnStateData*, HttpRequest&, NotePairs const&) (Notes.cc:275)
>      by 0x324708: ACLExternal::match(ACLChecklist*) (external_acl.cc:716)
>      by 0x4ABE07: ACL::matches(ACLChecklist*) const (Acl.cc:154)
>      by 0x4AF1DA: ACLChecklist::matchChild(Acl::InnerNode const*, __gnu_cxx::__normal_iterator<ACL* const*, std::vector<ACL*, std::allocator<ACL*> > >, ACL const*) (Checklist.cc:94)
>      by 0x4AE372: Acl::AndNode::doMatch(ACLChecklist*, __gnu_cxx::__normal_iterator<ACL* const*, std::vector<ACL*, std::allocator<ACL*> > >) const (BoolOps.cc:89)
>      by 0x4B1953: Acl::InnerNode::resumeMatchingAt(ACLChecklist*, __gnu_cxx::__normal_iterator<ACL* const*, std::vector<ACL*, std::allocator<ACL*> > >) const (InnerNode.cc:95)
>      by 0x4AF08B: ACLChecklist::matchChild(Acl::InnerNode const*, __gnu_cxx::__normal_iterator<ACL* const*, std::vector<ACL*, std::allocator<ACL*> > >, ACL const*) (Checklist.cc:99)
>      by 0x4AE2EE: Acl::OrNode::doMatch(ACLChecklist*, __gnu_cxx::__normal_iterator<ACL* const*, std::vector<ACL*, std::allocator<ACL*> > >) const (BoolOps.cc:133)
>      by 0x4B1953: Acl::InnerNode::resumeMatchingAt(ACLChecklist*, __gnu_cxx::__normal_iterator<ACL* const*, std::vector<ACL*, std::allocator<ACL*> > >) const (InnerNode.cc:95)
>      by 0x4AF7DC: ACLChecklist::matchAndFinish() (Checklist.cc:300)
>      by 0x4B0E27: ACLChecklist::resumeNonBlockingCheck(ACLChecklist::AsyncState*) (Checklist.cc:282)
>      by 0x322E0E: externalAclHandleReply(void*, Helper::Reply const&) (external_acl.cc:1390)
>      by 0x33F189: helperHandleRead(RefCount<Comm::Connection> const&, char*, unsigned long, Comm::Flag, int, void*) (helper.cc:818)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
>   98,125 (5,360 direct, 92,765 indirect) bytes in 670 blocks are definitely lost in loss record 3,215 of 3,225
>      at 0x4C27A2E: malloc (vg_replace_malloc.c:270)
>      by 0x642864: xmalloc (xalloc.cc:114)
>      by 0x4FCE69: sslCrtvdHandleReplyWrapper(void*, Helper::Reply const&) (SquidNew.h:23)
>      by 0x33F189: helperHandleRead(RefCount<Comm::Connection> const&, char*, unsigned long, Comm::Flag, int, void*) (helper.cc:818)
>      by 0x4B419F: AsyncCall::make() (AsyncCall.cc:40)
>      by 0x4B7862: AsyncCallQueue::fireNext() (AsyncCallQueue.cc:56)
>      by 0x4B7BEF: AsyncCallQueue::fire() (AsyncCallQueue.cc:42)
>      by 0x31CD0B: EventLoop::runOnce() (EventLoop.cc:120)
>      by 0x31CED7: EventLoop::run() (EventLoop.cc:82)
>      by 0x39088D: SquidMain(int, char**) (main.cc:1539)
>      by 0x391647: main (main.cc:1263)
>
> Does anyone have a clue about the NotePairs leaks?
>
> Thanks in advance,
>
> William Lima
> _______________________________________________


More information about the squid-dev mailing list