I am trying to debug a segfault while running an application on linux ( ARM architecture). I copied the core dump file and tried to get the backtrace using arm-gdb on x86_64 host. This is the o/p:
$ arm-arago-linux-gnueabi-gdb test_slave6_slave core
GNU gdb (GDB) 7.4
Copyright (C) 2012 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 "--host=i686-oesdk-linux --target=arm-oe-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dvdk/test_slave6_slave...done.
warning: exec file is newer than core file.
[New LWP 6411]
[New LWP 6410]
warning: Could not load shared library symbols for 12 libraries, e.g. /lib/libjson-c.so.2.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/usr/bin/test_slave6_slave 5 111.111.111.111 1 2 1 2'.
Program terminated with signal 11, Segmentation fault.
#0 0x47b61dd4 in ?? ()
(gdb) bt
#0 0x47b61dd4 in ?? ()
#1 0x47b2e0fc in ?? ()
#2 0x47b2e0fc in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
(The timestamp warning might be because I copied the core file first )
I don't think this issue and my issue is same as I am getting valid address. I think it is still a stack corruption issue. But I am not sure how to debug this further. Should I use GDB or valgrind? Can some one point me towards the correct steps for debugging using these tools. For example, should I use memecheck with valgrind with leak_check?
UPDATE 1: I am using libcurl for https requests. I have noticed that the crash does not happen when another version of libcurl without ssl support is used. (query will fail ofcourse). The ssl enabled libcurl was custom compiled by me.