Bug 548533 - memory leak in Repl_5_Inc_Protocol_new
Summary: memory leak in Repl_5_Inc_Protocol_new
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Replication - General
Version: 1.3.0
Hardware: All
OS: Linux
high
low
Target Milestone: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 434914 389_1.2.6
TreeView+ depends on / blocked
 
Reported: 2009-12-17 18:01 UTC by Noriko Hosoi
Modified: 2015-12-07 17:13 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-07 17:13:09 UTC
Embargoed:


Attachments (Terms of Use)
git patch file (4.29 KB, patch)
2010-03-22 00:17 UTC, Noriko Hosoi
nkinder: review+
Details | Diff
mmraccept valgrind logs (820.00 KB, application/x-tar)
2010-06-03 17:20 UTC, Jenny Severance
no flags Details

Description Noriko Hosoi 2009-12-17 18:01:55 UTC
Description of problem:
Found in TET mmrepl/accept + valgrind
accept.vg
==30862== 48,067 (7,291 direct, 40,776 indirect) bytes in 61 blocks are definitely lost in loss record 82 of 95
==30862==    at 0x4A0763E: malloc (vg_replace_malloc.c:207)
==30862==    by 0x4C50439: slapi_ch_malloc (ch_malloc.c:155)
==30862==    by 0xB4D5169: Repl_5_Inc_Protocol_new (repl5_inc_protocol.c:2056)
==30862==    by 0xB4D9465: private_protocol_factory (repl5_protocol.c:551)
==30862==    by 0xB4D8B9C: prot_new (repl5_protocol.c:132)
==30862==    by 0xB4C98D3: agmt_start (repl5_agmt.c:550)
==30862==    by 0xB4E005B: replica_start_agreement (repl5_replica.c:3325)
==30862==    by 0xB4CCD56: add_new_agreement (repl5_agmtlist.c:170)
==30862==    by 0xB4CCDC0: agmtlist_add_callback (repl5_agmtlist.c:184)
==30862==    by 0x4C5C17C: dse_call_callback (dse.c:2229)
==30862==    by 0x4C5B973: dse_add (dse.c:2055)
==30862==    by 0x4C47FE2: op_shared_add (add.c:631)
==30862==    by 0x4C4728B: do_add (add.c:232)
==30862==    by 0x413221: connection_dispatch_operation (connection.c:544)
==30862==    by 0x4149A1: connection_threadmain (connection.c:2267)
==30862==    by 0x32B7429262: (within /lib64/libnspr4.so)
==30862==    by 0x37A6406869: start_thread (in /lib64/libpthread-2.10.1.so)
==30862==    by 0x37A58DE3BC: clone (in /lib64/libc-2.10.1.so)

repl5_inc_protocol.c: repl5_inc_delete is not implemented.
/*
 * It's specifically ok to delete a protocol instance that
 * is currently running. The instance will be shut down, and
 * then resources will be freed. Since a graceful shutdown is
 * attempted, this function may take some time to complete.
 */
static void
repl5_inc_delete(Private_Repl_Protocol **prpp)
{
    /* First, stop the protocol if it isn't already stopped */
    /* Then, delete all resources used by the protocol */
}

Comment 2 Noriko Hosoi 2010-03-22 00:17:02 UTC
Created attachment 401614 [details]
git patch file

Description: repl5_inc_delete and repl5_tot_delete to release the
incremental and total update protocol were not implemented.  This
fix implemented them.  Also, it fixed a leak of connection in
private_protocol_factory.

Comment 3 Noriko Hosoi 2010-03-22 15:52:58 UTC
Reviewed by Nathan (Thank you!!!)

Pushed to master:

$ git merge work
Updating 6236bb3..04a0bd9
Fast-forward
 .../plugins/replication/repl5_inc_protocol.c       |   14 +++++++
 ldap/servers/plugins/replication/repl5_protocol.c  |   38 +++++++++++++-------
 .../plugins/replication/repl5_tot_protocol.c       |   18 +++++++++-
 3 files changed, 56 insertions(+), 14 deletions(-)

$ git push
Counting objects: 17, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.37 KiB, done.
Total 9 (delta 7), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   6236bb3..04a0bd9  master -> master

Pushed to Directory_Server_8_2_Branch:

$ git push origin ds82-local:Directory_Server_8_2_Branch 
Counting objects: 17, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.38 KiB, done.
Total 9 (delta 7), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   02514d6..a30b3bd  ds82-local -> Directory_Server_8_2_Branch

Comment 7 Jenny Severance 2010-06-03 17:20:47 UTC
Created attachment 419452 [details]
mmraccept valgrind logs

please review the attached valgrind logs for memory leak fix Thanks!

Comment 8 Noriko Hosoi 2010-06-03 17:33:51 UTC
Thanks, Jenny.  The particular leak does not exist in your valgrind logs.

$ tar xvf ../valgrind_mmraccept.tar 
accept.vg.12390.12396
accept.vg.12697.12703
accept.vg.12994.13000
[...]
accept.vg.7935.7941
accept.vg.8372.8378
accept.vg.8811.8817
$ egrep Repl_5_Inc_Protocol_new *
$

Comment 9 Jenny Severance 2010-06-03 17:58:26 UTC
verified - RHEL 4  Thanks Noriko!

version:
redhat-ds-base-8.2.0-2010060204.el4dsrv


Note You need to log in before you can comment on or make changes to this bug.