1. guzip the corefile.
sudo gunzip core.versa-vsmd.2178.J07430-fx-Tcube-D1019000137.1564546882.gz
2. Go to the directory where binary files are available.
[admin@DualCPE12: ~] $ cd /home/versa/16776/versa-flexvnf-support-dump-2019-Jul-31-170506.gz/versa-flexvnf-support-dump-2019-Jul-31-170506.gz/versa-flexvnf-support-dump-2019-Jul-31-170506/versa-flexvnf-support-dump-2019-Jul-31-170506/
[admin@DualCPE12: versa-flexvnf-support-dump-2019-Jul-31-170506] $
[admin@DualCPE12: versa-flexvnf-support-dump-2019-Jul-31-170506] $
[admin@DualCPE12: versa-flexvnf-support-dump-2019-Jul-31-170506] $ ll
total 195M
-rw-r----- 1 admin versa 2.4M Jul 31 01:07 confd_show.txt
-rw-r----- 1 admin versa 30K Jul 31 01:08 monit.log
-rw-r----- 1 admin versa 725K Jul 31 01:08 confd_cfg.txt
-rw-r----- 1 admin versa 9.0K Jul 31 01:08 boot.log
-rw-r----- 1 admin versa 4.8K Jul 31 01:08 _bash_history
-rw-r----- 1 admin versa 760K Jul 31 01:08 vsmd_vty.txt
-rw-r----- 1 admin versa 384K Jul 31 01:08 vmod_vty.txt
-rw-r----- 1 admin versa 251K Jul 31 01:08 vstated_vty.txt
-rw-r----- 1 admin versa 14K Jul 31 01:08 rfd_vty.txt
-rw-r----- 1 admin versa 60 Jul 31 01:08 ip2usr_vty.txt
-rw-r----- 1 admin versa 16K Jul 31 01:08 infmgr_vty.txt
-rw-r----- 1 admin versa 20K Jul 31 01:08 syslog.3.gz
-rw-r----- 1 admin versa 34K Jul 31 01:08 syslog.2.gz
-rw-r----- 1 admin versa 519K Jul 31 01:08 syslog.1
-rw-r----- 1 admin versa 557K Jul 31 01:08 syslog
-rw-r----- 1 admin versa 1.5M Jul 31 01:08 sys_state.txt
-rw-r----- 1 admin versa 188M Jul 31 01:08 versa-vsmd <<<<<<<<<<<<<<<<<<<<<Check the binary you are looking for
-rw-r----- 1 admin versa 443 Jul 31 01:08 status
drwxr-x--- 2 admin versa 4.0K Aug 20 14:35 cdb
drwxr-x--- 3 admin versa 4.0K Aug 20 14:35 etc
drwxr-x--- 2 admin versa 4.0K Aug 20 14:35 hidden
drwxr-x--- 2 admin versa 4.0K Aug 20 14:35 keys
drwxr-x--- 3 admin versa 4.0K Aug 20 14:35 lib
drwxr-x--- 2 admin versa 4.0K Aug 20 14:35 run
drwxr-x--- 2 admin versa 4.0K Aug 20 14:35 sysconfigs
drwxr-x--- 3 admin versa 4.0K Aug 20 14:35 var
drwxr-x--- 6 admin versa 4.0K Aug 20 14:45 versa
[admin@DualCPE12: versa-flexvnf-support-dump-2019-Jul-31-170506] $
3. Then gdb the binary.
In the example, the core-dump is with VSMD.
[admin@DualCPE12: versa-flexvnf-support-dump-2019-Jul-31-170506] $
[admin@DualCPE12: versa-flexvnf-support-dump-2019-Jul-31-170506] $ gdb versa-vsmd <<<<<<<<<<<<<<<<gdb the binary you are looking for.
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.3) 7.7.1
Copyright (C) 2014 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 versa-vsmd...done.
(gdb) core /home/versa/16776/versa-flexvnf-support-dump-2019-Jul-31-170506.gz/versa-flexvnf-support-dump-2019-Jul-31-170506.gz/core.versa-vsmd.2178.J07430-fx-Tcube-D1019000137.1564546882 <<<<<<<<<<<<<<<< Enter the core file name with directory.
warning: exec file is newer than core file.
[New LWP 3861]
[New LWP 3863]
[New LWP 3866]
[New LWP 2178]
[New LWP 3867]
[New LWP 3862]
[New LWP 3865]
[New LWP 3860]
[New LWP 4204]
[New LWP 3864]
[New LWP 4080]
[New LWP 4147]
[New LWP 4157]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/opt/versa/bin/versa-vsmd -N -H 0'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007fe15d5ed1fb in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
(gdb) bt <<<<<<<<<<<<<<<< Type bt for backtrace.
#0 0x00007fe15d5ed1fb in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 <signal handler called>
#2 0x00007fe159f40c37 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007fe159f44028 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007fe159f39bf6 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007fe159f39ca2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x00000000013280a0 in vs_fec_from_wan_proc_fec_pkt (payload=<optimized out>, payload_len=79, seqnum=5, m=0x7fe0bed9dec0,
win_idx=<optimized out>, sess_g_fwctx=0x7fdfa0c50810, tnt_ctx=0x7fe0cd910190) at ../usr/lib/libfec/vs_fec_ext.c:2226
#7 vs_fec_process_from_wan_pkt (sess_ctx=<optimized out>, m=m@entry=0x7fe0bed9dec0, reinit=reinit@entry=false)
at ../usr/lib/libfec/vs_fec_ext.c:2495
#8 0x0000000001303630 in vs_nfp_vmlh_handle_rcv_fec (vmlh_info=vmlh_info@entry=0x7fdfa49ef520, m=m@entry=0x7fe0bed9dec0,
reinit=reinit@entry=false) at ../usr/lib/libvsf/vs_vmlh.c:2438
#9 0x0000000001304460 in vs_nfp_vmlh_process_equal_seq_pkt (sess_hdl=140598597827073, m=0x7fe0bed9dec0, recv_seq=5,
vmlh_info=0x7fdfa49ef520) at ../usr/lib/libvsf/vs_vmlh.c:1918
#10 0x00000000012aa592 in vs_nfp_enter (shdl=140598597827073, m=0x7fe0bed9dec0) at ../usr/lib/libvsf/vs_nfp.c:4355
#11 0x00000000006c85f1 in process_local_pkts (nmbs=2178, mbq=<optimized out>) at ../usr/sbin/vsm/vsm_thrm_pl.c:3482
#12 0x00000000006ceba5 in vsm_process_reinjected_pkts_pl () at ../usr/sbin/vsm/vsm_thrm_pl.c:834
#13 0x00000000006cf7f0 in vsm_pl_proc_io_pkts (works=0x7fe1571303c0, npkts=2) at ../usr/sbin/vsm/vsm_thrm_pl.c:4172
#14 0x00000000006971c6 in vsm_process_thrm_work (works=works@entry=0x7fe1571303c0, nworks=nworks@entry=2,
work_type=work_type@entry=VS_THRM_WORK_TYPE_PKT) at ../usr/sbin/vsm/vsm_thrm.c:3211
#15 0x0000000001481b44 in read_n_dispatch_spsc_ring_pkts (quota=<optimized out>, dispatch_fn=<optimized out>, works=0x7fe1571303c0,
pset=0x7fe15329e4e0) at ../usr/lib/libvsthrm/vs_worker_threads.c:115
#16 process_io_rx_workqs (quota=<optimized out>, tinfo=0x7fe15329e400, ctx=<optimized out>)
at ../usr/lib/libvsthrm/vs_worker_threads.c:200
#17 vs_worker_thread_routine (arg=0x7fe15329e400) at ../usr/lib/libvsthrm/vs_worker_threads.c:633
#18 0x000000000147a6ae in vs_generic_thread_routine (arg=0x7fe15329e400) at ../usr/lib/libvsthrm/vs_thrm.c:204
#19 0x000000000147cf43 in vs_thrm_start_routine (handle=<optimized out>, tgid=<optimized out>, tgid@entry=VS_THREAD_GROUP_MAX,
shared_cpu=shared_cpu@entry=false) at ../usr/lib/libvsthrm/vs_thrm.c:1522
#20 0x000000000069f467 in vsm_thrm_start (arg=<optimized out>) at ../usr/sbin/vsm/vsm_thrm.c:4859
#21 0x00000000016b2835 in eal_thread_loop (arg=<optimized out>) at ../usr/lib/DPDK/lib/librte_eal/linuxapp/eal/eal_thread.c:184
#22 0x00007fe15d5e5184 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#23 0x00007fe15a00803d in clone () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) source /opt/versa/var/gdb/infra.gdb <<<<<<<<<<<<<<<<gdb file, To get IP Address
(gdb) source /opt/versa/var/gdb/mbuf.gdb <<<<<<<<<<<<<<<< gdb file ,To get the DSCP
(gdb) frame 10 <<<<<<<<<<<<<<<< Select the frame you are looking for.
#10 0x00000000012aa592 in vs_nfp_enter (shdl=140598597827073, m=0x7fe0bed9dec0) at ../usr/lib/libvsf/vs_nfp.c:4355
4355 ../usr/lib/libvsf/vs_nfp.c: No such file or directory.
(gdb) gdb_mbuf_ip_print m <<<<<<<<<<<<<<<< To print the IP Address, Ports.
$1 = (struct ip *) 0x7fe0bed9e1aa
protocol: 6
src addr: 202.221.124.16
dst addr: 143.94.155.64
src port: 443
dst port: 49188
(gdb) p/x ((struct ip *)(m->m_hdr.mh_data))->ip_tos <<<<<<<<<<<<<<<< To get the DSCP Value.
$2 = 0xe0
(gdb)