On Sat, Jan 4, 2020 at 2:34 AM Stephen Hemminger <step...@networkplumber.org> wrote: > > Recently started using valgrind with DPDK, and the results > are not clean. > > The DPDK has a function that applications can use to tell it > to cleanup resources on shutdown (rte_eal_cleanup). But the > current coverage of that API is spotty. Many internal parts of > DPDK leave files and allocated memory behind. > > This patch set is a start at getting the sub-parts of > DPDK to cleanup after themselves. These are the easier ones, > the harder and more critical ones are in the drivers > and the memory subsystem. > > There are no visible API or ABI changes here.
I was about to push the series (except patch 10), but I hit a crash when passing an invalid option to test-null.sh. Reproduced with: Core was generated by `/home/dmarchan/builds/x86_64-native-linux-gcc+shared+kmods/app/testpmd -c 0x3 --log-level='. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007fd5231dba64 in pthread_cancel () from /usr/lib64/libpthread.so.0 Missing separate debuginfos, use: dnf debuginfo-install elfutils-libelf-0.178-7.fc30.x86_64 glibc-2.29-28.fc30.x86_64 jansson-2.12-2.fc30.x86_64 libgcc-9.2.1-1.fc30.x86_64 libpcap-1.9.1-1.fc30.x86_64 numactl-libs-2.0.12-2.fc30.x86_64 zlib-1.2.11-19.fc30.x86_64 (gdb) bt full #0 0x00007fd5231dba64 in pthread_cancel () from /usr/lib64/libpthread.so.0 No symbol table info available. #1 0x00007fd52320c586 in rte_eal_cleanup () at /home/dmarchan/dpdk/lib/librte_eal/linux/eal.c:1339 i = 1 #2 0x00007fd523215f5e in rte_exit (exit_code=exit_code@entry=1, format=format@entry=0x47ada4 "Cannot init EAL: %s\n") at /home/dmarchan/dpdk/lib/librte_eal/linux/eal_debug.c:83 ap = {{gp_offset = 24, fp_offset = 48, overflow_arg_area = 0x7ffecdf7aa70, reg_save_area = 0x7ffecdf7a9a0}} #3 0x000000000043535b in main (argc=21, argv=0x7ffecdf7abc8) at /home/dmarchan/dpdk/app/test-pmd/testpmd.c:3647 diag = -1 port_id = <optimized out> count = <optimized out> ret = <optimized out> (gdb) f 1 #1 0x00007fd52320c586 in rte_eal_cleanup () at /home/dmarchan/dpdk/lib/librte_eal/linux/eal.c:1339 1339 pthread_cancel(lcore_config[i].thread_id); (gdb) p lcore_config[1].thread_id $1 = 0 rte_eal_cleanup() is called from rte_exit() by testpmd. But since rte_eal_init() failed at parsing, lcore_config[*].thread_id are invalid, and we crash on pthread_cancel. I have no quick idea to fix this, series postponed to rc2. -- David Marchand