[ovs-discuss] memory leak in openvswitch-2.0.0

Yinpeijun yinpeijun at huawei.com
Tue Apr 8 03:51:33 UTC 2014


Hello everyone, Recently, I use openvswitch-2.0.0 to test send packets between the vms, duration the test I use valgrind to

catch if there is memory leak in ovs-vswitched process , after test I see the valgrind log as follow :

==12453== Invalid read of size 8
==12453==    at 0x424B06: handle_flow_misses (ofproto-dpif.c:3501)
==12453==    by 0x425A3A: handle_upcalls (ofproto-dpif.c:3632)
==12453==    by 0x425C7D: type_run_fast (ofproto-dpif.c:1041)
==12453==    by 0x412651: ofproto_type_run_fast (ofproto.c:1332)
==12453==    by 0x406AC4: bridge_run_fast (bridge.c:2384)
==12453==    by 0x40D8ED: main (ovs-vswitchd.c:117)
==12453==  Address 0x8122820 is 1,120 bytes inside a block of size 1,144 free'd
==12453==    at 0x4C263F0: free (vg_replace_malloc.c:446)
==12453==    by 0x424948: handle_flow_misses (ofproto-dpif.c:4599)
==12453==    by 0x425A3A: handle_upcalls (ofproto-dpif.c:3632)
==12453==    by 0x425C7D: type_run_fast (ofproto-dpif.c:1041)
==12453==    by 0x412651: ofproto_type_run_fast (ofproto.c:1332)
==12453==    by 0x406AC4: bridge_run_fast (bridge.c:2384)
==12453==    by 0x40D8ED: main (ovs-vswitchd.c:117)

==12453== Invalid write of size 4
==12453==    at 0x424B41: handle_flow_misses (ofproto-dpif.c:3507)
==12453==    by 0x425A3A: handle_upcalls (ofproto-dpif.c:3632)
==12453==    by 0x425C7D: type_run_fast (ofproto-dpif.c:1041)
==12453==    by 0x412651: ofproto_type_run_fast (ofproto.c:1332)
==12453==    by 0x406AC4: bridge_run_fast (bridge.c:2384)
==12453==    by 0x40D8ED: main (ovs-vswitchd.c:117)
==12453==  Address 0x8122828 is 1,128 bytes inside a block of size 1,144 free'd
==12453==    at 0x4C263F0: free (vg_replace_malloc.c:446)
==12453==    by 0x424948: handle_flow_misses (ofproto-dpif.c:4599)
==12453==    by 0x425A3A: handle_upcalls (ofproto-dpif.c:3632)
==12453==    by 0x425C7D: type_run_fast (ofproto-dpif.c:1041)
==12453==    by 0x412651: ofproto_type_run_fast (ofproto.c:1332)
==12453==    by 0x406AC4: bridge_run_fast (bridge.c:2384)
==12453==    by 0x40D8ED: main (ovs-vswitchd.c:117)

then I find the code as follow:

    if (list_is_empty(&facet->subfacets)) {
        subfacet = &facet->one_subfacet;
    } else {
        subfacet = subfacet_find(backer, key, key_len, key_hash);
        if (subfacet) {
            if (subfacet->facet == facet) {
                return subfacet;
            }

            /* This shouldn't happen. */
            VLOG_ERR_RL(&rl, "subfacet with wrong facet");
            subfacet_destroy(subfacet);
        }
So , I should annotation or delete the code above? Any advice on this would be greatly appreciated.

thanks


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20140408/0357f73d/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1089 bytes
Desc: image001.gif
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20140408/0357f73d/attachment-0002.gif>


More information about the discuss mailing list