[dpdk-dev] [PATCH]librte_eal:add heap lock in malloc_heap_get_stats

Thomas Monjalon thomas at monjalon.net
Fri Oct 6 22:19:22 CEST 2017


Hi,
We need a Signed-off-by to process your contribution.
Thank you

+Cc sergio.gonzalez.monroy at intel.com


21/09/2017 05:19, liucheng (J):
> There is no lock in function malloc_heap_get_stats. When we call this function, the elem may free by other thread.
> 
> the call stack:
> Core was generated by `ovs-vswitchd unix:/usr/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:info'.
> Program terminated with signal 11, Segmentation fault.
> #0  malloc_heap_get_stats (heap=0x7f3abf08ee1c, socket_stats=socket_stats at entry=0x7ffce811ffc0) at /usr/src/debug/dpdk-16.04/lib/librte_eal/common/malloc_heap.c:198
> 198                              socket_stats->heap_freesz_bytes += elem->size;
> (gdb) bt
> #0  malloc_heap_get_stats (heap=0x7f3abf08ee1c, socket_stats=socket_stats at entry=0x7ffce811ffc0) at /usr/src/debug/dpdk-16.04/lib/librte_eal/common/malloc_heap.c:198
> #1  0x00007f3abd6d6299 in rte_malloc_get_socket_stats (socket=socket at entry=0, socket_stats=socket_stats at entry=0x7ffce811ffc0) at /usr/src/debug/dpdk-16.04/lib/librte_eal/common/rte_malloc.c:214
> ......
> 
> lib/librte_eal/common/malloc_heap.c | 3 +++
> lib/librte_eal/common/malloc_heap.h | 2 +-
> 2 files changed, 4 insertions(+), 1 deletion(-)



More information about the dev mailing list