Project

General

Profile

Actions

Bug #17205

closed

librados memory leaks from ceph::crypto (WITH_NSS)

Added by Casey Bodley over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
common
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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 1 (0 open1 closed)

Copied to Ceph - Backport #17341: jewel: librados memory leaks from ceph::crypto (WITH_NSS)ResolvedLoïc DacharyActions
Actions #2

Updated by Casey Bodley over 7 years ago

  • Status changed from New to Pending Backport
  • Backport set to jewel
Actions #3

Updated by Nathan Cutler over 7 years ago

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

Updated by Loïc Dachary over 7 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF