[ovs-discuss] memory leak in openvswitch-2.0.0

Ben Pfaff blp at nicira.com
Tue Apr 8 17:29:48 UTC 2014


On Tue, Apr 08, 2014 at 03:51:33AM +0000, Yinpeijun wrote:
> 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.

This is certainly a bug that should be fixed, but I'm having trouble
matching up the line numbers in the valgrind output above with the
code that you quoted.  What are the line numbers for the code you
quoted above?  Are you using exactly the openvswitch 2.0.0 release, or
a different release, or a modified version of some release?



More information about the discuss mailing list