How to do it...

Once the target has booted, you can start the wvdial application through the native GDB using the following steps:

  1. In the target Command Prompt, start the GDB debugger with the application as argument:
# gdb --args wvdial -c  
  1. Now instruct GDB to run the application:
(gdb) run
Starting program: /usr/bin/wvdial -c
    
Program received signal SIGILL, Illegal instruction.
_armv7_tick () at armv4cpuid.S:94
94              mrrc    p15,1,r0,r1,c14         @ CNTVCT
  
  1. To obtain the PID of the process being debugged from the GDB console (which we will use later on when we send a signal to it), type the following:
(gdb) info inferiors  
  1. Then request to print a backtrace:
(gdb) bt
#0  _armv7_tick () at armv4cpuid.S:94
#1  0x768c782c in OPENSSL_cpuid_setup () at /usr/src/debug/openssl/1.0.2l-r0/openssl-1.0.2l/crypto/armcap.c:157
#2  0x76fde148 in call_init (l=<optimized out>, argc=argc@entry=2, argv=argv@entry=0x7efffdf4, env=env@entry=0x7efffe00)
at /usr/src/debug/glibc/2.26-r0/git/elf/dl-init.c:72
#3  0x76fde254 in call_init (env=<optimized out>, argv=<optimized out>, argc=<optimized out>, l=<optimized out>)
at /usr/src/debug/glibc/2.26-r0/git/elf/dl-init.c:30
#4  _dl_init (main_map=0x76fff908, argc=2, argv=0x7efffdf4, env=0x7efffe00) at /usr/src/debug/glibc/2.26-r0/git/elf/dl-init.c:120
#5  0x76fceac4 in _dl_start_user () from /lib/ld-linux-armhf.so.3
Backtrace stopped: previous frame identical to this frame (corrupt stack?)  

This is not the same backtrace you got when analyzing the core dump. What is going on here? The clue is on libcrypto, part of the OpenSSL library. OpenSSL probes the capabilities of the system by trying each capability and trapping the illegal instruction errors. So the SIGILL signal you are seeing during startup is normal and you should instruct GDB to continue as follows:

(gdb) c
Continuing.
--> WvDial: Internet dialer version 1.61
--> Warning: section [Dialer Defaults] does not exist in wvdial.conf.
--> Initializing modem.
--> Sending: ATZ    
  
  1. We will now send the SIGSEGV signal from a different shell with the following:
# kill -SEGV <wvdial-pid>
    
Program received signal SIGSEGV, Segmentation fault.
0x76b45c7c in __GI___select (nfds=1, readfds=0x7effdfe8, writefds=0x7effe068, exceptfds=0x7effe0e8, timeout=0x7effdfb8)
 at /usr/src/debug/glibc/2.26-r0/git/sysdeps/unix/sysv/linux/select.c:41
41        return SYSCALL_CANCEL (select, nfds, readfds, writefds, exceptfds,  
  1. And then request the backtrace:
(gdb) bt
#0  0x76b45c7c in __GI___select (nfds=1, readfds=0x7effdfe8, writefds=0x7effe068, exceptfds=0x7effe0e8, timeout=0x7effdfb8)
  at /usr/src/debug/glibc/2.26-
r0/git/sysdeps/unix/sysv/linux/select.c:41
#1 0x76db5cd8 in WvStream::_do_select(IWvStream::SelectInfo&) () from /usr/lib/libwvbase.so.4.6 #2 0x76db5ea4 in WvStream::_select(long, bool, bool, bool, bool) () from /usr/lib/libwvbase.so.4.6 #3 0x000191bc in WvStream::select (isex=false, writable=false, readable=true, msec_timeout=1, this=<optimized out>) at /usr/include/wvstreams/wvstream.h:417 #4 WvDialer::wait_for_modem (this=this@entry=0x7effec80, strs=0x0, strs@entry=0x76df6c00 <WvFastString::nullbuf>, timeout=1, timeout@entry=5000, neednewline=neednewline@entry=true,
verbose=verbose@entry=true)
at /usr/src/debug/wvdial/1.61-r0/wvdial-1.61/wvdialer.cc:1357 #5 0x00019b60 in WvDialer::init_modem (this=this@entry=0x7effec80) at /usr/src/debug/wvdial/1.61-r0/wvdial-1.61/wvdialer.cc:768 #6 0x0001c9c0 in WvDialer::WvDialer (this=0x7effec80, _cfg=..., _sect_list=<optimized out>, _chat_mode=<optimized out>) at /usr/src/debug/wvdial/1.61-r0/wvdial-1.61/wvdialer.cc:119 #7 0x00014d74 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/wvdial/1.61-r0/wvdial-1.61/wvdial.cc:212

This result is now compatible with the core dump we saw in the previous recipe.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset