Re: [ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl

2016-09-08 Thread Russell Bryant
On Thu, Sep 1, 2016 at 8:05 PM, Ramu Ramamurthy 
wrote:

> The following leaks are due to missing ds_destroy in a few
> places in build_acl.
>
> 5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93
>at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_
> memcheck-amd64-linux.so)
>by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_
> memcheck-amd64-linux.so)
>by 0x449507: xrealloc (util.c:123)
>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>by 0x42D176: ds_put_format (dynamic-string.c:142)
>by 0x40D380: build_acls (ovn-northd.c:2320)
>by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>by 0x4072D9: main (ovn-northd.c:4375)
>
> 9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93
>at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_
> memcheck-amd64-linux.so)
>by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_
> memcheck-amd64-linux.so)
>by 0x449507: xrealloc (util.c:123)
>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>by 0x42D176: ds_put_format (dynamic-string.c:142)
>by 0x40D505: build_acls (ovn-northd.c:2346)
>by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>by 0x4072D9: main (ovn-northd.c:4375)
>
> Signed-off-by: Ramu Ramamurthy 
> Acked-by: Ryan Moats 
>

I've applied this to master and branch-2.6.  Thanks!

-- 
Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl

2016-09-01 Thread Ramu Ramamurthy
Hi Russell, I updated the patch with a Signed-off-by, but it landed
here as new on patchworks,
https://patchwork.ozlabs.org/patch/665079/
instead of updating the original here:
https://patchwork.ozlabs.org/patch/661079/

On Thu, Sep 1, 2016 at 4:50 PM, Russell Bryant  wrote:
>
> On Fri, Aug 19, 2016 at 9:06 PM, Ramu Ramamurthy 
> wrote:
>>
>> From: Ramu Ramamurthy 
>>
>> The following leaks are due to missing ds_destroy in a few
>> places in build_acl.
>>
>> 5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93
>>at 0x4C29BFD: malloc (in
>> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
>>by 0x4C2BACB: realloc (in
>> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
>>by 0x449507: xrealloc (util.c:123)
>>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>>by 0x42D176: ds_put_format (dynamic-string.c:142)
>>by 0x40D380: build_acls (ovn-northd.c:2320)
>>by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>>by 0x4072D9: main (ovn-northd.c:4375)
>>
>> 9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93
>>at 0x4C29BFD: malloc (in
>> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
>>by 0x4C2BACB: realloc (in
>> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
>>by 0x449507: xrealloc (util.c:123)
>>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>>by 0x42D176: ds_put_format (dynamic-string.c:142)
>>by 0x40D505: build_acls (ovn-northd.c:2346)
>>by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>>by 0x4072D9: main (ovn-northd.c:4375)
>> ---
>>  ovn/northd/ovn-northd.c | 2 ++
>>  1 file changed, 2 insertions(+)
>
>
> I was about to apply this, but it's missing your Signed-off-by.  Can you
> please re-submit with Signed-off-by included?
>
> Thanks,
>
> --
> Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl

2016-09-01 Thread Ramu Ramamurthy
The following leaks are due to missing ds_destroy in a few
places in build_acl.

5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93
   at 0x4C29BFD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4C2BACB: realloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x449507: xrealloc (util.c:123)
   by 0x42CC73: ds_reserve (dynamic-string.c:63)
   by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
   by 0x42D176: ds_put_format (dynamic-string.c:142)
   by 0x40D380: build_acls (ovn-northd.c:2320)
   by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
   by 0x4072D9: build_lflows (ovn-northd.c:3845)
   by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
   by 0x4072D9: main (ovn-northd.c:4375)

9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93
   at 0x4C29BFD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4C2BACB: realloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x449507: xrealloc (util.c:123)
   by 0x42CC73: ds_reserve (dynamic-string.c:63)
   by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
   by 0x42D176: ds_put_format (dynamic-string.c:142)
   by 0x40D505: build_acls (ovn-northd.c:2346)
   by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
   by 0x4072D9: build_lflows (ovn-northd.c:3845)
   by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
   by 0x4072D9: main (ovn-northd.c:4375)

Signed-off-by: Ramu Ramamurthy 
Acked-by: Ryan Moats 
---
 ovn/northd/ovn-northd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 0ad9190..1731332 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -2342,6 +2342,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows)
 ovn_lflow_add(
 lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr(),
 actions);
+ds_destroy();
 }
 }
 
@@ -2368,6 +2369,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows)
 ovn_lflow_add(
 lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr(),
 actions);
+ds_destroy();
 }
 }
 }
-- 
1.8.3.1

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl

2016-09-01 Thread Russell Bryant
On Fri, Aug 19, 2016 at 9:06 PM, Ramu Ramamurthy 
wrote:

> From: Ramu Ramamurthy 
>
> The following leaks are due to missing ds_destroy in a few
> places in build_acl.
>
> 5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93
>at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_
> memcheck-amd64-linux.so)
>by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_
> memcheck-amd64-linux.so)
>by 0x449507: xrealloc (util.c:123)
>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>by 0x42D176: ds_put_format (dynamic-string.c:142)
>by 0x40D380: build_acls (ovn-northd.c:2320)
>by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>by 0x4072D9: main (ovn-northd.c:4375)
>
> 9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93
>at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_
> memcheck-amd64-linux.so)
>by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_
> memcheck-amd64-linux.so)
>by 0x449507: xrealloc (util.c:123)
>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>by 0x42D176: ds_put_format (dynamic-string.c:142)
>by 0x40D505: build_acls (ovn-northd.c:2346)
>by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>by 0x4072D9: main (ovn-northd.c:4375)
> ---
>  ovn/northd/ovn-northd.c | 2 ++
>  1 file changed, 2 insertions(+)
>

I was about to apply this, but it's missing your Signed-off-by.  Can you
please re-submit with Signed-off-by included?

Thanks,

-- 
Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl

2016-09-01 Thread Ryan Moats
"dev" <dev-boun...@openvswitch.org> wrote on 08/19/2016 08:06:50 PM:

> From: Ramu Ramamurthy <ramu.ramamur...@gmail.com>
> To: dev@openvswitch.org
> Cc: Suryanarayan Ramamurthy/San Jose/IBM@IBMUS
> Date: 08/19/2016 08:07 PM
> Subject: [ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl
> Sent by: "dev" <dev-boun...@openvswitch.org>
>
> From: Ramu Ramamurthy <ramu.ramamur...@us.ibm.com>
>
> The following leaks are due to missing ds_destroy in a few
> places in build_acl.
>
> 5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93
>at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-
> amd64-linux.so)
>by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-
> amd64-linux.so)
>by 0x449507: xrealloc (util.c:123)
>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>by 0x42D176: ds_put_format (dynamic-string.c:142)
>by 0x40D380: build_acls (ovn-northd.c:2320)
>by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>by 0x4072D9: main (ovn-northd.c:4375)
>
> 9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93
>at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-
> amd64-linux.so)
>by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-
> amd64-linux.so)
>by 0x449507: xrealloc (util.c:123)
>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>by 0x42D176: ds_put_format (dynamic-string.c:142)
>by 0x40D505: build_acls (ovn-northd.c:2346)
>by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>by 0x4072D9: main (ovn-northd.c:4375)
> ---
>  ovn/northd/ovn-northd.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
> index 625937d..756d188 100644
> --- a/ovn/northd/ovn-northd.c
> +++ b/ovn/northd/ovn-northd.c
> @@ -2324,6 +2324,7 @@ build_acls(struct ovn_datapath *od, struct hmap
*lflows)
>  ovn_lflow_add(
>  lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr
(),
>  actions);
> +ds_destroy();
>  }
>  }
>
> @@ -2350,6 +2351,7 @@ build_acls(struct ovn_datapath *od, struct hmap
*lflows)
>  ovn_lflow_add(
>  lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr
(),
>  actions);
> +ds_destroy();
>  }
>  }
>  }
> --

I had given a base ack for this previously, and I can say that as of this
message that this is the last *definitive* loss of memory in ovn-northd,
ovn-controller, and ovsdb-server.

Because of that, I'd like to see this merge into master and 2.6 before
the release is cut...

Ryan

Ryan
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl

2016-08-25 Thread Ryan Moats


"dev" <dev-boun...@openvswitch.org> wrote on 08/19/2016 08:06:50 PM:

> From: Ramu Ramamurthy <ramu.ramamur...@gmail.com>
> To: dev@openvswitch.org
> Cc: Suryanarayan Ramamurthy/San Jose/IBM@IBMUS
> Date: 08/19/2016 08:07 PM
> Subject: [ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl
> Sent by: "dev" <dev-boun...@openvswitch.org>
>
> From: Ramu Ramamurthy <ramu.ramamur...@us.ibm.com>
>
> The following leaks are due to missing ds_destroy in a few
> places in build_acl.
>
> 5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93
>at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-
> amd64-linux.so)
>by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-
> amd64-linux.so)
>by 0x449507: xrealloc (util.c:123)
>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>by 0x42D176: ds_put_format (dynamic-string.c:142)
>by 0x40D380: build_acls (ovn-northd.c:2320)
>by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>by 0x4072D9: main (ovn-northd.c:4375)
>
> 9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93
>at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-
> amd64-linux.so)
>by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-
> amd64-linux.so)
>by 0x449507: xrealloc (util.c:123)
>by 0x42CC73: ds_reserve (dynamic-string.c:63)
>by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
>by 0x42D176: ds_put_format (dynamic-string.c:142)
>by 0x40D505: build_acls (ovn-northd.c:2346)
>by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
>by 0x4072D9: build_lflows (ovn-northd.c:3845)
>by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
>by 0x4072D9: main (ovn-northd.c:4375)
> ---
>  ovn/northd/ovn-northd.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
> index 625937d..756d188 100644
> --- a/ovn/northd/ovn-northd.c
> +++ b/ovn/northd/ovn-northd.c
> @@ -2324,6 +2324,7 @@ build_acls(struct ovn_datapath *od, struct hmap
*lflows)
>  ovn_lflow_add(
>  lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr
(),
>  actions);
> +ds_destroy();
>  }
>  }
>
> @@ -2350,6 +2351,7 @@ build_acls(struct ovn_datapath *od, struct hmap
*lflows)
>  ovn_lflow_add(
>  lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr
(),
>  actions);
> +ds_destroy();
>  }
>  }
>  }
> --

Looks good to me on inspection, but I've not tried it out...

Acked-by: Ryan Moats <rmo...@us.ibm.com>
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl

2016-08-19 Thread Ramu Ramamurthy
From: Ramu Ramamurthy 

The following leaks are due to missing ds_destroy in a few
places in build_acl.

5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93
   at 0x4C29BFD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4C2BACB: realloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x449507: xrealloc (util.c:123)
   by 0x42CC73: ds_reserve (dynamic-string.c:63)
   by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
   by 0x42D176: ds_put_format (dynamic-string.c:142)
   by 0x40D380: build_acls (ovn-northd.c:2320)
   by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
   by 0x4072D9: build_lflows (ovn-northd.c:3845)
   by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
   by 0x4072D9: main (ovn-northd.c:4375)

9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93
   at 0x4C29BFD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4C2BACB: realloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x449507: xrealloc (util.c:123)
   by 0x42CC73: ds_reserve (dynamic-string.c:63)
   by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
   by 0x42D176: ds_put_format (dynamic-string.c:142)
   by 0x40D505: build_acls (ovn-northd.c:2346)
   by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
   by 0x4072D9: build_lflows (ovn-northd.c:3845)
   by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
   by 0x4072D9: main (ovn-northd.c:4375)
---
 ovn/northd/ovn-northd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 625937d..756d188 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -2324,6 +2324,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows)
 ovn_lflow_add(
 lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr(),
 actions);
+ds_destroy();
 }
 }
 
@@ -2350,6 +2351,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows)
 ovn_lflow_add(
 lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr(),
 actions);
+ds_destroy();
 }
 }
 }
-- 
1.8.3.1

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev