public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Kunal Chauhan <atkunalchauhan@gmail.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb@gnu.org
Subject: Re: Fwd: Help: please help to use gdb and its related terms
Date: Sat, 9 May 2020 16:00:17 +0530	[thread overview]
Message-ID: <CACEFAc0p2nWhQ56K85GoNPdrSsMMWE=1c+wFYLbk3FOv=F13-g@mail.gmail.com> (raw)
In-Reply-To: <CACEFAc01nswQx1=+1qfdCkAE4+gYX+KC72rDW4XwC1OFi5_D1w@mail.gmail.com>

On 8 May 2020 10:24 p.m., "Kunal Chauhan" <atkunalchauhan@gmail.com> wrote:

1.Manually unwinding the stack is not clear to me.

2. Also should i compile my binary with debug symbol if yes i have no idea
please help .

3 can i check all the things while compiling binary like crash issue memory
etc?
4. Can I run my binary with gdb at run time?

5. The best to narrow down the crash , if libraries are not under my
control.


Thanks
Kunal


On 7 May 2020 12:43 a.m., "Andrew Burgess" <andrew.burgess@embecosm.com>
wrote:

* Kunal Chauhan via Gdb <gdb@sourceware.org> [2020-05-05 21:39:32 +0530]:

> ---------- Forwarded message ----------
> From: "Kunal Chauhan" <atkunalchauhan@gmail.com>
> Date: 5 May 2020 6:55 p.m.
> Subject: Help: please help to use gdb and its related terms
> To: <gnu@gnu.org>
> Cc:
>
> Hi Team,
>
> Here is some output of gdb I am not understanding .
>
> #0  0xb66e8ee4 in strlen () from /lib/libc.so.6
>
> [Current thread is 1 (LWP 2084)]
>
> (gdb) bt full
>
> #0  0xb66e8ee4 in strlen () from /lib/libc.so.6
>
> No symbol table info available.

You're currently in strlen in libc.so.6 (at address 0xb66e8ee4), but
you don't have debug information available, so GDB will have unwound
the stack using analysis of the function prologue (instead of using
unwind information from the debug info).

>
> #1  0xb6da3854 in ?? () from /opt/qcom/lib/libcurl.so.4
>
> No symbol table info available.

The previous frame was somewhere is libcurl.so.4 (at address
0xb6da3854) , though GDB couldn't find a nearby text symbol (that's
what the '??' tells us).  There's no debug information available for
this library either.  The '??' could be the result of some really
aggressive symbol removal from libcurl, or might indicate that the
previous unwind went wrong and you're not really at 0xb6da3854.

Again, the stack is going to be unwound using prologue analysis as
there's no debug information available.

>
> #2  0x05b40000 in ?? ()
>
> No symbol table info available.

This is starting to look very wrong now (I'm always suspicious of
addresses ending with 0000), GDB couldn't identify a function or even
a file that claims this address.

Again (obviously maybe) no debug information, prologue analysis unwind.

>
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>

After unwinding GDB got back the same stack pointer and program
counter for the previous frame.  This most likely means the prologue
analysis unwinder is trying to unwind an incorrect location, and is
just getting back the same junk each time.

GDB prints the above message and stops to avoid going into an endless
loop.

You should consider installing debug information if possible for libc
and libcurl, this might aid the unwinder.

It's possible that the prologue analysis unwinder went wrong for your
target, you should try manually unwinding the stack (by checking the
ABI for your target, and examining the machine state) and see if you
agree with GDB.

Hope this helps,

Thanks,
Andrew

      parent reply	other threads:[~2020-05-09 10:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CACEFAc3qHWvJkig1Ff1CBkeZ-zTrfMbom5rU+2nXoMW_9m32tg@mail.gmail.com>
2020-05-05 16:09 ` Kunal Chauhan
2020-05-06 19:13   ` Andrew Burgess
     [not found]     ` <CACEFAc3nLTzP1jLLOT6YVTTdMbr__E3BkP5M2Cf3Kpds57HoTA@mail.gmail.com>
     [not found]       ` <CACEFAc01nswQx1=+1qfdCkAE4+gYX+KC72rDW4XwC1OFi5_D1w@mail.gmail.com>
2020-05-09 10:30         ` Kunal Chauhan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACEFAc0p2nWhQ56K85GoNPdrSsMMWE=1c+wFYLbk3FOv=F13-g@mail.gmail.com' \
    --to=atkunalchauhan@gmail.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).