diff mbox series

[ovs-dev] ovsdb-idl: ovsdb_idl_loop_destroy must also destroy the committing txn.

Message ID 20220120130440.32653-1-dceara@redhat.com
State Accepted
Commit 53a540e5311c836b58c7b27a1afb68b6f52bdb75
Headers show
Series [ovs-dev] ovsdb-idl: ovsdb_idl_loop_destroy must also destroy the committing txn. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Dumitru Ceara Jan. 20, 2022, 1:04 p.m. UTC
Found by AddressSanitizer when running OVN tests:
  Direct leak of 64 byte(s) in 1 object(s) allocated from:
      #0 0x498fb2 in calloc (/home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/ic/ovn-ic+0x498fb2)
      #1 0x5f681e in xcalloc__ /home/runner/work/ovn/ovn/ovs/lib/util.c:121:31
      #2 0x5f681e in xzalloc__ /home/runner/work/ovn/ovn/ovs/lib/util.c:131:12
      #3 0x5f681e in xzalloc /home/runner/work/ovn/ovn/ovs/lib/util.c:165:12
      #4 0x5e3697 in ovsdb_idl_txn_add_map_op /home/runner/work/ovn/ovn/ovs/lib/ovsdb-idl.c:4057:29
      #5 0x4d3f25 in update_isb_pb_external_ids /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:576:5
      #6 0x4cc4cc in create_isb_pb /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:716:5
      #7 0x4cc4cc in port_binding_run /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:803:21
      #8 0x4cc4cc in ovn_db_run /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:1700:5
      #9 0x4c9c1c in main /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:1984:17
      #10 0x7f9ad9f4a0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
---
 lib/ovsdb-idl.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ilya Maximets Jan. 31, 2022, 11:24 p.m. UTC | #1
On 1/20/22 14:04, Dumitru Ceara wrote:
> Found by AddressSanitizer when running OVN tests:
>   Direct leak of 64 byte(s) in 1 object(s) allocated from:
>       #0 0x498fb2 in calloc (/home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/ic/ovn-ic+0x498fb2)
>       #1 0x5f681e in xcalloc__ /home/runner/work/ovn/ovn/ovs/lib/util.c:121:31
>       #2 0x5f681e in xzalloc__ /home/runner/work/ovn/ovn/ovs/lib/util.c:131:12
>       #3 0x5f681e in xzalloc /home/runner/work/ovn/ovn/ovs/lib/util.c:165:12
>       #4 0x5e3697 in ovsdb_idl_txn_add_map_op /home/runner/work/ovn/ovn/ovs/lib/ovsdb-idl.c:4057:29
>       #5 0x4d3f25 in update_isb_pb_external_ids /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:576:5
>       #6 0x4cc4cc in create_isb_pb /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:716:5
>       #7 0x4cc4cc in port_binding_run /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:803:21
>       #8 0x4cc4cc in ovn_db_run /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:1700:5
>       #9 0x4c9c1c in main /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:1984:17
>       #10 0x7f9ad9f4a0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
> 
> Signed-off-by: Dumitru Ceara <dceara@redhat.com>
> ---
>  lib/ovsdb-idl.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
> index b7ba25eca6b5..46f51a527356 100644
> --- a/lib/ovsdb-idl.c
> +++ b/lib/ovsdb-idl.c
> @@ -4242,6 +4242,10 @@ void
>  ovsdb_idl_loop_destroy(struct ovsdb_idl_loop *loop)
>  {
>      if (loop) {
> +        if (loop->committing_txn) {
> +            ovsdb_idl_txn_abort(loop->committing_txn);
> +            ovsdb_idl_txn_destroy(loop->committing_txn);
> +        }
>          ovsdb_idl_destroy(loop->idl);
>      }
>  }


Thanks!  Applied and backported down to 2.13.

best regards, Ilya Maximets,
diff mbox series

Patch

diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index b7ba25eca6b5..46f51a527356 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -4242,6 +4242,10 @@  void
 ovsdb_idl_loop_destroy(struct ovsdb_idl_loop *loop)
 {
     if (loop) {
+        if (loop->committing_txn) {
+            ovsdb_idl_txn_abort(loop->committing_txn);
+            ovsdb_idl_txn_destroy(loop->committing_txn);
+        }
         ovsdb_idl_destroy(loop->idl);
     }
 }