Re: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory leak [#1860]

2017-03-08 Thread Zoran Milinkovic
Hi Vo,

I don't see that #2174 has been pushed. Did you mean some other patch ?
Anyway, I tested again on the latest changeset on default branch and the memory 
leak is still there + one more.

All 3 memory leaks might be due to failed MDS tests.

You have ack to the current patch, and for these three memory leaks we can open 
a new ticket.

I run next command:
valgrind --leak-check=full mdstest

Result from today's MDS test on the default branch:
   Test Result:
  Total:  185
  Passed: 183
  Failed: 2

Reported memory leaks:
==21333== 752 bytes in 2 blocks are definitely lost in loss record 10 of 13
==21333==at 0x4C2AB80: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21333==by 0x4E7731D: mds_mcm_user_event_callback (mds_c_api.c:3301)
==21333==by 0x4E78BB1: mds_mcm_svc_up (mds_c_api.c:1615)
==21333==by 0x4E95C14: mdtm_process_discovery_events (mds_dt_tipc.c:1031)
==21333==by 0x4E95C14: mdtm_process_recv_events (mds_dt_tipc.c:699)
==21333==by 0x50C7183: start_thread (pthread_create.c:312)
==21333==by 0x53D737C: clone (clone.S:111)
==21333== 
==21333== 8,448 (376 direct, 8,072 indirect) bytes in 1 blocks are definitely 
lost in loss record 12 of 13
==21333==at 0x4C2AB80: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21333==by 0x4E7FCBE: mds_mcm_mailbox_post (mds_c_sndrcv.c:4866)
==21333==by 0x4E7FCBE: mds_mcm_process_recv_snd_msg_common 
(mds_c_sndrcv.c:4246)
==21333==by 0x4E82532: mcm_recv_red_bcast (mds_c_sndrcv.c:4467)
==21333==by 0x4E82532: mds_mcm_ll_data_rcv (mds_c_sndrcv.c:4148)
==21333==by 0x4E8A57E: mdtm_process_recv_message_common 
(mds_dt_common.c:504)
==21333==by 0x4E8AB5D: mdtm_process_recv_data (mds_dt_common.c:948)
==21333==by 0x4E951B5: mdtm_process_recv_events (mds_dt_tipc.c:819)
==21333==by 0x50C7183: start_thread (pthread_create.c:312)
==21333==by 0x53D737C: clone (clone.S:111)
==21333== 
==21333== LEAK SUMMARY:
==21333==definitely lost: 1,128 bytes in 3 blocks
==21333==indirectly lost: 8,072 bytes in 2 blocks
==21333==  possibly lost: 120 bytes in 4 blocks
==21333==still reachable: 263,815 bytes in 5 blocks
==21333== suppressed: 0 bytes in 0 blocks

Thanks,
Zoran

-Original Message-
From: Vo Minh Hoang [mailto:hoang.m...@dektech.com.au] 
Sent: den 8 mars 2017 05:49
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; mahesh.va...@oracle.com; 
Anders Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory 
leak [#1860]

Dear Zoran,

Thank you very much for your checking.

Would you please tell me which test case is failed in your environment because 
my current pc return OK for all and no mem leak. That might because of 
threading problem.

Further information, please note that this patch should apply after #2174 
(already been pushed).

Sincerely,
Hoang

-Original Message-
From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com]
Sent: Tuesday, March 7, 2017 10:07 PM
To: Hoang Minh Vo <hoang.m...@dektech.com.au>; mahesh.va...@oracle.com; Anders 
Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory 
leak [#1860]

Hi Hoang,

Reviewed and tested both patches.

There is still a memory leak when some tests fail.

==20325== 752 bytes in 2 blocks are definitely lost in loss record 9 of 10
==20325==at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20325==by 0x4E7731D: mds_mcm_user_event_callback (mds_c_api.c:3301)
==20325==by 0x4E78BB1: mds_mcm_svc_up (mds_c_api.c:1615)
==20325==by 0x4E95C14: mdtm_process_discovery_events
(mds_dt_tipc.c:1031)
==20325==by 0x4E95C14: mdtm_process_recv_events (mds_dt_tipc.c:699)
==20325==by 0x50C7183: start_thread (pthread_create.c:312)
==20325==by 0x53D737C: clone (clone.S:111)
==20325==
==20325== LEAK SUMMARY:
==20325==definitely lost: 752 bytes in 2 blocks
==20325==indirectly lost: 0 bytes in 0 blocks
==20325==  possibly lost: 120 bytes in 4 blocks
==20325==still reachable: 263,815 bytes in 5 blocks
==20325== suppressed: 0 bytes in 0 blocks

Thanks,
Zoran


-Original Message-
From: Hoang Vo [mailto:hoang.m...@dektech.com.au]
Sent: den 6 mars 2017 09:00
To: mahesh.va...@oracle.com; Anders Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory leak 
[#1860]

Summary: mdstest: handle memory leak [#1860] Review request for Trac
Ticket(s): #1870 Peer Reviewer(s): mahesh.va...@oracle.com; 
zoran.milinko...@ericsson.com Pull request to: mahesh.va...@oracle.com Affected 
branch(es): default Development branch: default


Impacted area   Impact y/n

Re: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory leak [#1860]

2017-03-07 Thread Vo Minh Hoang
Dear Zoran,

Thank you very much for your checking.

Would you please tell me which test case is failed in your environment
because my current pc return OK for all and no mem leak. That might because
of threading problem.

Further information, please note that this patch should apply after #2174
(already been pushed).

Sincerely,
Hoang

-Original Message-
From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com] 
Sent: Tuesday, March 7, 2017 10:07 PM
To: Hoang Minh Vo <hoang.m...@dektech.com.au>; mahesh.va...@oracle.com;
Anders Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [devel] [PATCH 0 of 2] Review Request for mdstest: handle
memory leak [#1860]

Hi Hoang,

Reviewed and tested both patches.

There is still a memory leak when some tests fail.

==20325== 752 bytes in 2 blocks are definitely lost in loss record 9 of 10
==20325==at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20325==by 0x4E7731D: mds_mcm_user_event_callback (mds_c_api.c:3301)
==20325==by 0x4E78BB1: mds_mcm_svc_up (mds_c_api.c:1615)
==20325==by 0x4E95C14: mdtm_process_discovery_events
(mds_dt_tipc.c:1031)
==20325==by 0x4E95C14: mdtm_process_recv_events (mds_dt_tipc.c:699)
==20325==by 0x50C7183: start_thread (pthread_create.c:312)
==20325==by 0x53D737C: clone (clone.S:111)
==20325== 
==20325== LEAK SUMMARY:
==20325==definitely lost: 752 bytes in 2 blocks
==20325==indirectly lost: 0 bytes in 0 blocks
==20325==  possibly lost: 120 bytes in 4 blocks
==20325==still reachable: 263,815 bytes in 5 blocks
==20325== suppressed: 0 bytes in 0 blocks

Thanks,
Zoran


-Original Message-
From: Hoang Vo [mailto:hoang.m...@dektech.com.au] 
Sent: den 6 mars 2017 09:00
To: mahesh.va...@oracle.com; Anders Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory
leak [#1860]

Summary: mdstest: handle memory leak [#1860] Review request for Trac
Ticket(s): #1870 Peer Reviewer(s): mahesh.va...@oracle.com;
zoran.milinko...@ericsson.com Pull request to: mahesh.va...@oracle.com
Affected branch(es): default Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each "y" above):
-

changeset 9a1f61672dd538472bf0c1340011467a35f83a23
Author: Hoang Vo <hoang.m...@dektech.com.au>
Date:   Mon, 06 Mar 2017 14:52:06 +0700

mds: handle memory leak [#1860]

Some error handling does not clean internal memory. Error handling
in
dirrect send case clear user memory seem inconsistence, mds should
let
creater manage its memory in error cases.

action: implement as proposed.

changeset 1efa643eb496a2938d1ddfecac6e91aa4a1cda88
Author: Hoang Vo <hoang.m...@dektech.com.au>
Date:   Mon, 06 Mar 2017 14:52:08 +0700

mdstest: handle memory leak [#1860]

mdstest leak in many cases because of:
- incorrect use of input param
- wrong test sequence (cacel subscription after uninstall)
- malloc then terminate thread (cannot reach free)
- missing free on receiving message (used global pointer)
- encode wrong message length

action: fix above cases


Complete diffstat:
--
 src/base/sysf_mem.c|3 +
 src/mds/apitest/mdstipc.h  |3 +-
 src/mds/apitest/mdstipc_api.c  |  288

---
 src/mds/apitest/mdstipc_conf.c |   42 ++---
 src/mds/mds_c_sndrcv.c |   34 +++-
 5 files changed, 181 insertions(+), 189 deletions(-)


Testing Commands:
-
G_SLICE=always-malloc G_DEBUG=gc-friendly  valgrind -v --tool=memcheck
--leak-check=full --num-callers=40 --log-file=valgrind.log mdstest

Testing, Expected Results:
--
No definitely and indirectly lost report in valgrind.log

Conditions of Submission:
-
ACK from maintainer

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entr

Re: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory leak [#1860]

2017-03-07 Thread Zoran Milinkovic
Hi Hoang,

Reviewed and tested both patches.

There is still a memory leak when some tests fail.

==20325== 752 bytes in 2 blocks are definitely lost in loss record 9 of 10
==20325==at 0x4C2AB80: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20325==by 0x4E7731D: mds_mcm_user_event_callback (mds_c_api.c:3301)
==20325==by 0x4E78BB1: mds_mcm_svc_up (mds_c_api.c:1615)
==20325==by 0x4E95C14: mdtm_process_discovery_events (mds_dt_tipc.c:1031)
==20325==by 0x4E95C14: mdtm_process_recv_events (mds_dt_tipc.c:699)
==20325==by 0x50C7183: start_thread (pthread_create.c:312)
==20325==by 0x53D737C: clone (clone.S:111)
==20325== 
==20325== LEAK SUMMARY:
==20325==definitely lost: 752 bytes in 2 blocks
==20325==indirectly lost: 0 bytes in 0 blocks
==20325==  possibly lost: 120 bytes in 4 blocks
==20325==still reachable: 263,815 bytes in 5 blocks
==20325== suppressed: 0 bytes in 0 blocks

Thanks,
Zoran


-Original Message-
From: Hoang Vo [mailto:hoang.m...@dektech.com.au] 
Sent: den 6 mars 2017 09:00
To: mahesh.va...@oracle.com; Anders Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory leak 
[#1860]

Summary: mdstest: handle memory leak [#1860] Review request for Trac Ticket(s): 
#1870 Peer Reviewer(s): mahesh.va...@oracle.com; zoran.milinko...@ericsson.com 
Pull request to: mahesh.va...@oracle.com Affected branch(es): default 
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each "y" above):
-

changeset 9a1f61672dd538472bf0c1340011467a35f83a23
Author: Hoang Vo <hoang.m...@dektech.com.au>
Date:   Mon, 06 Mar 2017 14:52:06 +0700

mds: handle memory leak [#1860]

Some error handling does not clean internal memory. Error handling in
dirrect send case clear user memory seem inconsistence, mds should let
creater manage its memory in error cases.

action: implement as proposed.

changeset 1efa643eb496a2938d1ddfecac6e91aa4a1cda88
Author: Hoang Vo <hoang.m...@dektech.com.au>
Date:   Mon, 06 Mar 2017 14:52:08 +0700

mdstest: handle memory leak [#1860]

mdstest leak in many cases because of:
- incorrect use of input param
- wrong test sequence (cacel subscription after uninstall)
- malloc then terminate thread (cannot reach free)
- missing free on receiving message (used global pointer)
- encode wrong message length

action: fix above cases


Complete diffstat:
--
 src/base/sysf_mem.c|3 +
 src/mds/apitest/mdstipc.h  |3 +-
 src/mds/apitest/mdstipc_api.c  |  288 
---
 src/mds/apitest/mdstipc_conf.c |   42 ++---
 src/mds/mds_c_sndrcv.c |   34 +++-
 5 files changed, 181 insertions(+), 189 deletions(-)


Testing Commands:
-
G_SLICE=always-malloc G_DEBUG=gc-friendly  valgrind -v --tool=memcheck 
--leak-check=full --num-callers=40 --log-file=valgrind.log mdstest

Testing, Expected Results:
--
No definitely and indirectly lost report in valgrind.log

Conditions of Submission:
-
ACK from maintainer

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sani

[devel] [PATCH 0 of 2] Review Request for mdstest: handle memory leak [#1860]

2017-03-06 Thread Hoang Vo
Summary: mdstest: handle memory leak [#1860]
Review request for Trac Ticket(s): #1870
Peer Reviewer(s): mahesh.va...@oracle.com; zoran.milinko...@ericsson.com
Pull request to: mahesh.va...@oracle.com
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each "y" above):
-

changeset 9a1f61672dd538472bf0c1340011467a35f83a23
Author: Hoang Vo 
Date:   Mon, 06 Mar 2017 14:52:06 +0700

mds: handle memory leak [#1860]

Some error handling does not clean internal memory. Error handling in
dirrect send case clear user memory seem inconsistence, mds should let
creater manage its memory in error cases.

action: implement as proposed.

changeset 1efa643eb496a2938d1ddfecac6e91aa4a1cda88
Author: Hoang Vo 
Date:   Mon, 06 Mar 2017 14:52:08 +0700

mdstest: handle memory leak [#1860]

mdstest leak in many cases because of:
- incorrect use of input param
- wrong test sequence (cacel subscription after uninstall)
- malloc then terminate thread (cannot reach free)
- missing free on receiving message (used global pointer)
- encode wrong message length

action: fix above cases


Complete diffstat:
--
 src/base/sysf_mem.c|3 +
 src/mds/apitest/mdstipc.h  |3 +-
 src/mds/apitest/mdstipc_api.c  |  288 
---
 src/mds/apitest/mdstipc_conf.c |   42 ++---
 src/mds/mds_c_sndrcv.c |   34 +++-
 5 files changed, 181 insertions(+), 189 deletions(-)


Testing Commands:
-
G_SLICE=always-malloc G_DEBUG=gc-friendly  valgrind -v --tool=memcheck 
--leak-check=full --num-callers=40 --log-file=valgrind.log mdstest

Testing, Expected Results:
--
No definitely and indirectly lost report in valgrind.log

Conditions of Submission:
-
ACK from maintainer

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results