Project

General

Profile

Bug #17205

librados memory leaks from ceph::crypto (WITH_NSS)

Added by Casey Bodley 7 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
common
Target version:
-
Start date:
09/02/2016
Due date:
% Done:

0%

Source:
other
Tags:
Backport:
jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Release:
Needs Doc:

Description

radosgw is using librados::Rados::init_with_context() to create rados clients that reuse our global ceph context. but librados::Rados::connect() goes on to call common_init_finish() on that context, which calls through CephContext::init_crypto() and ceph::crypto::init(). Because ceph::crypto::init() had already been called for that CephContext, there was no matching call to ceph::crypto::shutdown() to decrement the NSS reference count (see 'static uint32_t crypto_refs' in common/ceph_crypto.cc). This leads to leaks of the NSS context which are caught by valgrind:

==25246== 72 bytes in 1 blocks are definitely lost in loss record 110 of 294
==25246==    at 0x4C2A988: calloc (vg_replace_malloc.c:711)
==25246==    by 0x5ECE276: error_get_my_stack (error.c:109)
==25246==    by 0x5ECE338: nss_ClearErrorStack (error.c:245)
==25246==    by 0x5ECDED8: NSSArena_Create (arena.c:329)
==25246==    by 0x5EC312A: NSSTrustDomain_Create (trustdomain.c:34)
==25246==    by 0x5EC7795: STAN_LoadDefaultNSS3TrustDomain (pki3hack.c:118)
==25246==    by 0x5E742F0: nss_Init (nssinit.c:655)
==25246==    by 0x5E749AD: NSS_InitContext (nssinit.c:833)
==25246==    by 0x6E8AB88: ceph::crypto::init(CephContext*) (ceph_crypto.cc:73)
==25246==    by 0x6E50A38: CephContext::init_crypto() (ceph_context.cc:602)
==25246==    by 0x6E4DD9F: common_init_finish(CephContext*) (common_init.cc:125)
==25246==    by 0x214106: main (rgw_main.cc:286)


Related issues

Copied to Backport #17341: jewel: librados memory leaks from ceph::crypto (WITH_NSS) Resolved

History

#2 Updated by Casey Bodley 6 months ago

  • Status changed from New to Pending Backport
  • Backport set to jewel

#3 Updated by Nathan Cutler 6 months ago

  • Copied to Backport #17341: jewel: librados memory leaks from ceph::crypto (WITH_NSS) added

#4 Updated by Loic Dachary 5 months ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF