fengggli / comanche

comanche
Apache License 2.0
0 stars 1 forks source link

[illegal free after upgrading to new dpdk/spdk] #1

Open fengggli opened 5 years ago

fengggli commented 5 years ago

After upgrading dpdk/spdk, the src/lib/core unit test failed.

Debug output

(base) fengggli@ribbit5(:):~/WorkSpace/comanche/build$gdb ./src/lib/core/unit_test/core-test1
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./src/lib/core/unit_test/core-test1...done.
(gdb) r
Starting program: /home/fengggli/WorkSpace/comanche/build/src/lib/core/unit_test/core-test1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[==========] Running 3 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 3 tests from Core_test
[ RUN      ] Core_test.DPDKInit
[LOG]:Using API defined memory limit 32 MB
[LOG]:CPU count: 48
[New Thread 0x7ffff53f1700 (LWP 47948)]
[New Thread 0x7ffff4bf0700 (LWP 47949)]
EAL: No available hugepages reported in hugepages-1048576kB
...
...
[LOG]:##- freeing DPDK memory: 0x1011e5000

Thread 1 "core-test1" received signal SIGSEGV, Segmentation fault.
0x00007ffff6f06898 in malloc_heap_free (elem=<optimized out>)
    at /home/fengggli/WorkSpace/comanche/src/lib/dpdk/dpdk-19.05/lib/librte_eal/common/malloc_heap.c:888
888                     if (tmp->flags & RTE_MEMSEG_FLAG_DO_NOT_FREE) {
(gdb) bt
#0  0x00007ffff6f06898 in malloc_heap_free (elem=<optimized out>)
    at /home/fengggli/WorkSpace/comanche/src/lib/dpdk/dpdk-19.05/lib/librte_eal/common/malloc_heap.c:888
#1  0x00007ffff6f0079c in rte_free (addr=addr@entry=0x1011e5000)
    at /home/fengggli/WorkSpace/comanche/src/lib/dpdk/dpdk-19.05/lib/librte_eal/common/rte_malloc.c:34
#2  0x00007ffff74843df in Core::Physical_memory::free_io_buffer (this=<optimized out>, io_mem=4313731072)
    at /home/fengggli/WorkSpace/comanche/src/lib/core/src/physical_memory.cpp:118
#3  0x000055555555ea37 in (anonymous namespace)::Core_test_MemoryAllocation_Test::TestBody (this=<optimized out>)
    at /home/fengggli/WorkSpace/comanche/src/lib/core/unit_test/test1.cpp:64
#4  0x00005555555890f1 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ()
#5  0x0000555555583097 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ()
#6  0x00005555555668d6 in testing::Test::Run() ()
#7  0x000055555556720c in testing::TestInfo::Run() ()
#8  0x0000555555567896 in testing::TestCase::Run() ()
#9  0x000055555556e762 in testing::internal::UnitTestImpl::RunAllTests() ()
#10 0x000055555558a2b7 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ()
#11 0x0000555555583ed3 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ()
#12 0x000055555556d326 in testing::UnitTest::Run() ()
#13 0x000055555555c2ef in RUN_ALL_TESTS () at /usr/local/include/gtest/gtest.h:2233
#14 main (argc=<optimized out>, argv=<optimized out>)
    at /home/fengggli/WorkSpace/comanche/src/lib/core/unit_test/test1.cpp:104
fengggli commented 5 years ago

phsycial_memory.alloc works only if block_device is initialized. What is done in block device?

fengggli commented 5 years ago

Why even this also failed??

(base) fengggli@ribbit5(:):~/WorkSpace/dpdk905$sudo ./dpdk-19.05/build/app/test
[sudo] password for fengggli:
EAL: Detected 48 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: PCI device 0000:06:00.0 on NUMA socket 0
EAL:   probe driver: 8086:1521 net_e1000_igb
EAL: PCI device 0000:06:00.1 on NUMA socket 0
EAL:   probe driver: 8086:1521 net_e1000_igb
EAL: PCI device 0000:06:00.2 on NUMA socket 0
EAL:   probe driver: 8086:1521 net_e1000_igb
EAL: PCI device 0000:06:00.3 on NUMA socket 0
EAL:   probe driver: 8086:1521 net_e1000_igb
Segmentation fault

I will look back sometime later, wasted too much time

fengggli commented 5 years ago

Previous note in dpdk repository is here: https://github.com/fengggli/dpdk/issues/1