Thanks to visit codestin.com
Credit goes to github.com

Skip to content

vpp, including npdi lib, complied by asan, generate a SIGEGV signal callbak #2100

@nanfengnan1

Description

@nanfengnan1

prerequires:
vpp import include and lib file of the ndpi and the program may work out when don't start asan function .
compile steps:

  1. make build VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON
  2. gdb vpp and r -c vpp-startup.conf
    questions:
    it will be droped, when you execute second step op.
    callback:
    [root@localhost dpu]# gdb vpp
    GNU gdb (GDB) Red Hat Enterprise Linux 8.2-16.el8
    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-redhat-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 vpp...done.
(gdb) r -c vpp-startup.conf
Starting program: /opt/dpu/build-root/install-vpp_debug-native/vpp/bin/vpp -c vpp-startup.conf
Missing separate debuginfos, use: yum debuginfo-install glibc-2.28-164.el8.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00000000004354a5 in __asan::FakeStack::AddrIsInFakeStack(unsigned long, unsigned long*, unsigned long*) ()
Missing separate debuginfos, use: yum debuginfo-install libgcc-8.5.0-4.el8_5.x86_64 libnl3-3.5.0-1.el8.x86_64 libstdc++-8.5.0-4.el8_5.x86_64 numactl-libs-2.0.12-13.el8.x86_64 openssl-libs-1.1.1k-5.el8_5.x86_64 pcre2-10.32-2.el8.x86_64 zlib-1.2.11-17.el8.x86_64
(gdb) bt
#0 0x00000000004354a5 in __asan::FakeStack::AddrIsInFakeStack(unsigned long, unsigned long*, unsigned long*) ()
#1 0x00000000004d1a85 in __asan::ThreadStackContainsAddress(__sanitizer::ThreadContextBase*, void*) ()
#2 0x00000000004e89ab in __sanitizer::ThreadRegistry::FindThreadContextLocked(bool ()(__sanitizer::ThreadContextBase, void*), void*) ()
#3 0x00000000004d3190 in __asan::FindThreadByStackAddress(unsigned long) ()
#4 0x0000000000431513 in __asan::AddressDescription::AddressDescription(unsigned long, unsigned long, bool) ()
#5 0x0000000000433e32 in __asan::ErrorGeneric::ErrorGeneric(unsigned int, unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long) ()
#6 0x00000000004cc626 in __asan::ReportGenericError(unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool) ()
#7 0x00000000004418bf in __interceptor_memset.part.46 ()
#8 0x00007ffee397d3f1 in ndpi_init_detection_module (prefs=0) at ndpi_main.c:2347
#9 0x00007ffee3971012 in ndpi_workflow_init (prefs=0x7ffedba5ee60, pcap_handle=0x0) at reader_util.c:445
#10 0x00007ffee38ae77f in dpi_init (thread_id=0, discover_protocol=0x7ffee38aec00 <dpi_discovered_callback>,
no_discover_protocol=0x7ffee38aeee0 <dpi_not_discovered_callback>)
at /opt/dpu/src/plugins/intelligent-gw/gw_process/parse_l7.c:552
#11 0x00007ffee38add8b in parse_l7_init () at /opt/dpu/src/plugins/intelligent-gw/gw_process/parse_l7.c:1262
#12 0x00007ffee37df622 in gw_process_init (vm=0x7ffeefe00680) at /opt/dpu/src/plugins/intelligent-gw/gw_process/gw_process.c:5783
#13 0x00007ffff4130285 in call_init_exit_functions_internal (vm=0x7ffeefe00680, headp=0x7d38f0 <vlib_global_main+368>, call_once=1,
do_sort=1, is_global=1) at /opt/dpu/src/vlib/init.c:363
#14 0x00007ffff412fedf in vlib_call_init_exit_functions (vm=0x7ffeefe00680, headp=0x7d38f0 <vlib_global_main+368>, call_once=1,
is_global=1) at /opt/dpu/src/vlib/init.c:377
#15 0x00007ffff413039a in vlib_call_all_init_functions (vm=0x7ffeefe00680) at /opt/dpu/src/vlib/init.c:400
#16 0x00007ffff41783b9 in vlib_main (vm=0x7ffeefe00680, input=0x7ffedba5fee0) at /opt/dpu/src/vlib/main.c:1952
#17 0x00007ffff42611cf in thread0 (arg=140732922857088) at /opt/dpu/src/vlib/unix/main.c:694
#18 0x00007ffff363941c in clib_calljmp () at /opt/dpu/src/vppinfra/longjmp.S:123
#19 0x00007fffffffcf00 in ?? ()
#20 0x00007ffff4260790 in vlib_unix_main (argc=169, argv=0x61a000009680) at /opt/dpu/src/vlib/unix/main.c:774
#21 0x000000000050509c in main (argc=169, argv=0x61a000009680) at /opt/dpu/src/vpp/vnet/main.c:342

and i test a program of memory leak, google asan tools may work out. so i'm not sure why this program will call down. i try to check frame 8 callback stack, bu i don't find any errors. so i need help from anyone!!!, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions