Skip to content

Commit

Permalink
northd: Fix leak of lflow scratchpads.
Browse files Browse the repository at this point in the history
Dynamic strings that backs 'match' and 'actions' are never destroyed
and leaked on every lflow re-build cycle.

 28,224 bytes in 126 blocks are definitely lost in loss record 494 of 498
    at 0x483BD19: realloc (vg_replace_malloc.c:834)
    by 0x4AEF14: xrealloc (util.c:149)
    by 0x465533: ds_reserve (dynamic-string.c:63)
    by 0x46587B: ds_put_format_valist (dynamic-string.c:161)
    by 0x465956: ds_put_format (dynamic-string.c:142)
    by 0x42187F: build_ipv6_input_flows_for_lrouter_port (ovn-northd.c:11188)
    by 0x42187F: build_lswitch_and_lrouter_iterate_by_op (ovn-northd.c:11279)
    by 0x42187F: build_lswitch_and_lrouter_flows.constprop.0 (ovn-northd.c:11316)
    by 0x422503: build_lflows (ovn-northd.c:11398)
    by 0x42478D: ovnnb_db_run (ovn-northd.c:12334)
    by 0x42478D: ovn_db_run (ovn-northd.c:12927)
    by 0x408E84: main (ovn-northd.c:13333)

Fixes: ddf9f1d ("ovn-northd: reorganize processing of lflows")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
igsilya authored and ovsrobot committed Nov 18, 2020
1 parent f9cab11 commit 0fb1029
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions northd/ovn-northd.c
Expand Up @@ -11296,6 +11296,9 @@ build_lswitch_and_lrouter_flows(struct hmap *datapaths, struct hmap *ports,
}
free(svc_check_match);

ds_destroy(&lsi.match);
ds_destroy(&lsi.actions);

/* Legacy lswitch build - to be migrated. */
build_lswitch_flows(datapaths, ports, lflows, mcgroups,
igmp_groups, lbs);
Expand Down

0 comments on commit 0fb1029

Please sign in to comment.