public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jacob Kroon <jacob.kroon@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Jacob Kroon via Gdb <gdb@sourceware.org>
Subject: Re: Debugging ld.so in gdb
Date: Fri, 4 Feb 2022 15:45:13 +0100	[thread overview]
Message-ID: <f4aef4f0-dc07-9477-2a63-e9a259e95f73@gmail.com> (raw)
In-Reply-To: <87y22qognw.fsf@oldenburg.str.redhat.com>

On 2/4/22 15:22, Florian Weimer wrote:
> * Jacob Kroon:
> 
>> This is what I get, following the instructions above:
>>
>>> 171966	   0x00007ffff7fd85a0 <dfs_traversal+80>:	mov    0x0(%r13),%rax
>>> 171967	   0x00007ffff7fd85a4 <dfs_traversal+84>:	lea    -0x8(%rax),%rdx
>>> 171968	   0x00007ffff7fd85a8 <dfs_traversal+88>:	mov    %rdx,0x0(%r13)
>>> 171969	   0x00007ffff7fd85ac <dfs_traversal+92>:	mov    %rbp,-0x8(%rax)
>>> 171970	   0x00007ffff7fd85b0 <dfs_traversal+96>:	add    $0x8,%rsp
>>> 171971	   0x00007ffff7fd85b4 <dfs_traversal+100>:	pop    %rbx
>>> 171972	   0x00007ffff7fd85b5 <dfs_traversal+101>:	pop    %rbp
>>> 171973	   0x00007ffff7fd85b6 <dfs_traversal+102>:	pop    %r12
>>> 171974	   0x00007ffff7fd85b8 <dfs_traversal+104>:	pop    %r13
>>> 171975	   0x00007ffff7fd85ba <dfs_traversal+106>:	ret    
>>
>> Does that make sense ? Any other information I can provide. This is with
>> glibc-2.34-24.fc35.x86_64, Fedora 35.
> 
> This doesn't really make sense.  There's probably some GDB option to get
> a longer trace.
> 
> If it is crashing at the RET, it means that either code has been mapped
> over, or the stack has been corrupted.  At the crash site, what does
> 
>   print *(void**)$rsp
> 
> print?
> 
>   disassemble *(void**)$rsp
> 
> could also be interesting.
> 
> Thanks,
> Florian
> 

I put a breakpoint in "dfs_traversal" and each time I stop in there the
backtrace looks ok, but once the crash has happened, "bt" shows:

> #0  0x00007ffff7fad590 in ?? ()
> #1  0x00007ffff7d31b70 in ?? ()
> #2  0x00007ffff7d32830 in ?? ()
> #3  0x00007ffff7fae150 in ?? ()
> #4  0x00007ffff7fae730 in ?? ()
> #5  0x00007ffff7d32160 in ?? ()
> #6  0x00007ffff7952d30 in ?? ()
> #7  0x00007ffff79d1920 in ?? ()
> #8  0x00007ffff7d31000 in ?? ()
> #9  0x00007ffff79d1ef0 in ?? ()
> #10 0x00007ffff79d24c0 in ?? ()
> #11 0x00007ffff7952000 in ?? ()
> #12 0x00007ffff7952660 in ?? ()
> #13 0x00007ffff79537a0 in ?? ()
> #14 0x00007ffff7d31570 in ?? ()
> #15 0x00007ffff7ffda30 in _rtld_local ()
> #16 0x0000000000000001 in ?? ()
> #17 0xffffffffa5c00000 in ?? ()
> #18 0xffffeffc0b0e0000 in ?? ()
> #19 0x00007ffff795a409 in ?? ()
> #20 0x0000000000000000 in ?? ()

so maybe the stack gets corrupted..

Jacob


      parent reply	other threads:[~2022-02-04 14:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 13:45 Jacob Kroon
2022-02-04 13:58 ` Florian Weimer
2022-02-04 14:09   ` Jacob Kroon
2022-02-04 14:22     ` Florian Weimer
2022-02-04 14:27       ` Jacob Kroon
2022-02-04 16:09         ` Florian Weimer
2022-02-04 16:53           ` Jacob Kroon
2022-02-04 17:04             ` Florian Weimer
2022-02-04 17:11               ` Jacob Kroon
2022-02-04 17:15                 ` Florian Weimer
2022-02-07  8:36                   ` Jacob Kroon
2022-02-07 11:46                     ` Jacob Kroon
2022-02-07 11:55                       ` Florian Weimer
2022-02-07 12:15                         ` Jacob Kroon
2022-02-07 12:27                           ` Florian Weimer
2022-02-07 12:32                             ` Jacob Kroon
2022-02-07 13:39                               ` Jacob Kroon
2022-02-07 13:45                                 ` Jacob Kroon
2022-02-07 13:53                                   ` Adhemerval Zanella
2022-02-07 13:54                                     ` Jacob Kroon
2022-02-07 14:07                                 ` Florian Weimer
2022-02-07 16:28                                   ` Florian Weimer
2022-02-07 17:04                                     ` Jacob Kroon
2022-02-04 14:45       ` Jacob Kroon [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=f4aef4f0-dc07-9477-2a63-e9a259e95f73@gmail.com \
    --to=jacob.kroon@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=gdb@sourceware.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).