public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Merey <amerey@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH] libdwfl: Correctly handle corefile non-contiguous segments
Date: Tue, 14 Nov 2023 13:46:05 -0500	[thread overview]
Message-ID: <CAJDtP-T+Z-Jr=WnXquAQxN1WxoUk9vn2ouSjVwm7CrGqO37VFA@mail.gmail.com> (raw)
In-Reply-To: <5b0d1e19085a0b29a9b9ca6c14c21746dff8995a.camel@klomp.org>

Hi Mark,

On Tue, Nov 14, 2023 at 9:03 AM Mark Wielaard <mark@klomp.org> wrote:
>
> > A couple caveats should be mentioned.  First, start and end addresses
> > of reported modules cannot be assumed to contain segments from only
> > that module.  This has always been the case however.
>
> There is dwfl_addrmodule/dwfl_addrsegment to find the module that
> covers a specific address. Defined in libdwfl/segment.c. I think this
> should handle this by checking the closes load address. But I have not
> tested it.
>
> Normally only kernel modules (.ko ET_REL files) have multiple segments.
> So it might make sense to double check none of this impacts systemtap.

I'll look into this.

> > Second, the testcases in this patch use a firefox corefile that is
> > fairly large.  The .bz2 corefile is about 47M.  A clean elfutils repo
> > is currently about 42M, so this corefile more than doubles the size of
> > the elfutils repo.  I looked for a much smaller process with
> > interleaving non-contiguous shared library sections but was not able
> > to find one.  I've included the corefile and tests in this patch but
> > they can be removed if we'd prefer to not approx. double the size of
> > the repo.
>
> I really appreciate the testcase, but it really is too big. It is 736M
> bunzip2ed (which would happen on any make check). I think this makes
> the repo and the build/check a little too heavy. Also we try to include
> instructions to recreate any binary test files and that isn't really
> possible in this case.

Agreed, this isn't a great testcase.  I'm not sure if there's a way to
force the linker to create segments that reproduce the bug on a much
smaller process, but I'll see if I can write something by hand with
libelf.  Or maybe GNU poke can be of use here?  I'll take a look.

Aaron


      reply	other threads:[~2023-11-14 18:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-12 20:16 Aaron Merey
2023-11-13 14:44 ` Aaron Merey
2023-11-14 14:03 ` Mark Wielaard
2023-11-14 18:46   ` Aaron Merey [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='CAJDtP-T+Z-Jr=WnXquAQxN1WxoUk9vn2ouSjVwm7CrGqO37VFA@mail.gmail.com' \
    --to=amerey@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=mark@klomp.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).