public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Jacob Kroon <jacob.kroon@gmail.com>
Cc: Jacob Kroon via Gdb <gdb@sourceware.org>
Subject: Re: Debugging ld.so in gdb
Date: Mon, 07 Feb 2022 13:27:54 +0100	[thread overview]
Message-ID: <87wni6amk5.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <3e08e7c7-05f5-16f2-50cb-036687386997@gmail.com> (Jacob Kroon's message of "Mon, 7 Feb 2022 13:15:28 +0100")

* Jacob Kroon:

>> What I find really confusing is that this is not the result of a dlopen
>> call.  I definitely would expect that the maps array contains *all*
>> objects that are being loaded.  Clearly this is not the case here.
>> Somehow certain objects are missing, and then they get written into the
>> rpo array.
>> 
>> Please try to find libjvm.so among the l_initfini arrays of the objects.
>
> I do find libjvm.so in a couple of the maps[]->l_initfini[]->l_name
> arrays, yes.

Okay, and of course there is an assumption that those make it to the
maps.  No wonder we run off the array.

>> It must be present somewhere.  I assume it's also on the main list,
>> which starts off at _rtld_global._dl_ns[0]._ns_loaded.
>
> Hmm how do I iterate over that data structure ?
>
> See below:
>> (gdb) print _rtld_global._dl_ns[0]._ns_loaded[0]->l_name
>> $186 = 0x7ffff7ff1d97 ""
>> (gdb) print _rtld_global._dl_ns[0]._ns_loaded[1]->l_name
>> $187 = 0x0
>> (gdb) print _rtld_global._dl_ns[0]._ns_loaded[2]->l_name
>> $188 = 0x0
>> (gdb) print _rtld_global._dl_ns[0]._ns_loaded->l_name
>> $189 = 0x7ffff7ff1d97 ""
>> (gdb) print _rtld_global._dl_ns[1]._ns_loaded->l_name
>> Cannot access memory at address 0x8
>> (gdb) print _rtld_global._dl_ns[2]._ns_loaded->l_name
>> Cannot access memory at address 0x8

It's a list chained by l_prev/l_next.

Thanks,
Florian


  reply	other threads:[~2022-02-07 12:28 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 [this message]
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

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=87wni6amk5.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=jacob.kroon@gmail.com \
    /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).