diff mbox series

[ovs-dev,v2] ovsdb-client: fix memory leak to prevent valgrind reporting memory leaks while running test suite

Message ID 1569914549-13466-1-git-send-email-damjan.skvarc@gmail.com
State Superseded
Headers show
Series [ovs-dev,v2] ovsdb-client: fix memory leak to prevent valgrind reporting memory leaks while running test suite | expand

Commit Message

Damijan Skvarc Oct. 1, 2019, 7:22 a.m. UTC
memory leaks are reported in several tests and are expressed in a following way:

==29840== 208 (48 direct, 160 indirect) bytes in 1 blocks are definitely lost in loss record 43 of 44
==29840==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29840==    by 0x449D12: xcalloc (util.c:121)
==29840==    by 0x432949: jsonrpc_msg_from_json (jsonrpc.c:697)
==29840==    by 0x432A8F: jsonrpc_parse_received_message (jsonrpc.c:472)
==29840==    by 0x432A8F: jsonrpc_recv.part.7 (jsonrpc.c:338)
==29840==    by 0x4338F7: jsonrpc_recv (jsonrpc.c:1139)
==29840==    by 0x4338F7: jsonrpc_session_recv (jsonrpc.c:1112)
==29840==    by 0x40719B: do_wait (ovsdb-client.c:2463)
==29840==    by 0x405F76: main (ovsdb-client.c:282)

Signed-off-by: Damijan Skvarc <damjan.skvarc@gmail.com>
---
 ovsdb/ovsdb-client.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

0-day Robot Oct. 1, 2019, 8:08 a.m. UTC | #1
Bleep bloop.  Greetings Damijan Skvarc, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


git-am:
fatal: sha1 information is lacking or useless (ovsdb/ovsdb-client.c).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 ovsdb-client: fix memory leak to prevent valgrind reporting memory leaks while running test suite
The copy of the patch that failed is found in:
   /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
Ben Pfaff Oct. 1, 2019, 4:20 p.m. UTC | #2
On Tue, Oct 01, 2019 at 09:22:29AM +0200, Damijan Skvarc wrote:
> memory leaks are reported in several tests and are expressed in a following way:
> 
> ==29840== 208 (48 direct, 160 indirect) bytes in 1 blocks are definitely lost in loss record 43 of 44
> ==29840==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==29840==    by 0x449D12: xcalloc (util.c:121)
> ==29840==    by 0x432949: jsonrpc_msg_from_json (jsonrpc.c:697)
> ==29840==    by 0x432A8F: jsonrpc_parse_received_message (jsonrpc.c:472)
> ==29840==    by 0x432A8F: jsonrpc_recv.part.7 (jsonrpc.c:338)
> ==29840==    by 0x4338F7: jsonrpc_recv (jsonrpc.c:1139)
> ==29840==    by 0x4338F7: jsonrpc_session_recv (jsonrpc.c:1112)
> ==29840==    by 0x40719B: do_wait (ovsdb-client.c:2463)
> ==29840==    by 0x405F76: main (ovsdb-client.c:282)
> 
> Signed-off-by: Damijan Skvarc <damjan.skvarc@gmail.com>

Thank you for the patch.

I could not apply this.  I think it requires v1 to be applied first.
Please rebase against current master and re-send it.

Thanks,

Ben.
Damijan Skvarc Oct. 2, 2019, 9:39 a.m. UTC | #3
Thanks for informing me. I have resent new patch request.

regards,Damijan

On Tue, Oct 1, 2019 at 6:28 PM Ben Pfaff <blp@ovn.org> wrote:

> On Tue, Oct 01, 2019 at 09:22:29AM +0200, Damijan Skvarc wrote:
> > memory leaks are reported in several tests and are expressed in a
> following way:
> >
> > ==29840== 208 (48 direct, 160 indirect) bytes in 1 blocks are definitely
> lost in loss record 43 of 44
> > ==29840==    at 0x4C2FB55: calloc (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> > ==29840==    by 0x449D12: xcalloc (util.c:121)
> > ==29840==    by 0x432949: jsonrpc_msg_from_json (jsonrpc.c:697)
> > ==29840==    by 0x432A8F: jsonrpc_parse_received_message (jsonrpc.c:472)
> > ==29840==    by 0x432A8F: jsonrpc_recv.part.7 (jsonrpc.c:338)
> > ==29840==    by 0x4338F7: jsonrpc_recv (jsonrpc.c:1139)
> > ==29840==    by 0x4338F7: jsonrpc_session_recv (jsonrpc.c:1112)
> > ==29840==    by 0x40719B: do_wait (ovsdb-client.c:2463)
> > ==29840==    by 0x405F76: main (ovsdb-client.c:282)
> >
> > Signed-off-by: Damijan Skvarc <damjan.skvarc@gmail.com>
>
> Thank you for the patch.
>
> I could not apply this.  I think it requires v1 to be applied first.
> Please rebase against current master and re-send it.
>
> Thanks,
>
> Ben.
>
diff mbox series

Patch

diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c
index e78e9d9..9a107a0 100644
--- a/ovsdb/ovsdb-client.c
+++ b/ovsdb/ovsdb-client.c
@@ -2468,14 +2468,15 @@  do_wait(struct jsonrpc *rpc_unused OVS_UNUSED,
         if (reply && reply->id) {
             if (sdca_id && json_equal(sdca_id, reply->id)) {
                 if (reply->type == JSONRPC_ERROR) {
-                    jsonrpc_msg_destroy(reply);
-                    ovs_fatal(0, "%s: set_db_change_aware failed (%s)",
+                    ovs_error(0, "%s: set_db_change_aware failed (%s)",
                               jsonrpc_session_get_name(js),
                               json_to_string(reply->error, 0));
+                    jsonrpc_msg_destroy(reply);
+                    exit(0);
                 }
             } else if (txn_id && json_equal(txn_id, reply->id)) {
-                jsonrpc_msg_destroy(reply);
                 check_transaction_reply(reply);
+                jsonrpc_msg_destroy(reply);
                 exit(0);
             }
         }