Hi Slava, On Wed, Jan 29, 2020 at 12:31:35PM +0000, Slava Ovsiienko wrote: > While working on the unit test for the mbuf with pinned external buffers I > found that: > app/test/test_mbuf.c: > - test_failing_mbuf_sanity_check() > - verify_mbuf_check_panics(buf) > - fork() > - child process() > > Does not work (either over regular mbufs, not pinned ones) in correct way. > The mbuf being tested is not mapped (in huge page) to child process and it > always completes with seg fault. > The question - is this problem of my setup, or did we change the memory > mapping model > and this unit test should be updated?
I tried to reproduce the issue, but in my case it looks it's working. I added some prints in rte_mbuf_sanity_check() and rte_mbuf_check(). Here is the log on my platform: # cat /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages 512 # ./devtools/test-build.sh -s -v -j16 x86_64-native-linuxapp-gcc [...] # ./x86_64-native-linuxapp-gcc/app/test EAL: Detected 24 lcore(s) EAL: Detected 2 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'PA' EAL: No free hugepages reported in hugepages-2048kB EAL: No available hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... EAL: PCI device 0000:01:00.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:10a7 net_e1000_igb EAL: PCI device 0000:01:00.1 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:10a7 net_e1000_igb EAL: PCI device 0000:04:00.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:10fb net_ixgbe EAL: PCI device 0000:04:00.1 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:10fb net_ixgbe APP: HPET is not enabled, using TSC as default timer RTE>>mbuf_autotest [...] Now checking for error conditions rte_mbuf_sanity_check((nil)) rte_mbuf_check((nil)):188 PANIC in rte_mbuf_sanity_check(): mbuf is NULL 13: [./x86_64-native-linuxapp-gcc/app/test(_start+0x2a) [0x555cc9791a1a]] 12: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7feb31e00b97]] 11: [./x86_64-native-linuxapp-gcc/app/test(main+0x3be) [0x555cc96d868e]] 10: [./x86_64-native-linuxapp-gcc/app/test(cmdline_interact+0x3b) [0x555cc9c07f9b]] 9: [./x86_64-native-linuxapp-gcc/app/test(+0x6299e0) [0x555cc9c079e0]] 8: [./x86_64-native-linuxapp-gcc/app/test(rdline_char_in+0x9d1) [0x555cc9c0b4a1]] 7: [./x86_64-native-linuxapp-gcc/app/test(+0x629ce0) [0x555cc9c07ce0]] 6: [./x86_64-native-linuxapp-gcc/app/test(cmdline_parse+0x328) [0x555cc9c08ce8]] 5: [./x86_64-native-linuxapp-gcc/app/test(+0x1b3b33) [0x555cc9791b33]] 4: [./x86_64-native-linuxapp-gcc/app/test(+0x24b12c) [0x555cc982912c]] 3: [./x86_64-native-linuxapp-gcc/app/test(rte_mbuf_sanity_check+0x130) [0x555cc9b72fa0]] 2: [./x86_64-native-linuxapp-gcc/app/test(__rte_panic+0xbd) [0x555cc96c8a62]] 1: [./x86_64-native-linuxapp-gcc/app/test(rte_dump_stack+0x2e) [0x555cc9be749e]] rte_mbuf_sanity_check(0x7ffdf4c53f00) rte_mbuf_check(0x7ffdf4c53f00):188 rte_mbuf_check(0x7ffdf4c53f00):194 PANIC in rte_mbuf_sanity_check(): bad mbuf pool 13: [./x86_64-native-linuxapp-gcc/app/test(_start+0x2a) [0x555cc9791a1a]] 12: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7feb31e00b97]] 11: [./x86_64-native-linuxapp-gcc/app/test(main+0x3be) [0x555cc96d868e]] 10: [./x86_64-native-linuxapp-gcc/app/test(cmdline_interact+0x3b) [0x555cc9c07f9b]] 9: [./x86_64-native-linuxapp-gcc/app/test(+0x6299e0) [0x555cc9c079e0]] 8: [./x86_64-native-linuxapp-gcc/app/test(rdline_char_in+0x9d1) [0x555cc9c0b4a1]] 7: [./x86_64-native-linuxapp-gcc/app/test(+0x629ce0) [0x555cc9c07ce0]] 6: [./x86_64-native-linuxapp-gcc/app/test(cmdline_parse+0x328) [0x555cc9c08ce8]] 5: [./x86_64-native-linuxapp-gcc/app/test(+0x1b3b33) [0x555cc9791b33]] 4: [./x86_64-native-linuxapp-gcc/app/test(+0x24b149) [0x555cc9829149]] 3: [./x86_64-native-linuxapp-gcc/app/test(rte_mbuf_sanity_check+0x130) [0x555cc9b72fa0]] 2: [./x86_64-native-linuxapp-gcc/app/test(__rte_panic+0xbd) [0x555cc96c8a62]] 1: [./x86_64-native-linuxapp-gcc/app/test(rte_dump_stack+0x2e) [0x555cc9be749e]] rte_mbuf_sanity_check(0x7ffdf4c53f00) rte_mbuf_check(0x7ffdf4c53f00):188 rte_mbuf_check(0x7ffdf4c53f00):194 PANIC in rte_mbuf_sanity_check(): bad IO addr 13: [./x86_64-native-linuxapp-gcc/app/test(_start+0x2a) [0x555cc9791a1a]] 12: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7feb31e00b97]] 11: [./x86_64-native-linuxapp-gcc/app/test(main+0x3be) [0x555cc96d868e]] 10: [./x86_64-native-linuxapp-gcc/app/test(cmdline_interact+0x3b) [0x555cc9c07f9b]] 9: [./x86_64-native-linuxapp-gcc/app/test(+0x6299e0) [0x555cc9c079e0]] 8: [./x86_64-native-linuxapp-gcc/app/test(rdline_char_in+0x9d1) [0x555cc9c0b4a1]] 7: [./x86_64-native-linuxapp-gcc/app/test(+0x629ce0) [0x555cc9c07ce0]] 6: [./x86_64-native-linuxapp-gcc/app/test(cmdline_parse+0x328) [0x555cc9c08ce8]] 5: [./x86_64-native-linuxapp-gcc/app/test(+0x1b3b33) [0x555cc9791b33]] 4: [./x86_64-native-linuxapp-gcc/app/test(+0x24b149) [0x555cc9829149]] 3: [./x86_64-native-linuxapp-gcc/app/test(rte_mbuf_sanity_check+0x130) [0x555cc9b72fa0]] 2: [./x86_64-native-linuxapp-gcc/app/test(__rte_panic+0xbd) [0x555cc96c8a62]] 1: [./x86_64-native-linuxapp-gcc/app/test(rte_dump_stack+0x2e) [0x555cc9be749e]] rte_mbuf_sanity_check(0x7ffdf4c53f00) rte_mbuf_check(0x7ffdf4c53f00):188 rte_mbuf_check(0x7ffdf4c53f00):194 PANIC in rte_mbuf_sanity_check(): bad virt addr 13: [./x86_64-native-linuxapp-gcc/app/test(_start+0x2a) [0x555cc9791a1a]] 12: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7feb31e00b97]] 11: [./x86_64-native-linuxapp-gcc/app/test(main+0x3be) [0x555cc96d868e]] 10: [./x86_64-native-linuxapp-gcc/app/test(cmdline_interact+0x3b) [0x555cc9c07f9b]] 9: [./x86_64-native-linuxapp-gcc/app/test(+0x6299e0) [0x555cc9c079e0]] 8: [./x86_64-native-linuxapp-gcc/app/test(rdline_char_in+0x9d1) [0x555cc9c0b4a1]] 7: [./x86_64-native-linuxapp-gcc/app/test(+0x629ce0) [0x555cc9c07ce0]] 6: [./x86_64-native-linuxapp-gcc/app/test(cmdline_parse+0x328) [0x555cc9c08ce8]] 5: [./x86_64-native-linuxapp-gcc/app/test(+0x1b3b33) [0x555cc9791b33]] 4: [./x86_64-native-linuxapp-gcc/app/test(+0x24b149) [0x555cc9829149]] 3: [./x86_64-native-linuxapp-gcc/app/test(rte_mbuf_sanity_check+0x130) [0x555cc9b72fa0]] 2: [./x86_64-native-linuxapp-gcc/app/test(__rte_panic+0xbd) [0x555cc96c8a62]] 1: [./x86_64-native-linuxapp-gcc/app/test(rte_dump_stack+0x2e) [0x555cc9be749e]] rte_mbuf_sanity_check(0x7ffdf4c53f00) rte_mbuf_check(0x7ffdf4c53f00):188 rte_mbuf_check(0x7ffdf4c53f00):194 rte_mbuf_check(0x7ffdf4c53f00):209 PANIC in rte_mbuf_sanity_check(): bad ref cnt 13: [./x86_64-native-linuxapp-gcc/app/test(_start+0x2a) [0x555cc9791a1a]] 12: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7feb31e00b97]] 11: [./x86_64-native-linuxapp-gcc/app/test(main+0x3be) [0x555cc96d868e]] 10: [./x86_64-native-linuxapp-gcc/app/test(cmdline_interact+0x3b) [0x555cc9c07f9b]] 9: [./x86_64-native-linuxapp-gcc/app/test(+0x6299e0) [0x555cc9c079e0]] 8: [./x86_64-native-linuxapp-gcc/app/test(rdline_char_in+0x9d1) [0x555cc9c0b4a1]] 7: [./x86_64-native-linuxapp-gcc/app/test(+0x629ce0) [0x555cc9c07ce0]] 6: [./x86_64-native-linuxapp-gcc/app/test(cmdline_parse+0x328) [0x555cc9c08ce8]] 5: [./x86_64-native-linuxapp-gcc/app/test(+0x1b3b33) [0x555cc9791b33]] 4: [./x86_64-native-linuxapp-gcc/app/test(+0x24b149) [0x555cc9829149]] 3: [./x86_64-native-linuxapp-gcc/app/test(rte_mbuf_sanity_check+0x130) [0x555cc9b72fa0]] 2: [./x86_64-native-linuxapp-gcc/app/test(__rte_panic+0xbd) [0x555cc96c8a62]] 1: [./x86_64-native-linuxapp-gcc/app/test(rte_dump_stack+0x2e) [0x555cc9be749e]] rte_mbuf_sanity_check(0x7ffdf4c53f00) rte_mbuf_check(0x7ffdf4c53f00):188 rte_mbuf_check(0x7ffdf4c53f00):194 rte_mbuf_check(0x7ffdf4c53f00):209 PANIC in rte_mbuf_sanity_check(): bad ref cnt 13: [./x86_64-native-linuxapp-gcc/app/test(_start+0x2a) [0x555cc9791a1a]] 12: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7feb31e00b97]] 11: [./x86_64-native-linuxapp-gcc/app/test(main+0x3be) [0x555cc96d868e]] 10: [./x86_64-native-linuxapp-gcc/app/test(cmdline_interact+0x3b) [0x555cc9c07f9b]] 9: [./x86_64-native-linuxapp-gcc/app/test(+0x6299e0) [0x555cc9c079e0]] 8: [./x86_64-native-linuxapp-gcc/app/test(rdline_char_in+0x9d1) [0x555cc9c0b4a1]] 7: [./x86_64-native-linuxapp-gcc/app/test(+0x629ce0) [0x555cc9c07ce0]] 6: [./x86_64-native-linuxapp-gcc/app/test(cmdline_parse+0x328) [0x555cc9c08ce8]] 5: [./x86_64-native-linuxapp-gcc/app/test(+0x1b3b33) [0x555cc9791b33]] 4: [./x86_64-native-linuxapp-gcc/app/test(+0x24b149) [0x555cc9829149]] 3: [./x86_64-native-linuxapp-gcc/app/test(rte_mbuf_sanity_check+0x130) [0x555cc9b72fa0]] 2: [./x86_64-native-linuxapp-gcc/app/test(__rte_panic+0xbd) [0x555cc96c8a62]] 1: [./x86_64-native-linuxapp-gcc/app/test(rte_dump_stack+0x2e) [0x555cc9be749e]] Can you give more details about how you start the test? Thanks, Olivier